简体   繁体   English

将外部 IP 地址路由到内部 IP NO DNS

[英]Route external IP address to internal IP NO DNS

I have an address 69.39.239.211 (external) I want to route/redirect to 192.168.0.22 (internal) to do some debug testing.我有一个地址 69.39.239.211(外部)我想路由/重定向到 192.168.0.22(内部)以进行一些调试测试。 I have a dd-wrt router so I can change the iptables as needed, I am just unsure of the syntax.我有一个 dd-wrt ​​路由器,所以我可以根据需要更改 iptables,我只是不确定语法。 Everything I've looked at is trying to do this through DNS but since it is an address, dns is never involved.我所看到的一切都试图通过 DNS 来做到这一点,但由于它是一个地址,因此从未涉及 dns。

So far迄今为止

iptables -t nat -A PREROUTING -i br0 -d 69.39.239.211 -j DNAT --to 192.168.0.1

will traceroute correctly but nmap won't see any open ports.将正确跟踪路由,但 nmap 不会看到任何打开的端口。

Here's the answer for anyone seeking to do that same thing.这是任何寻求做同样事情的人的答案。 What was missing was the second line.缺少的是第二行。 I also added the local subnet.我还添加了本地子网。

iptables -t nat -A PREROUTING -i br0 -s 192.168.0.0/24 -d 69.39.239.211 -j DNAT --to 192.168.0.1
iptables -t nat -A POSTROUTING -o br0 -j MASQUERADE

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM