我有一台运行在云中的服务器(我将其称为S1 ),但这是行为不当的。 我也有另一个服务器( S2 )运行在同一个云networking中,通过一个单独的networking( eth1 )连接到S1 。
服务器S1通过eth1连接到该内部networking,并通过eth0直接连接到Web。
S1正在运行Debian Jessie,通过更改/etc/apt/sources.list从一个干净的Debian Wheezy升级。
S2完美的运行Debian Wheezy。 与升级之前的S1相同的清洁Debian Wheezy。
S1
eth0 。 S1 ( S2 )
eth1 。 S1连接到另一台服务器( S2 )
eth1 。 S1连接到外部世界
eth0 eth1 8.8.8.8 (而S2 可以 ); 我无法parsing主机(使用/etc/resolv.conf 8.8.8.8 ) 为什么我不能连接到外部世界,我还没有最奇怪的想法。
$ iptables -L Chain INPUT (policy ACCEPT) target prot opt source destination Chain FORWARD (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination
$ cat /etc/resolv.conf nameserver 10.147.234.1 nameserver 8.8.8.8 nameserver 8.8.4.4
$ cat /etc/network/interfaces # The loopback network interface auto lo iface lo inet loopback # The one directly connected to the web auto eth0 iface eth0 inet dhcp # The one connected to the internal network auto eth1 iface eth1 inet dhcp
$ ping -I eth0 8.8.8.8 PING 8.8.8.8 (8.8.8.8) from (MY_IP) eth0: 56(84) bytes of data. From (MY_IP) icmp_seq=1 Destination Host Unreachable From (MY_IP) icmp_seq=2 Destination Host Unreachable From (MY_IP) icmp_seq=3 Destination Host Unreachable $ ping -I eth1 8.8.8.8 PING 8.8.8.8 (8.8.8.8) from (INTERNAL_IP) eth0: 56(84) bytes of data. From (INTERNAL_IP) icmp_seq=1 Destination Host Unreachable From (INTERNAL_IP) icmp_seq=2 Destination Host Unreachable From (INTERNAL_IP) icmp_seq=3 Destination Host Unreachable
$ route -n Destination Gateway Genmask Flags Metric Ref Use Iface 10.147.234.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1 (SUBNET_MY_IP (ends 0)) 0.0.0.0 255.255.255.0 U 0 0 0 eth0 169.254.169.254 85.222.226.153 255.255.255.255 UGH 0 0 0 eth0
$ cat /proc/sys/net/ipv4/ip_forward 0
$ ifconfig -a eth0 Link encap:Ethernet HWaddr fa:16:3e:d9:ab:b0 inet addr:(MY_IP) Bcast:(MY_IP_BUT_ENDS_WITH_255) Mask:255.255.255.0 inet6 addr: (MY_v6_IP) Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:75300 errors:0 dropped:0 overruns:0 frame:0 TX packets:689 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:9905366 (9.4 MiB) TX bytes:86792 (84.7 KiB) eth1 Link encap:Ethernet HWaddr fa:16:3e:2c:d7:80 inet addr:10.147.234.6 Bcast:10.147.234.255 Mask:255.255.255.0 inet6 addr: (MY_INTERNAL_6_IP) Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:177 errors:0 dropped:0 overruns:0 frame:0 TX packets:11 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:11626 (11.3 KiB) TX bytes:1346 (1.3 KiB) lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:65536 Metric:1 RX packets:135 errors:0 dropped:0 overruns:0 frame:0 TX packets:135 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:22168 (21.6 KiB) TX bytes:22168 (21.6 KiB)
根据ICMP请求的结果你有路由问题,给我们看看: route -n , cat /proc/sys/net/ipv4/ip_forward和ifconfig -a 。
更新后:路由表中没有默认路由,可以通过route add default gw xxxx ,您应该将结果与工作机器进行比较,并search包含以下内容的行: Destination Gateway Genmask Flags Metric Ref Use Iface 0.0.0.0 xxxx 0.0.0.0 UG 1024 0 0 eth0
正如qasdfdsaq正确指出,这不是持久的解决scheme。