我的网络设置由3台计算机(设备A、B、C)组成。设备A、B和C使用交换机通过以太网连接。只有设备A有互联网接入(wifi路由器,端口8000-8002转发给它)。
让我们假设设备A、B和C正在运行HTTP服务器,我希望从设备D ( Internet上某个地方的计算机)访问该服务器。然而,设备D只能通过设备A访问B和C,这需要一些端口魔法。
让我们假设以下地址和作业:
Device A:
192.168.5.100 (wlan0)
10.42.0.1 (eth0)
server on port 80
Device B:
10.42.0.2 (eth0)
server o
我有一个路由器,我在其中安装了一个Linux系统。
我要我的路由器支持NAT发夹
内核Linux中是否存在这样的特性?如果是,如何激活它?是否有一个补丁可以应用到我的内核上来支持发钉?
维基百科的发夹式解释:
Let us consider a private network with the following:
Gateway address: 192.168.0.1
Host 1: 192.168.0.5
Host 2: 192.168.0.7
The gateway has an external IP : 192.0.2.1
Host 1
我试图将数据包转发到AWS中的另一个内部IP地址。(Linux)。
我的场景是网关(EC2)(9.19.22.22)和两个内部IP地址(10.0.0.5)和(10.0.0.6)。
The packet coming to to 10.0.0.5 on 10009 from 17.16.0.99 (all) to be forwarded to 10.0.0.6 on 10010 port number.
iptables -t nat -A PREROUTING -p tcp -s 17.16.0.99/32 --dport 10009 -j DNAT --to-destination 10
当我读到罗斯蒂·罗素的NAT方法时,我看到了这一节:
6.2. Destination NAT
This is done in the PREROUTING chain, just as the packet comes in;
this means that anything else on the Linux box itself (routing, packet
filtering) will see the packet going to its `real' destination.
我对他所谓真正目的地的理解是,在被PREROUTING链上的一条规则改变之前
xxx:~# iptables -t NAT -A PREROUTING -d xxx.xxx.xxx.xxx -j DNAT --to-destination 10.0.1.2
WARNING: All config files need .conf: /etc/modprobe.d/bad_list, it will be ignored in a future release.
WARNING: All config files need .conf: /etc/modprobe.d/blacklist, it will be ignored in a future release.
i