多网卡下DHCP服务不稳定的解决
linux下的各种应用服务相对于windows下的同样服务,有着很强的稳定性优势,DHCP亦如是 。而公司内部网络的DHCP服务也是由linux搭建的网关提供。平时该服务运行的还倒是十分稳定。不过最近倒是罢工了一次 ,通过services dhcpd restart 没有任何报错,通过查看/var/log/messages看到如下报错信息:
1Oct 22 10:15:52 gataway dhcpd: No subnet declaration for eth0 (115.236.XXX.XXX).
2Oct 22 10:15:52 gataway dhcpd: ** Ignoring requests on eth0. If this is not what
3Oct 22 10:15:52 gataway dhcpd: you want, please write a subnet declaration
4Oct 22 10:15:52 gataway dhcpd: in your dhcpd.conf file for the network segment
5Oct 22 10:15:52 gataway dhcpd: to which interface eth0 is attached. **
上面的eth0(115.236.XXX.XXX)为我网关接外网的网卡,IP为我ISP提供给我的外网IP 。怎么DHCP要为外网提供DHCP服务? 这显然是不对的,因为我DHCP服务是通过eth1网卡(内网)给内部用户提供服务的。
还好可以通过电脑直连猫上外网 ,查找了下解决方法如下。打开 /etc/sysconfig/dhcpd配置文件,将DHCP 服务绑定的网卡固定就行了 。
1[root@gataway ]# vim /etc/sysconfig/dhcpd
2# Command line options here
3DHCPDARGS=eth1
完成上面的配置以后,再services dhcpd restart 重启服务 。内网机器重新获取地址,可以正常得到地址。OK,收工!
捐赠本站(Donate)
如您感觉文章有用,可扫码捐赠本站!(If the article useful, you can scan the QR code to donate))
- Author: shisekong
- Link: https://blog.361way.com/dhcp-error/1827.html
- License: This work is under a 知识共享署名-非商业性使用-禁止演绎 4.0 国际许可协议. Kindly fulfill the requirements of the aforementioned License when adapting or creating a derivative of this work.