博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Linux Network Device Name issue
阅读量:6293 次
发布时间:2019-06-22

本文共 2854 字,大约阅读时间需要 9 分钟。

hot3.png

[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

你可能感兴趣的文章
继承自ActionBarActivity的activity的activity theme问题
查看>>
设计模式01:简单工厂模式
查看>>
项目经理笔记一
查看>>
Hibernate一对一外键双向关联
查看>>
mac pro 入手,php环境配置总结
查看>>
MyBatis-Plus | 最简单的查询操作教程(Lambda)
查看>>
rpmfusion 的国内大学 NEU 源配置
查看>>
spring jpa 配置详解
查看>>
IOE,为什么去IOE?
查看>>
Storm中的Worker
查看>>
dangdang.ddframe.job中页面修改表达式后进行检查
查看>>
Web基础架构:负载均衡和LVS
查看>>
Linux下c/c++相对路径动态库的生成与使用
查看>>
SHELL实现跳板机,只允许用户执行少量允许的命令
查看>>
SpringBoot 整合Redis
查看>>
2014上半年大片早知道
查看>>
Android 6.0指纹识别App开发案例
查看>>
正文提取算法
查看>>
轻松学PHP
查看>>
Linux中的网络监控命令
查看>>