我一直在尝试这个设置好几个星期,但仍然无法使这个工作…
Ubuntu 12.04 64位2 nic
nic1:eth0:192.168.2.33 – 静态IP与互联网接入(连接到调制解调器)
nic2:eth1:192.168.1.2 -static ip连接到局域网。
启用ip_forward在Ubuntu的盒子net_ip_forward = 1
在局域网的IP地址192.168.1.5指定的网关为192.168.1.2,并能ping通gateway.But不能ping公共地址。我缺less什么? 在路由器框上:
route -n Destination Gateway Genmask Flags Metric Ref Use Iface 0.0.0.0 192.168.2.1 0.0.0.0 UG 100 0 0 eth0 192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1 192.168.2.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
试着
ip route add 192.168.2.0/24 via 192.168.1.2 dev eth0
路由-n在局域网192.168.1.5
Destination Gateway Genmask Flags Metric Ref Use Iface 0.0.0.0 192.168.1.2 0.0.0.0 UG 100 0 0 eth0 192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 192.168.2.0 192.168.1.2 255.255.255.0 UG 0 0 0 eth0
iptables默认的策略是接受所有的。
来自LAN的tracepath 8.8.8.8
1: 192.168.1.5 0.060ms pmtu 1500 1: 192.168.1.2 3.367ms 1: 192.168.1.2 3.764ms 2: no reply
有没有办法做这个工作,除了NAT。
192.168.2.1也不是公开地址。 那是什么盒子? 它知道如何将stream量路由回192.168.1.5? 它是否为192.168.2.0/24以外的networking执行NAT?