上述设置一切正常。
现在,服务器的eth1连接到千兆交换机。 服务器上的DHCP3使用此configuration在eth1上提供请求
subnet 172.16.0.0 netmask 255.255.255.0 { range 172.16.0.151 172.16.0.199; option domain-name-servers 194.30.220.117,194.30.220.114; option domain-name "XXXXXXXXXXXXXXX"; option routers 172.16.0.1; option broadcast-address 172.16.0.255; default-lease-time 600; max-lease-time 7200; }
和/ etc / network / interfaces
auto lo iface lo inet loopback allow-hotplug eth0 iface eth0 inet static address 172.16.0.240 netmask 255.255.255.0 auto eth0 allow-hotplug eth1 iface eth1 inet static address 172.16.0.1 netmask 255.255.255.0 up route add -host 255.255.255.255 eth1 auto eth1
客户端获得IP,但无法访问路由器(PC1和PC2)的其他端口或服务器本身(在172.16.0.1或172.16.0.240上)。 此外,他们无法访问互联网。
我启用了ipv4转发echo "1" > /proc/sys/net/ipv4/ip_forward
也route -n
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 255.255.255.255 0.0.0.0 255.255.255.255 UH 0 0 0 eth1 172.16.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 172.16.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
想法?
谢谢
你遇到的问题是你试图使用路由,但你不是路由。 路由意味着不同networking之间的stream量通过。 你有两个在同一个networking上的接口。 你想要的是: