centos 網路設定

來源:互聯網
上載者:User

標籤:

centos 網路設定網路設定

-bash-4.1# setup    #如果沒有setup命令,可以yum install setuptool -y  也可以安裝setup 命令

                   http://jingyan.baidu.com/album/25648fc1a303ce9191fd0032.html?picindex=2 

-bash-4.1# yum install setuptool

 

然後輸入自己ip地址,子網路遮罩,網關等,如果您用圖形介面設定了還是沒能生效靜態ip,請變更檔BOOTPROTO=static


ifconfig -a
ifup etho 啟用網0網卡
ifdown eth0 禁用1網卡


[[email protected] ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0   #這個檔案是自動擷取IP ,只需要ONBOOT=yes 是yes即可
DEVICE=eth0
HWADDR=00:0C:29:79:38:BB
TYPE=Ethernet
UUID=31b2e3cb-096e-41a8-a6aa-da6db0935222
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=dhcp

[[email protected] ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
HWADDR=00:0c:29:79:38:bb
TYPE=Ethernet
UUID=31b2e3cb-096e-41a8-a6aa-da6db0935222
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=none        #也可以BOOTPROTO=static
IPADDR=192.168.1.7
NETMASK=255.255.255.0
DNS2=114.114.114.114
GATEWAY=192.168.1.1
DNS1=202.96.134.133
IPV6INIT=no
USERCTL=no

[[email protected] ~]# cat /etc/resolv.conf      #dns配設定檔

centos 網路設定

相關文章

聯繫我們

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