系統(tǒng)之家 - 系統(tǒng)光盤下載網(wǎng)站!

當(dāng)前位置:系統(tǒng)之家 > 系統(tǒng)教程 > Linux中ifconfig命令用法

Linux中ifconfig命令用法匯總(2)

時間:2014-12-29 15:15:02 作者:qipeng 來源:系統(tǒng)之家 1. 掃描二維碼隨時看資訊 2. 請使用手機瀏覽器訪問: https://m.xitongzhijia.net/xtjc/20141229/33629.html 手機查看 評論

  實例2:啟動關(guān)閉指定網(wǎng)卡

  命令:

  代碼如下:

  ifconfig eth0 up

  ifconfig eth0 down

  說明:

  ifconfig eth0 up 為啟動網(wǎng)卡eth0 ;ifconfig eth0 down 為關(guān)閉網(wǎng)卡eth0。ssh登陸linux服務(wù)器操作要小心,關(guān)閉了就不能開啟了,除非你有多網(wǎng)卡。

  實例3:為網(wǎng)卡配置和刪除IPv6地址

  命令:

  代碼如下:

  ifconfig eth0 add 33ffe:3240:800:1005::2/64

  ifconfig eth0 del 33ffe:3240:800:1005::2/64

  說明:

  ifconfig eth0 add 33ffe:3240:800:1005::2/64 為網(wǎng)卡eth0配置IPv6地址;

  ifconfig eth0 add 33ffe:3240:800:1005::2/64 為網(wǎng)卡eth0刪除IPv6地址;

  練習(xí)的時候,ssh登陸linux服務(wù)器操作要小心,關(guān)閉了就不能開啟了,除非你有多網(wǎng)卡。

  實例4:用ifconfig修改MAC地址

  命令:ifconfig eth0 hw ether 00:AA:BB:CC:DD:EE

  輸出:

  代碼如下:

  [root@localhost ~]# ifconfig eth0 down //關(guān)閉網(wǎng)卡

 。踨oot@localhost ~]# ifconfig eth0 hw ether 00:AA:BB:CC:DD:EE //修改MAC地址

 。踨oot@localhost ~]# ifconfig eth0 up //啟動網(wǎng)卡

 。踨oot@localhost ~]# ifconfig

  eth0 Link encap:Ethernet HWaddr 00:AA:BB:CC:DD:EE

  inet addr:192.168.120.204 Bcast:192.168.120.255 Mask:255.255.255.0

  UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

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

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

  collisions:0 txqueuelen:1000

  RX bytes:596390239 (568.7 MiB) TX bytes:2886956 (2.7 MiB)《/p》 《p》lo Link encap:Local Loopback

  inet addr:127.0.0.1 Mask:255.0.0.0

  UP LOOPBACK RUNNING MTU:16436 Metric:1

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

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

  collisions:0 txqueuelen:0

  RX bytes:2856 (2.7 KiB) TX bytes:2856 (2.7 KiB)

 。踨oot@localhost ~]# ifconfig eth0 hw ether 00:50:56:BF:26:20 //關(guān)閉網(wǎng)卡并修改MAC地址

  [root@localhost ~]# ifconfig eth0 up //啟動網(wǎng)卡

 。踨oot@localhost ~]# ifconfig

  eth0 Link encap:Ethernet HWaddr 00:50:56:BF:26:20

  inet addr:192.168.120.204 Bcast:192.168.120.255 Mask:255.255.255.0

  UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

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

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

  collisions:0 txqueuelen:1000

  RX bytes:596390239 (568.7 MiB) TX bytes:2886956 (2.7 MiB)《/p》 《p》lo Link encap:Local Loopback

  inet addr:127.0.0.1 Mask:255.0.0.0

  UP LOOPBACK RUNNING MTU:16436 Metric:1

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

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

  collisions:0 txqueuelen:0

  RX bytes:2856 (2.7 KiB) TX bytes:2856 (2.7 KiB)

發(fā)表評論

0

沒有更多評論了

評論就這些咯,讓大家也知道你的獨特見解

立即評論

以上留言僅代表用戶個人觀點,不代表系統(tǒng)之家立場

其他版本軟件

熱門教程

人氣教程排行

Linux系統(tǒng)推薦

掃碼關(guān)注
掃碼關(guān)注

掃碼關(guān)注 官方交流群 軟件收錄