Linux啟動網卡

來源:互聯網
上載者:User

ifconfig命令可以用於查看Linux活動網卡與IP地址、子網路遮罩或者mac地址等資訊

  1. [root@localhost ~]# ifconfig  
  2. eth0      Link encap:Ethernet  HWaddr 08:00:27:D4:71:2D    
  3.           inet addr:192.168.1.104  Bcast:255.255.255.255  Mask:255.255.255.0  
  4.           inet6 addr: fe80::a00:27ff:fed4:712d/64 Scope:Link  
  5.           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1  
  6.           RX packets:1693 errors:0 dropped:0 overruns:0 frame:0  
  7.           TX packets:255 errors:0 dropped:0 overruns:0 carrier:0  
  8.           collisions:0 txqueuelen:1000   
  9.           RX bytes:118346 (115.5 KiB)  TX bytes:53987 (52.7 KiB)  
  10.           Interrupt:10 Base address:0xd020   
  11.   
  12. lo        Link encap:Local Loopback    
  13.           inet addr:127.0.0.1  Mask:255.0.0.0  
  14.           inet6 addr: ::1/128 Scope:Host  
  15.           UP LOOPBACK RUNNING  MTU:16436  Metric:1  
  16.           RX packets:7 errors:0 dropped:0 overruns:0 frame:0  
  17.           TX packets:7 errors:0 dropped:0 overruns:0 carrier:0  
  18.           collisions:0 txqueuelen:0   
  19.           RX bytes:672 (672.0 b)  TX bytes:672 (672.0 b) 

eth0 是Linux主機的一塊網卡,lo是本地迴環

ifconfig eth0 up              #可以用於啟動網卡
ifconfig eth0 down            #可以用于禁用網卡
ifconfig eth0 192.168.1.101   #可以給主機制定靜態地址

如果要使用DHCP分配,可以使用dhclient命令
在終端直接輸入dhclient即可:)

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.