修改RHEL6.3的網路卡名稱
From:
正常來說,linux在識別網路卡時第一張會是eth0,第二張才是eth1。在這裡成這樣是因為複製系統的過程中複製的檔案已經有一個網路卡在/etc/udev/rules.d/70-persistent-net.rules被識別成了eth0,而虛擬機器中的識別成了eth1。
解決方法是:
編輯/etc/udev/rules.d/70-persistent-net.rules
找到與ifconfig -a得出的MAC相同的一行(NAME='eth1'這一行),把它改為"NAME=eth0 ",然後把上面一行(NAME='eth0')刪除掉。
編輯/etc/sysconfig/network-script/ifcfg-eth0
把MAC改為正確的,把UUID刪掉。
編輯/etc/sysconf/network,把hostname也改一下。
重啟生效!
say you have two nics installed on the system, eth0, and eth1.
At some times latter, you removed eth0 from the system.
Now eth1 is the only nic in your machine... and you want to rename this nic(eth1) as eth0.
following are the steps:
# rcnetwork stop
# vi /etc/udev/rules.d/30-net_persistent_names.rules
here you find a line as
SUBSYSTEM=="net", ACTION=="add", SYSFS{address}=="00:02:b3:22:84:f3", IMPORT="/lib/udev/rename_netiface %k eth1"
simply change eth1, as eth0,
SUBSYSTEM=="net", ACTION=="add", SYSFS{address}=="00:02:b3:22:84:f3", IMPORT="/lib/udev/rename_netiface %k eth0"
save and exit
Now execute the following command
# /lib/udev/rename_netiface
i.e
# /lib/udev/rename_netiface eth1 eth0
# rcnetwork start
DONE
even we can give any valid name to our nic, say e.g we want to name our eth0 as lan0, then
# rcnetwork stop
# vi /etc/udev/rules.d/30-net_persistent_names.rules
here you find a line as
SUBSYSTEM=="net", ACTION=="add", SYSFS{address}=="00:02:b3:22:84:f3", IMPORT="/lib/udev/rename_netiface %k eth0"
simply change eth1, as lan0,
SUBSYSTEM=="net", ACTION=="add", SYSFS{address}=="00:02:b3:22:84:f3", IMPORT="/lib/udev/rename_netiface %k lan0"
Now execute the following command
# /lib/udev/rename_netiface eth0 lan0
NOTE:
say we gave our nic a name as lanX, nicX, or intX(i.e non ethX name), and then want to change the name from lan0 to eth0, all the above steps are required, and reboot too.
正常來說,linux在識別網路卡時第一張會是eth0,第二張才是eth1。在這裡成這樣是因為複製系統的過程中複製的檔案已經有一個網路卡在/etc/udev/rules.d/70-persistent-net.rules被識別成了eth0,而虛擬機器中的識別成了eth1。
解決方法是:
編輯/etc/udev/rules.d/70-persistent-net.rules
找到與ifconfig -a得出的MAC相同的一行(NAME='eth1'這一行),把它改為"NAME=eth0 ",然後把上面一行(NAME='eth0')刪除掉。
編輯/etc/sysconfig/network-script/ifcfg-eth0
把MAC改為正確的,把UUID刪掉。
編輯/etc/sysconf/network,把hostname也改一下。
重啟生效!
say you have two nics installed on the system, eth0, and eth1.
At some times latter, you removed eth0 from the system.
Now eth1 is the only nic in your machine... and you want to rename this nic(eth1) as eth0.
following are the steps:
# rcnetwork stop
# vi /etc/udev/rules.d/30-net_persistent_names.rules
here you find a line as
SUBSYSTEM=="net", ACTION=="add", SYSFS{address}=="00:02:b3:22:84:f3", IMPORT="/lib/udev/rename_netiface %k eth1"
simply change eth1, as eth0,
SUBSYSTEM=="net", ACTION=="add", SYSFS{address}=="00:02:b3:22:84:f3", IMPORT="/lib/udev/rename_netiface %k eth0"
save and exit
Now execute the following command
# /lib/udev/rename_netiface
i.e
# /lib/udev/rename_netiface eth1 eth0
# rcnetwork start
DONE
even we can give any valid name to our nic, say e.g we want to name our eth0 as lan0, then
# rcnetwork stop
# vi /etc/udev/rules.d/30-net_persistent_names.rules
here you find a line as
SUBSYSTEM=="net", ACTION=="add", SYSFS{address}=="00:02:b3:22:84:f3", IMPORT="/lib/udev/rename_netiface %k eth0"
simply change eth1, as lan0,
SUBSYSTEM=="net", ACTION=="add", SYSFS{address}=="00:02:b3:22:84:f3", IMPORT="/lib/udev/rename_netiface %k lan0"
Now execute the following command
# /lib/udev/rename_netiface eth0 lan0
NOTE:
say we gave our nic a name as lanX, nicX, or intX(i.e non ethX name), and then want to change the name from lan0 to eth0, all the above steps are required, and reboot too.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/27042095/viewspace-1098613/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- CentOS 8 修改網路卡名稱CentOS
- 【DB寶51】CentOS7修改網路卡名稱CentOS
- Linux下修改網路卡名稱(centos6.5)LinuxCentOS
- RockyLinux9,RHEL9修改統一的網路卡名稱Linux
- Fedora網路介面名稱如何修改?Fedora修改網路介面名稱的方法
- CentOS 6.X怎麼更改網路卡名稱?CentOS 6.X更改網路卡名稱的方法CentOS
- 網路卡配置及對應名稱
- 更改Linux系統的網路卡名稱Linux
- 網站上修改公司名稱的方法網站
- centos6 修改網路卡名指令碼CentOS指令碼
- RAC更換網路卡名稱注意事項
- 更改 RHEL7 或者 CentOS 7 的網路卡名稱CentOS
- oracle 11g rac更改public的網路卡名稱Oracle
- Linux 修改網路卡裝置名(interface name)Linux
- centos7的網路卡名修改為eth0CentOS
- 網站上怎麼修改公司名稱?網站
- 麒麟系統修改網路卡名步驟和網路卡佔用故障處理
- Git修改檔名稱Git
- git修改檔案的名稱Git
- 修改網路卡名,報錯:Device not managed by NetworkManager or unavailabledevAI
- 網路卡MAC修改Mac
- 網站後臺的使用者名稱修改?dw怎樣修改網站模板?網站
- 修改Xcode工程名稱XCode
- 修改wifi名稱與地址WiFi
- 修改資料庫名稱資料庫
- sqlserver修改例項名稱SQLServer
- ubuntu修改主機名稱Ubuntu
- 修改zabbix的web平臺名稱Web
- 公司網站使用者名稱密碼修改?網站密碼
- Linux修改網路卡的名字Linux
- Eclipse 修改專案名稱Eclipse
- ***批次修改資料夾名稱
- 《squid網路卡代理的實現》RHEL6.3——條理清晰,步驟明確UI
- 網路卡名稱與系統配置檔案不一致
- Win7修改和刪除網路連線名稱的方法Win7
- 修改myeclipse釋出的專案名稱Eclipse
- PowerShell快速修改多個檔案的名稱
- nid修改資料庫名稱資料庫