centos伺服器配置一網卡配置(linux、網卡自動啟動)

來源:互聯網
上載者:User

centos伺服器配置一網卡配置(linux、網卡自動啟動) 網卡設定檔的存放目錄:/etc/sysconfig/network-scripts/ 具體設定檔:ifcfg-xxx; 如eth0是ifcfg-eth0、lo是ifcfg-lo # Intel Corporation 82545EM Gigabit Ethernet Controller(Copper) TYPE=Ethernet     #網卡類型 DEVICE=eth0       #網卡介面名稱 ONBOOT=yes        #系統啟動時是否自動載入,yes開機自動載入,no開機不載入 BOOTPROTO=static   #啟用地址協議 --static:靜態協議 --bootp協議 --dhcp協議 IPADDR=172.16.13.3      #網卡IP地址,一下要寫入自己對應的資訊 NETMASK=255.255.0.0     #網卡網路地址 GATEWAY=172.16.254.254  #網卡網關地址 DNS1=172.16.254.254     #網卡DNS地址 HWADDR=00:0C:29:13:5D:74 #網卡裝置MAC地址 BROADCAST=192.168.1.255 #網卡廣播位址 相關的命令: /etc/init.d/network reload 網卡介面關閉與啟用 ifdown eth0   #關閉網路 ifup eth0     #啟動網路 網路服務啟動與關閉 方法一: service network start|stop|status|restart|reload|force-reload    方法二: /etc/init.d/network start|stop|status|restart|reload|force-reload start:啟動網卡服務,啟用所有自啟動的網卡 stop:禁用所有的網卡,現在已經啟用的網卡 status: 查看所有的網卡資訊,顯示資訊有啟用的網卡和所有的網卡。例如: [root@reage etc]# service network status Configured devices: lo eth0 eth1 Currently active devices: lo eth0 restart: 重啟網卡服務,過程先關閉網卡服務,然後,在啟動網卡資訊 reload: 重新載入網卡設定檔,網卡的設定檔在修改儲存後,並不會生效,需要使用本方式載入到記憶體中, start、stop、status只是會載入記憶體配置的資訊 force-reloal: 功能未知 臨時配置網卡資訊,無需重啟。 [root@reage ~]# ifconfig eth0 172.16.13.3 netmask 255.255.0.0 額外的話題: 對於虛擬機器網卡的MAC的查看  來源:http://blog.csdn.net/rentiansheng/article/details/8877367 

聯繫我們

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