Ubuntu 14.04 静态 IP 服务器无法 ping 通路由器或互联网

Ubuntu 14.04 静态 IP 服务器无法 ping 通路由器或互联网

我搜索了很多,发现很多类似的问题,但没有解决方案。请帮忙。

Ubuntu 14.04 服务器(server1)具有静态 IP,充当 DNS 和 DHCP 服务器。它可以正常连接到网络上的其他服务器(具有静态 IP)和客户端(使用 DHCP),但无法连接到 Internet,也无法 ping 我的路由器。我的路由器也无法 ping 或跟踪 server1,但可以 ping 网络上的其他机器。DNS 和 DHCP 似乎在网络上工作正常,并且 server1 上的 DNS 日志文件正在动态更新。

以前,旧的 Linksys 路由器工作正常,并充当 DHCP 服务器。我安装了新的 Netgear C6300 路由器,一切仍然正常。然后我从 Ubuntu 12.04 更新到 14.04。然后我将 DHCP 服务器从路由器切换到 Ubuntu 服务器。现在服务器已经无法 ping 路由器和访问网络......虽然我知道在我安装新路由器后它还能工作一段时间。我相信路由器在某个时候也会自动更新其固件,我不确定这个问题是否就是在那个时候出现的。

布局:

  • 192.168.1.1 = 带 wifi 的 Netgear C6300 路由器(不充当 DHCP 服务器)
  • 192.68.1.2 = Netgear GS724T 智能交换机连接到路由器
  • 192.168.1.6 - 192.168.1.25 = DHCP 范围,Windows 和 Android 客户端,连接到路由器上的 wifi
  • server1 = 192.68.1.100 = Ubuntu 14.04,DNS 和 DHCP 服务器,静态 IP,连接到智能交换机,这是问题所在
  • server2 = 192.68.1.101 = Windows Web Server 2003,静态 IP,连接到智能交换机,工作正常
  • server3 = 192.68.1.102 = CentOS 6,静态 IP,连接到智能交换机,工作正常

server1(192.168.1.100)的行为:

  • 无法 ping 通路由器,路由器也无法 ping 通它。
  • 可以 ping 通智能开关
  • 可以 ping 其他静态 IP 服务器并接收来自它们的 ping
  • 可以 ping DHCP 客户端(例如 192.168.1.6)并接收来自它们的 ping
  • 接受来自本地客户端的 SSH 连接
  • 无法连接到互联网,也无法 ping 任何网络 IP
  • 有时会出现在路由器的“附加设备”表中
  • 我尝试关闭防火墙并测试 ping 路由器,但仍然不起作用。

其他机器的行为:

  • 可以 ping 通路由器,路由器也可以 ping 通它们。
  • 可以 ping 服务器 1
  • 通过 SSH 连接到 server1
  • 可以连接到互联网并 ping 网络 IP
  • 始终显示在路由器的“附加设备”表中
  • 智能交换机可以接受来自路由器和服务器 1 的 ping

/etc/网络/接口

# 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.100
netmask 255.255.255.0
gateway 192.168.1.1
network 192.168.1.0
broadcast 192.168.1.255
dns-nameservers 127.0.0.1
dns-search xx.lan
dns-domain xx.lan

/etc/resolv.conf:

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 127.0.0.1
search xx.lan

是否配置

eth0      Link encap:Ethernet  HWaddr 00:0b:db:94:20:e3
          inet addr:192.168.1.100  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: 2601:187:8400:673c:9d87:98c5:8063:b35e/64 Scope:Global
          inet6 addr: 2601:187:8400:673c:6472:fd28:10d8:17c7/64 Scope:Global
          inet6 addr: 2601:187:8400:673c:e058:2568:41d8:d42b/64 Scope:Global
          inet6 addr: 2601:187:8400:673c:20b:dbff:fe94:20e3/64 Scope:Global
          inet6 addr: fe80::20b:dbff:fe94:20e3/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:648391 errors:0 dropped:0 overruns:0 frame:0
          TX packets:156845 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:64451406 (64.4 MB)  TX bytes:19330886 (19.3 MB)
          Interrupt:16

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:16436  Metric:1
          RX packets:174552 errors:0 dropped:0 overruns:0 frame:0
          TX packets:174552 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:40028479 (40.0 MB)  TX bytes:40028479 (40.0 MB)

ping -c 3 192.168.1.1
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
From 192.168.1.100 icmp_seq=2 Destination Host Unreachable
From 192.168.1.100 icmp_seq=3 Destination Host Unreachable
--- 192.168.1.1 ping statistics ---
3 packets transmitted, 0 received, +2 errors, 100% packet loss, time 2016ms

ping -c 3 192.168.1.2
PING 192.168.1.2 (192.168.1.2) 56(84) bytes of data.
64 bytes from 192.168.1.2: icmp_seq=1 ttl=64 time=0.587 ms
64 bytes from 192.168.1.2: icmp_seq=2 ttl=64 time=46.3 ms
64 bytes from 192.168.1.2: icmp_seq=3 ttl=64 time=0.623 ms
--- 192.168.1.2 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2000ms

ping -c 3 192.168.1.100
PING 192.168.1.100 (192.168.1.100) 56(84) bytes of data.
64 bytes from 192.168.1.100: icmp_seq=1 ttl=64 time=0.079 ms
64 bytes from 192.168.1.100: icmp_seq=2 ttl=64 time=0.066 ms
64 bytes from 192.168.1.100: icmp_seq=3 ttl=64 time=0.062 ms
--- 192.168.1.100 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 1998ms
rtt min/avg/max/mdev = 0.062/0.069/0.079/0.007 ms

ping -c 3 192.168.1.102
PING 192.168.1.102 (192.168.1.102) 56(84) bytes of data.
64 bytes from 192.168.1.102: icmp_seq=1 ttl=64 time=0.197 ms
64 bytes from 192.168.1.102: icmp_seq=2 ttl=64 time=0.149 ms
64 bytes from 192.168.1.102: icmp_seq=3 ttl=64 time=0.121 ms
--- 192.168.1.102 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 1999ms
rtt min/avg/max/mdev = 0.121/0.155/0.197/0.034 ms

ping -c 3 192.168.1.6
PING 192.168.1.6 (192.168.1.6) 56(84) bytes of data.
64 bytes from 192.168.1.6: icmp_seq=1 ttl=128 time=9.66 ms
64 bytes from 192.168.1.6: icmp_seq=2 ttl=128 time=4.37 ms
64 bytes from 192.168.1.6: icmp_seq=3 ttl=128 time=3.98 ms
--- 192.168.1.6 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 3.984/6.008/9.665/2.591 ms

/etc/bind/named.conf.options

acl goodclients {
        192.168.1.0/24 ;
        localhost ;
        localnets ;
};

acl trusted {
        localhost ;             #localhost
        192.168.1.0/24 ;
};

options {
        directory "/var/cache/bind/zones";

        recursion yes;                                  # enables resursive queries
                allow-recursion { trusted; };   # allows recursive queries from "trusted" clients
        allow-query { goodclients; };   # allows "good" clients to query (the whole 192.168.1 subnet)
        listen-on { 127.0.0.1; 192.168.1.100; };        # server1 private IP address - listen on private network only
        allow-transfer { goodclients; };        # disable zone transfers by default


        // If there is a firewall between you and nameservers you want
        // to talk to, you may need to fix the firewall to allow multiple
        // ports to talk.  See http://www.kb.cert.org/vuls/id/800113

        // If your ISP provided one or more IP addresses for stable
        // nameservers, you probably want to use them as forwarders.
        // Uncomment the following block, and insert the addresses replacing
        // the all-0's placeholder.

        forward first;
                forwarders {
                                207.172.3.9;    //L3
                                4.2.2.5;        //Genuity
        };

                dnssec-enable no;
                dnssec-validation no;

        auth-nxdomain no;    # conform to RFC1035
        listen-on-v6 { any; };
};

/etc/bind/named.conf.local

// Do any local configuration here
//
// Consider adding the 1918 zones here, if they are not used in your
// organization include "/etc/bind/zones.rfc1918";
//

include "/etc/bind/rndc.key";

zone "1.168.192.in-addr.arpa" {
    type master;
    file "/var/lib/bind/zones/rev.1.168.192.in-addr.arpa";
        allow-update { key rndc-key; };                                         # allow update from clients with this key
        notify yes;
};

zone "xx.lan" IN {
    type master;
    file "/var/lib/bind/zones/xx.lan.db";
        allow-update { key rndc-key; };                                         # allow update from clients with this key
        notify yes;
};

/var/lib/bind/zones/xx.lan.db

$ORIGIN .
$TTL 604800     ; 1 week
xx.lan                  IN SOA  server1.xx.lan. tech.email.com. (
                                2015102430 ; serial
                                28800      ; refresh (8 hours)
                                3600       ; retry (1 hour)
                                604800     ; expire (1 week)
                                36000      ; minimum (10 hours)
                                )
                        NS      server1.xx.lan.
$ORIGIN xx.lan.
$TTL 3600       ; 1 hour
e6500                   A       192.168.1.6
                        TXT     "3162db65ed92629b5cd94d99bb7b492987"
$TTL 604800     ; 1 week
localhost               CNAME   server1
$TTL 3600       ; 1 hour
m4600                   A       192.168.1.8
                        TXT     "31e36ff666bee353e79bc3f88f6798e595"
$TTL 604800     ; 1 week
netgearc6300            A       192.168.1.1
netgeargs724t           A       192.168.1.2
server2                 A       192.168.1.101
server1                 A       192.168.1.100
server3                 A       192.168.1.102
$TTL 604800     ; 1 week
www                     CNAME   server1

/var/lib/bind/zones/rev.1.168.192.in-addr.arpa

$ORIGIN .
$TTL 604800     ; 1 week
1.168.192.in-addr.arpa  IN SOA  server1.xx.lan. tech.advantagerugby.com. (
                                2015102411 ; serial
                                28800      ; refresh (8 hours)
                                3600       ; retry (1 hour)
                                604800     ; expire (1 week)
                                36000      ; minimum (10 hours)
                                )
                        NS      server1.xx.lan.
$ORIGIN 1.168.192.in-addr.arpa.
1                       PTR     netgearc6300.xx.lan.
2                       PTR     netgeargs724t.xx.lan.
$TTL 604800     ; 1 week
100                     PTR     server1.xx.lan.
101                     PTR     server2.xx.lan.
102                     PTR     server3.xx.lan.
                        PTR     xx.lan.
$TTL 3600       ; 1 hour
8.1.168.192             PTR     m4600.xx.lan.
6                       PTR     e6500.xx.lan.

路由

default via 192.168.1.1 dev eth0
169.254.0.0/16 dev eth0  scope link  metric 1000
192.168.1.0/24 dev eth0  proto kernel  scope link  src 192.168.1.100

ARP

Address                  HWtype  HWaddress           Flags Mask            Iface
e6500.xx.lan             ether   00:21:6a:26:d7:c6   C                     eth0
android-d2def8bec293334  ether   98:d6:f7:88:38:b2   C                     eth0
192.168.1.8              ether   24:77:03:2b:24:24   C                     eth0
192.168.1.9              ether   00:1d:09:2f:4c:ac   C                     eth0
server2.xx.lan           ether   00:04:23:86:f0:cb   C                     eth0
android-d8bb6eddaacb8dd  ether   f8:84:f2:02:3d:dc   C                     eth0
server3.xx.lan           ether   00:12:3f:ec:f0:3a   C                     eth0
netgearc6300.xx.lan              (incomplete)                              eth0

谁能看到任何可能提供线索的东西?

在此先感谢您的帮助。

根据请求更新

tcpdump

