本机有两个接口eth0
和eth1
。有上eth0
默认网关:将特定网络接口上的流量转发到特定主机
Destination Gateway Genmask Flags Metric Ref Use Iface
default 10.0.2.1 0.0.0.0 UG 0 0 0 eth0
10.0.2.0 * 255.255.255.0 U 0 0 0 eth0
10.0.2.0 * 255.255.255.0 U 0 0 0 eth1
我需要eth1
与iptables
设置规则来代理所有传入流量10.0.1.1
。
请注意,eth0
与静态IP地址10.0.2.2
相关联,而eth1
是动态的。
有一个port forwarding with netfilter指南,解释了如何在一个稍微简单的设置中做到这一点,但我无法弄清楚如何从他们的例子到我的。您提供的在the link
不是编程问题。相反,更适合[ubuntu.se]或[su]。 – 2014-10-31 14:33:03