Linux修改網卡名稱

來源:互聯網
上載者:User

實現步驟如下
1,更改/etc/modprobe.conf檔案中的模組alias
比如 alias eth0 pcnet32

修改為   alias lan pcnet32 

2,更改網卡的設定檔的名字為ifcfg-lan

mv /etc/sysconfig/network-scripts/ifcfg-eth0   /etc/sysconfig/network-scripts/ifcfg-lan 

3,更改設定檔,將DEVICE=eth0,更改為DEVICE=lan 

4,去除記憶體中的網卡模組

modprobe -r pcnet32 

5,重新載入網卡模組

modprobe   lan (等同於modprobe pcnet32) 

6,重啟網路服務/etc/init.d/network restart

service network restart [root@bogon ~]# ifconfig
lan    Link encap:Ethernet   HWaddr 00:0C:29:10:80:97  
      inet addr:192.168.1.9   Bcast:192.168.1.255   Mask:255.255.255.0
      inet6 addr: fe80::20c:29ff:fe10:8097/64 Scope:Link
      UP BROADCAST RUNNING MULTICAST   MTU:1500   Metric:1
      RX packets:33 errors:0 dropped:0 overruns:0 frame:0
      TX packets:26 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000 
      RX bytes:5271 (5.1 KiB)   TX bytes:2976 (2.9 KiB)
      Interrupt:177 Base address:0x1400

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.