sudo tcpdump -i eth0
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes
12:46:02.316789 IP pe1750-3.as.lan.ssh > 192.168.1.6.54419: Flags [P.], seq 1055870237:1055870273, ack 2041895597, win 1603, length 36
12:46:02.321889 IP 192.168.1.6.54419 > pe1750-3.as.lan.ssh: Flags [.], ack 36, win 16218, length 0
12:46:03.071668 ARP, Request who-has 192.168.1.1 tell pe1750-3.as.lan, length 28
12:46:03.198355 IP 192.168.1.6.netbios-ns > 192.168.1.255.netbios-ns: NBT UDP PACKET(137): QUERY; REQUEST; BROADCAST
12:46:03.319996 IP pe1750-3.as.lan.ssh > 192.168.1.6.54419: Flags [P.], seq 36:128, ack 1, win 1603, length 92
12:46:03.320048 IP pe1750-3.as.lan.ssh > 192.168.1.6.54419: Flags [P.], seq 128:164, ack 1, win 1603, length 36
12:46:03.320778 IP pe1750-3.as.lan.ssh > 192.168.1.6.54419: Flags [P.], seq 164:216, ack 1, win 1603, length 52
12:46:03.321677 IP pe1750-3.as.lan.ssh > 192.168.1.6.54419: Flags [P.], seq 216:260, ack 1, win 1603, length 44
12:46:03.325460 IP 192.168.1.6.54419 > pe1750-3.as.lan.ssh: Flags [.], ack 164, win 16186, length 0
12:46:03.325692 IP 192.168.1.6.54419 > pe1750-3.as.lan.ssh: Flags [.], ack 260, win 16162, length 0
12:46:03.948314 IP 192.168.1.6.netbios-ns > 192.168.1.255.netbios-ns: NBT UDP PACKET(137): QUERY; REQUEST; BROADCAST
12:46:04.072080 IP pe1750-3.as.lan.ssh > 192.168.1.6.54255: Flags [P.], seq 3186349454:3186349490, ack 684974901, win 1603, length 36
12:46:04.088953 ARP, Request who-has 192.168.1.1 tell pe1750-3.as.lan, length 28
12:46:04.276914 IP 192.168.1.6.54255 > pe1750-3.as.lan.ssh: Flags [.], ack 36, win 16213, length 0
12:46:04.322982 IP pe1750-3.as.lan.ssh > 192.168.1.6.54419: Flags [P.], seq 260:328, ack 1, win 1603, length 68
12:46:04.323121 IP pe1750-3.as.lan.ssh > 192.168.1.6.54419: Flags [P.], seq 328:436, ack 1, win 1603, length 108
12:46:04.323208 IP pe1750-3.as.lan.ssh > 192.168.1.6.54419: Flags [P.], seq 436:536, ack 1, win 1603, length 100
12:46:04.328437 IP 192.168.1.6.54419 > pe1750-3.as.lan.ssh: Flags [.], ack 436, win 16118, length 0
12:46:04.528043 IP 192.168.1.6.54419 > pe1750-3.as.lan.ssh: Flags [.], ack 536, win 16093, length 0
12:46:04.698113 IP 192.168.1.6.netbios-ns > 192.168.1.255.netbios-ns: NBT UDP PACKET(137): QUERY; REQUEST; BROADCAST
12:46:05.087654 ARP, Request who-has 192.168.1.1 tell pe1750-3.as.lan, length 28
12:46:05.324436 IP pe1750-3.as.lan.ssh > 192.168.1.6.54419: Flags [P.], seq 536:684, ack 1, win 1603, length 148
12:46:05.449430 IP 192.168.1.6.netbios-ns > 192.168.1.255.netbios-ns: NBT UDP PACKET(137): QUERY; REQUEST; BROADCAST
12:46:05.528911 IP 192.168.1.6.54419 > pe1750-3.as.lan.ssh: Flags [.], ack 684, win 16425, length 0
12:46:06.087661 ARP, Request who-has 192.168.1.1 tell pe1750-3.as.lan, length 28
12:46:06.198837 IP 192.168.1.6.netbios-ns > 192.168.1.255.netbios-ns: NBT UDP PACKET(137): QUERY; REQUEST; BROADCAST
12:46:06.325543 IP pe1750-3.as.lan.ssh > 192.168.1.6.54419: Flags [P.], seq 684:752, ack 1, win 1603, length 68
12:46:06.325630 IP pe1750-3.as.lan.ssh > 192.168.1.6.54419: Flags [P.], seq 752:820, ack 1, win 1603, length 68
12:46:06.330675 IP 192.168.1.6.54419 > pe1750-3.as.lan.ssh: Flags [.], ack 820, win 16391, length 0
12:46:06.949389 IP 192.168.1.6.netbios-ns > 192.168.1.255.netbios-ns: NBT UDP PACKET(137): QUERY; REQUEST; BROADCAST
12:46:07.088090 IP pe1750-3.as.lan.ssh > 192.168.1.6.54255: Flags [P.], seq 36:72, ack 1, win 1603, length 36
12:46:07.104948 ARP, Request who-has 192.168.1.1 tell pe1750-3.as.lan, length 28
12:46:07.293994 IP 192.168.1.6.54255 > pe1750-3.as.lan.ssh: Flags [.], ack 72, win 16204, length 0
^C
33 packets captured
38 packets received by filter
0 packets dropped by kernel

答案1

我把 IP 改成了其他的,一切正常。我不知道为什么 192.168.1.100 不起作用。

答案2

第一阶段分配其他 IP 地址(最好是自动分配)并检查状态。第二阶段是重置网络配置以及检查智能交换机配置。据我所知,智能交换机有些问题。

答案3

因此,我以某种方式重现了此错误并验证了 DHCP 是否按预期工作。但是,我选择的静态 IP 无法正常工作。我只能 ping 内部主机。令人费解的是,我想要使用的静态 IP 实际上并不空闲,即使它超出了 dhcp 模式的范围。果然,该 IP 已被未记录的设备使用,因此,如果您看到此问题,则您的静态 IP 已被使用!!因此,任何其他未使用的静态 IP 都可以正常工作。所有其他分析都不相关,它只是试图使用已在使用中的 IP 的愚蠢举动。不幸的是,Ubuntu 不会告诉您存在 IP 冲突。干杯

相关内容