Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1308890
  • 博文数量: 268
  • 博客积分: 10698
  • 博客等级: 上将
  • 技术积分: 2867
  • 用 户 组: 普通用户
  • 注册时间: 2007-07-14 22:21
文章分类

全部博文(268)

文章存档

2012年(19)

2011年(13)

2010年(29)

2009年(26)

2008年(99)

2007年(82)

我的朋友

分类: LINUX

2008-03-28 11:47:55

我的系统中装了dhclient,由它向路由器里面的dhcp服务器发出请求,要求分配IP,Debian的网络配置文件是/etc/network/interfaces,它决定哪个网络设备来用这个IP,如果dhcp服务器发出了回应,却找不到配置文件中的网络设备所对应的物理设备,那么自动分配宣告失败。问题有时候会出现在独立网卡上面,在PCI上的插槽位置的变化会使网卡的设备号发生变化,用ifconfig加上-a的参数可以知道网卡设备号是什么,比如,原来网卡的设备号是eth0,这个0指第一块网卡,但把网卡换了插槽,下一次系统启动后会识别到现在的网卡的位置与原来所记录的不同,它会自动把现在的网卡认为是第二块网卡,所以把它认作eth1,如果再换另一个插槽,它又变回eth0,如果我们换一块带集成网卡的另一个主板,同样的系统会把这个网卡识别为eth2,所以,如果想要避免硬件变动带来的配置上的不便,可以在/etc/network/interfaces 中把网卡可能出现的设备号eth0、eth1、eth2全写进去:

# 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 eth0 eth1 eth2
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
iface eth0 inet dhcp

allow-hotplug eth1
iface eth1 inet dhcp

allow-hotplug eth2
iface eth2 inet dhcp
阅读(1317) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~