Linux Network Device Name issue

[root@olinfa961 opt]# ifconfig

eth2      Link encap:Ethernet  HWaddr 00:0C:29:80:46:66  

          inet addr:192.168.0.109  Bcast:192.168.0.255  Mask:255.255.255.0

          inet6 addr: fe80::20c:29ff:fe80:4666/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:412 errors:0 dropped:0 overruns:0 frame:0

          TX packets:21 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:53002 (51.7 KiB)  TX bytes:4314 (4.2 KiB)


eth3      Link encap:Ethernet  HWaddr 00:0C:29:80:46:70  

          inet addr:192.168.146.110  Bcast:192.168.146.255  Mask:255.255.255.0

          inet6 addr: fe80::20c:29ff:fe80:4670/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:548 errors:0 dropped:0 overruns:0 frame:0

          TX packets:269 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:51810 (50.5 KiB)  TX bytes:32119 (31.3 KiB)

          Interrupt:16 Base address:0x2000 


lo        Link encap:Local Loopback  

          inet addr:127.0.0.1  Mask:255.0.0.0

          inet6 addr: ::1/128 Scope:Host

          UP LOOPBACK RUNNING  MTU:16436  Metric:1

          RX packets:4 errors:0 dropped:0 overruns:0 frame:0

          TX packets:4 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0 

          RX bytes:240 (240.0 b)  TX bytes:240 (240.0 b)


actually there's no such device in your machine. so you should revise it.

  1. Write down the MAC Address

    Device Name     Mac Address        the right Device Name

    eth2 ===> 00:0C:29:80:46:66 ==> eth0

    eth3 ===> 00:0C:29:80:46:70 ==> eth1 

  2. Modify the file /etc/udev/rules.d/70-persistent-net.rules , keep the top 2 non-commented lines . 

[root@olinfa961 opt]# cat /etc/udev/rules.d/70-persistent-net.rules 

# This file was automatically generated by the /lib/udev/write_net_rules

# program, run by the persistent-net-generator.rules rules file.

#

# You can modify it, as long as you keep each rule on a single

# line, and change only the value of the NAME= key.


# PCI device 0x8086:0x100f (e1000)

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


# PCI device 0x1022:0x2000 (pcnet32)

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:80:46:70", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

    3.  Modify the ifcfg-eth0 and ifcfg-eth1 files:

[root@olinfa961 opt]# cd /etc/sysconfig/network-scripts/

[root@olinfa961 network-scripts]# ls

ifcfg-eth0   ifdown-eth   ifdown-ppp     ifup-aliases  ifup-isdn   ifup-routes       net.hotplug

ifcfg-eth1   ifdown-ippp  ifdown-routes  ifup-bnep     ifup-plip   ifup-sit          network-functions

ifcfg-lo     ifdown-ipv6  ifdown-sit     ifup-eth      ifup-plusb  ifup-tunnel       network-functions-ipv6

ifdown       ifdown-isdn  ifdown-tunnel  ifup-ippp     ifup-post   ifup-wireless

ifdown-bnep  ifdown-post  ifup           ifup-ipv6     ifup-ppp    init.ipv6-global

[root@olinfa961 network-scripts]# cat ifcfg-eth0

DEVICE="eth0"

HWADDR="00:0C:29:80:46:66"

NM_CONTROLLED="yes"

ONBOOT="yes"

4. reboot


转载于:https://my.oschina.net/swuly302/blog/535053

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值