Centos 7.x臨時的網路與路由配置

來源:互聯網
上載者:User

標籤:

今天在虛擬機器上安裝了Centos 7.1作業系統,使用的迷你安裝,安裝完成後準備使用ifconfig命令時,發現命令不存在,如下:

心想肯定是新版的Centos 系統預設情況下沒有使用ifconfig命令了,應該是用某個命令代替了ifconfig了。

上百度一查,果不其然,已經用ip命令代替ifconfig命令了。下面列出ip命令常用參數,常用到的ip配置如下。

ip addr                                           //顯示網卡IP資訊ip link set eno16777736 up/down                   //開啟或關閉eno1677736網卡ip addr add 192.168.100.2/24 dev eno16777736      //設定eno16777736網卡IP地址192.168.100.2ip addr del 192.168.100.2/24 dev eno16777736      //刪除eno16777736網卡IP地址192.168.100.2

常用到的臨時路由配置如下:

ip route list                                               //查看路由資訊,也可以使用ip route命令ip route add default via 192.168.100.1                      //設定預設閘道,也可以在後面加上dev eno16777736ip route del default via 192.168.100.1                      //刪除預設閘道,也可以直接寫ip route del defaultip route add 192.168.123.0/24 via 192.168.123.1 dev eth0    //設定192.168.123.0網段的網關為192.168.123.1,資料走eth0介面
ip route del 192.168.123.0/24 //刪除192.168.100.123.0/24網段的路由

 

尊重別人的勞動成果 轉載請務必註明出處:http://www.cnblogs.com/5201351/p/4661666.html 

Centos 7.x臨時的網路與路由配置

相關文章

聯繫我們

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