Ubuntu 14.04 可以访问 LAN 但不能访问 Internet(Verizon Fios)

Ubuntu 14.04 可以访问 LAN 但不能访问 Internet(Verizon Fios)

我已经为此苦苦挣扎了很长时间。我经常不在家,并且有一个 Ubuntu 14.04 服务器(SSH、HTTP、Transmission、Plex),通过我的 Verizon Fios 路由器(FiOS-G1100)转发正确的端口。我们最近遇到了一场暴风雪,出于某种原因,将光纤数据转换为同轴电缆的盒子不得不由 Verizon 更换。从那时起,我的服务器只能间歇性地连接到互联网(我只能间歇性地从网络外部连接到它)。Fios 路由器是 192.168.1.1。我得到的 ping 结果如下(其中 192.16.31.23 是 verizon.com):

$  ping -i 15 verizon.com | while read pong; do echo "$(date): $pong"; done
Wed Feb 10 15:50:08 EST 2016: 64 bytes from 192.16.31.23: icmp_seq=142 ttl=59 time=9.62 ms
Wed Feb 10 15:50:23 EST 2016: From 192.16.31.23 icmp_seq=143 Destination Net Unreachable
Wed Feb 10 15:50:38 EST 2016: 64 bytes from 192.16.31.23: icmp_seq=144 ttl=59 time=10.0 ms
Wed Feb 10 15:50:53 EST 2016: From 192.16.31.23 icmp_seq=145 Destination Net Unreachable
Wed Feb 10 15:51:08 EST 2016: From 192.16.31.23 icmp_seq=146 Destination Net Unreachable

...等等。以下是跟踪路由的结果:

$ traceroute 192.16.31.23
traceroute to 192.16.31.23 (192.16.31.23), 30 hops max, 60 byte packets
 1  192.168.1.1 (192.168.1.1)  0.387 ms  0.564 ms  0.738 ms
 2  192.168.1.1 (192.168.1.1)  0.925 ms !N  1.111 ms !N  1.288 ms !N

我可以运行这些命令的唯一原因是,我在一台 Windows 计算机上安装了 TeamViewer,并且我可以通过该计算机可靠地进行 SSH。我可以成功 ping 并连接到 LAN 上的其他计算机。我的服务器通过路由器和/etc/network/interfaces

$ cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.1.5
netmask 255.255.255.0
gateway 192.168.1.1

端口已正确转发。我的 iptables 已刷新。LAN 上的其他计算机可以毫无问题地访问互联网。这是怎么回事?我还能做些什么来更好地诊断这个问题?这可能是路由器问题吗?我查看了路由器上的所有配置,没有发现任何限制我服务器的东西。我还发现,重新启动路由器可以解决问题约一分钟(这是可变的),然后问题会再次出现。

其他一些可能有用的输出:

$ sudo route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.1.1     0.0.0.0         UG    0      0        0 eth0
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0

$ ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=0.370 ms
64 bytes from 192.168.1.1: icmp_seq=2 ttl=64 time=0.342 ms

$ traceroute 192.168.1.1
traceroute to 192.168.1.1 (192.168.1.1), 30 hops max, 60 byte packets
 1  192.168.1.1 (192.168.1.1)  0.484 ms  0.709 ms  0.945 ms

$ ping 192.168.1.4
PING 192.168.1.4 (192.168.1.4) 56(84) bytes of data.
64 bytes from 192.168.1.4: icmp_seq=1 ttl=128 time=0.423 ms
64 bytes from 192.168.1.4: icmp_seq=2 ttl=128 time=0.431 ms

$ traceroute 192.168.1.4
traceroute to 192.168.1.4 (192.168.1.4), 30 hops max, 60 byte packets
 1  * * *
 2  * * *
 ...
30  * * *

$ sudo 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

编辑:为了清晰起见,进行了编辑。

答案1

我实际上很幸运地解决了这个问题。结果发现网络上有一个交换机的 IP 与路由器相同,这导致了这个问题。我认为交换机在电涌中被重置并采用其默认配置(作为路由器)。当我从服务器上的 X11 隧道窗口导航到 192.168.1.1 时,我只能通过交换机而不是路由器的管理屏幕来解决这个问题。吸取教训。有趣的是,服务器甚至没有通过交换机路由。

相关内容