5

主机重启后网络概率性不通

 2 years ago
source link: https://blog.kelu.org/tech/2022/03/19/dhcp-dhclient.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

主机重启后网络概率性不通

2022-03-19     tech linux

linux.jpg

云厂商的主机实例一般默认使用DHCP(动态主机设置协议,Dynamic Host Configuration Protocol)为弹性网卡自动分配IP地址,并获得IP地址租约到期时间。正常情况下,Linux 实例的dhclient进程会定期向DHCP服务器更新租约到期时间,以确保实例IP地址的可用性。以下情况可能引发Linux实例的DHCP服务出现异常,导致实例网络不通:

  • 网卡配置文件存在错误
  • 网卡对应的dhclient进程未运行

网卡配置文件和操作系统有关,这里暂不展开了,只讲dhclient的内容。在Linux实例中执行以下命令,检查对应网卡的dhclient进程运行状态。我的网卡名叫eth0。

ps aux | grep dhclient | grep eth0

系统无返回结果,说明dhclient进程未运行。执行如下命令启动:

dhclient eth0
# 或者
ifup eth0

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK