ITPub博客

首页 > 数据库 > Oracle > Linux 修改网卡设备名(interface name)

Linux 修改网卡设备名(interface name)

原创 Oracle 作者:winston_DBA 时间:2015-05-28 19:16:44 0 删除 编辑

    今天在本地虚拟机环境下安装GI时,报了下图的错误,分析原因为网卡的interface name不一致,node1为eth0、ech1和eth2但是node2为eth1、eth2和eth3,这样在建立完SSH互信后,点击下一步时,报错,并且该错误不能忽略。



    通过网上的解决方法为修改/etc/udev/rules.d/70-persistent-net.rules中ATTR{address}值与/etc/sysconfig/network-scripts/ifcfg-Auto_eth1中的MAC值保持一致,然后重启服务器即可。
 
    第一步:查看当前网卡的MAC地址值,注意,我的node2是通过vmware的克隆功能来复制的,文件中的值有可能与实际虚拟机的网卡MAC地址值不同。
[root@oel6 network-scripts]# cat ifcfg-Auto_eth1                                      
TYPE=Ethernet                                                                         
BOOTPROTO=none                                                                        
IPADDR=192.168.0.12                                                                   
GATEWAY=192.168.0.1                                                                   
NETMASK=255.255.255.0                                                                 
DEFROUTE=no                                                                           
IPV4_FAILURE_FATAL=yes                                                                
IPV6INIT=no                                                                           
NAME="Auto eth0"                                                                      
UUID=7624a820-03b1-4a8e-abd1-559879087e5d                                             
ONBOOT=yes                                                                            
HWADDR=00:0c:29:4f:36:73                                                              
LAST_CONNECT=1432796101    
    第二步:修改配置文件 ATTR{address}为对应网卡MAC地址值,并且修改NAME值为想要的值。
[root@oel6 network-scripts]# 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:4f:36:73", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
# PCI device 0x8086:0x100f (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:4f:36:7d", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
# PCI device 0x8086:0x100f (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:4f:36:87", ATTR{type}=="1", KERNEL=="eth*", NAME="eth2"
 
    第三步:重启机器,使修改生效。

    PS:在修改eth0等名字时,需要注意节点间网段的对应。例如,node1上eth0配置成192.10.12.14   则node2上也需要配置成192.10.12.0网段,否则还是报该案例中错误。

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/30167136/viewspace-1675820/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2015-03-17

  • 博文量
    76
  • 访问量
    414950