ubuntu10.4下更改eth5为eth0

最近在做nfs挂载根文件系统是老是挂载不上,而我的网卡是eth5,本以为Ping通eth5就OK,原来系统默认eth0挂载rootfs.
root@ubuntu:/etc/udev/rules.d#ifconfig -a

eth5     Link encap:Ethernet  HWaddr00:0c:29:c6:bc:7c  
         inet addr:192.168.16.25  Bcast:192.168.16.255  Mask:255.255.255.0
         inet6 addr: fe80::20c:29ff:fec6:bc7c/64 Scope:Link
         UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
         RX packets:1111 errors:0 dropped:0 overruns:0 frame:0
         TX packets:871 errors:0 dropped:0 overruns:0 carrier:0
         collisions:0 txqueuelen:1000 
         RX bytes:152479 (152.4 KB)  TX bytes:106075 (106.0 KB)
         Interrupt:18 Base address:0x2000 
lo       Link encap:Local Loopback  
         inet addr:127.0.0.1  Mask:255.0.0.0
         inet6 addr: ::1/128Scope:Host
         UP LOOPBACK RUNNING  MTU:16436  Metric:1
         RX packets:80 errors:0 dropped:0 overruns:0 frame:0
         TX packets:80 errors:0 dropped:0 overruns:0 carrier:0
         collisions:0 txqueuelen:
         RX bytes:4000 (4.0 KB)  TX bytes:4000 (4.0 KB)
更改如下文件,看好你的mac地址
root@ubuntu# vim/etc/udev/rules.d/70-persistent-net.rules 

# This file was automatically generated bythe /lib/udev/write_net_rules

# program run by thepersistent-net-generator.rules rules file.

#

# You can modify it, as long as you keep eachrule on a single line.

# PCI device 0x1022:0x2000 (pcnet32)

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:0e:ad:8a", ATTR{type}=="1", KERNEL=="eth*", NAME="eth5"
# PCI device 0x1022:0x2000 (pcnet32)

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:26:0b:66", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
# PCI device 0x1022:0x2000 (pcnet32)

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:d5:16:28", ATTR{type}=="1", KERNEL=="eth*", NAME="eth2"
# PCI device 0x1022:0x2000 (pcnet32)

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:fe:47:db", ATTR{type}=="1", KERNEL=="eth*", NAME="eth3"
# PCI device 0x1022:0x2000 (pcnet32)

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:3e:b1:4f", ATTR{type}=="1", KERNEL=="eth*", NAME="eth4"
下面这里mac地址我对应的,是eth5,我改为eth0了
# PCI device 0x1022:0x2000 (pcnet32)

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:c6:bc:7c", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

 


root@ubuntu# init 6
重启后从新登录
root@ubuntu# ifconfig -a

eth0     Link encap:Ethernet  HWaddr00:0c:29:c6:bc:7c  
         inet addr:192.168.16.25  Bcast:192.168.16.255  Mask:255.255.255.0
         inet6 addr: fe80::20c:29ff:fec6:bc7c/64 Scope:Link
         UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
         RX packets:34 errors:0 dropped:0 overruns:0 frame:0
         TX packets:82 errors:0 dropped:0 overruns:0 carrier:0
         collisions:0 txqueuelen:1000 
         RX bytes:8409 (8.4 KB)  TX bytes:11509 (11.5 KB)
         Interrupt:18 Base address:0x2000 
lo       Link encap:Local Loopback  
         inet addr:127.0.0.1  Mask:255.0.0.0
         inet6 addr: ::1/128Scope:Host
         UP LOOPBACK RUNNING  MTU:16436  Metric:1
         RX packets:108 errors:0 dropped:0 overruns:0 frame:0
         TX packets:108 errors:0 dropped:0 overruns:0 carrier:0
         collisions:0 txqueuelen:
         RX bytes:6124 (6.1 KB)  TX bytes:6124 (6.1 KB)

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值