重启和本地 IP 更改后服务器行为异常

重启和本地 IP 更改后服务器行为异常

操作系统:Ubuntu 服务器 16.04。

所以我将本地 IP 从 c 类改为 a 类。现在我在服务器上遇到了一个奇怪的问题。

(我使用本地 PC 上设置的静态 SSH IP 连接到服务器)

重启后无法连接 WAN。如果我尝试 ping 8.8.8.8,会出现此信息 From <old class c. IP> icmp_seq=1 Destination Host Unreachable

ifconfig 显示它正在使用新的静态设置的 A 类 IP。

临时修复: dhclient -r -v <interface> && rm /var/lib/dhcp/dhclient.* ; dhclient -v <interface> 这将返回

dhclient -v <interface>
Internet Systems Consortium DHCP Client 4.3.3
Copyright 2004-2015 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/<interface>
Sending on   LPF/<interface>
Sending on   Socket/fallback
DHCPRELEASE on <interface> to <gateway IP> port 67 (xid=0x4cf127f2)
Internet Systems Consortium DHCP Client 4.3.3
Copyright 2004-2015 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/<interface>
Sending on   LPF/<interface>
Sending on   Socket/fallback
DHCPDISCOVER on <interface> to 255.255.255.255 port 67 interval 3 (xid=0x72c4ab2e)
DHCPREQUEST of <the new statically set IP> on <interface> to 255.255.255.255 port 67 (xid=0x2eabc472)
DHCPOFFER of <the new statically set IP> from <gateway IP>
DHCPACK of <the new statically set IP> from <gateway IP>
bound to <the new statically set IP> -- renewal in 18113 seconds.

但这只是暂时的,重新启动后问题又会出现。

我该如何解决这个问题?

相关内容