分类: LINUX
2008-11-07 16:57:00
我的CentOS5.2在启动后,网卡不能够获得已经配置好的IP,而是通过DHCP获取IP地址。这是什么原因呢?
再看一下我设置好的网卡信息:
我设置的网卡启动IP是192.168.1.241,可是启动时却通过DHCP服务器获取了192.168.1.104这个地址。研究了半天ifcfg-eth0这个文件,不得要领。
看一下系统启动信息:
[root@mm iptables-1.4.0]# tail -n 58 /var/log/messages
Oct 29 08:13:33 mm kernel: eth0: link up
Oct 29 08:13:37 mm dhcdbd: Started up.
Oct 29 08:13:37 mm NetworkManager:
Oct 29 08:13:37 mm netplugd[2541]: Netlink packet came from pid 2922, not from kernel
Oct 29 08:13:37 mm NetworkManager:
Oct 29 08:13:37 mm NetworkManager:
Oct 29 08:13:37 mm NetworkManager:
Oct 29 08:13:37 mm NetworkManager:
Oct 29 08:13:37 mm NetworkManager:
Oct 29 08:13:37 mm NetworkManager:
Oct 29 08:13:38 mm dhcdbd: message_handler: message handler not found under /com/redhat/dhcp/eth0 for sub-path eth0.dbus.get.reason
Oct 29 08:13:38 mm NetworkManager:
Oct 29 08:13:38 mm NetworkManager:
Oct 29 08:13:38 mm dhcdbd: message_handler: message handler not found under /com/redhat/dhcp/eth0 for sub-path eth0.dbus.get.reason
Oct 29 08:13:38 mm NetworkManager:
Oct 29 08:13:38 mm NetworkManager:
Oct 29 08:13:38 mm NetworkManager:
Oct 29 08:13:38 mm NetworkManager:
Oct 29 08:13:38 mm NetworkManager:
Oct 29 08:13:38 mm NetworkManager:
Oct 29 08:13:38 mm NetworkManager:
Oct 29 08:13:38 mm NetworkManager:
Oct 29 08:13:38 mm NetworkManager:
Oct 29 08:13:38 mm NetworkManager:
Oct 29 08:13:38 mm NetworkManager:
Oct 29 08:13:38 mm NetworkManager:
Oct 29 08:13:39 mm NetworkManager:
Oct 29 08:13:39 mm NetworkManager:
Oct 29 08:13:39 mm NetworkManager:
Oct 29 08:13:39 mm NetworkManager:
Oct 29 08:13:39 mm dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 8
Oct 29 08:13:47 mm dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 20
Oct 29 08:13:47 mm dhclient: DHCPOFFER from 192.168.1.1
Oct 29 08:13:47 mm dhclient: DHCPREQUEST on eth0 to 255.255.255.255 port 67
Oct 29 08:13:47 mm dhclient: DHCPACK from 192.168.1.1
Oct 29 08:13:47 mm NetworkManager:
Oct 29 08:13:47 mm NetworkManager:
Oct 29 08:13:47 mm NetworkManager:
Oct 29 08:13:47 mm dhcdbd: message_handler: message handler not found under /com/redhat/dhcp/eth0 for sub-path eth0.dbus.get.host_name
Oct 29 08:13:47 mm dhcdbd: message_handler: message handler not found under /com/redhat/dhcp/eth0 for sub-path eth0.dbus.get.nis_domain
Oct 29 08:13:47 mm dhcdbd: message_handler: message handler not found under /com/redhat/dhcp/eth0 for sub-path eth0.dbus.get.nis_servers
Oct 29 08:13:47 mm NetworkManager:
Oct 29 08:13:47 mm NetworkManager:
Oct 29 08:13:47 mm NetworkManager:
Oct 29 08:13:47 mm NetworkManager:
Oct 29 08:13:47 mm NetworkManager:
Oct 29 08:13:47 mm NetworkManager:
Oct 29 08:13:47 mm NetworkManager:
Oct 29 08:13:47 mm NetworkManager:
Oct 29 08:13:47 mm NetworkManager:
Oct 29 08:13:47 mm NetworkManager:
Oct 29 08:13:47 mm NetworkManager:
Oct 29 08:13:47 mm dhclient: bound to 192.168.1.104 -- renewal in 3260 seconds.
Oct 29 08:13:48 mm NetworkManager:
Oct 29 08:13:48 mm NetworkManager:
Oct 29 08:13:48 mm NetworkManager:
Oct 29 08:21:41 mm kernel: warning: process `system-config-n' used the deprecated sysctl system call with 1.23.
Oct 29 08:23:08 mm kernel: warning: process `system-config-n' used the deprecated sysctl system call with 1.23.
[root@mm iptables-1.4.0]#
原来错误出在“Network configuration for device 'eth0' was invalid (non-DHCP configuration, but no gateway specified. Will use DHCP instead.”因为ifcfg-eth0文件中没有网关信息。
编辑ifcfg-eth0文件,加入一行“GATEWAY=192.168.1.1”,保存后退出,再看一眼现在的配置:
重启系统 #reboot 之后,网卡已经正常工作了。
张蒙
2008.11.07