linux 修改ip地址 和關閉防火牆設定

來源:互聯網
上載者:User

標籤:style   ar   os   sp   檔案   div   on   art   bs   

修改ip 地址  和 關閉啟動防火牆1、ifconfig 查看  ip2、如果沒有網卡   查看 ifcfg-eth0 檔案是否存在   cd /etc/sysconfig/network-scripts/   ls -s  查看    如果有 查看      DEVICE=eth0     HWADDR=00:0C:29:0f:b8:70    這兩個選項與   vi /etc/udev/rules.d/70-persistent-net.rules   中 的eth0 是否一樣   如果還不行就用 eth1 網卡   vi /etc/udev/rules.d/70-persistent-net.rules  查看 eth0  和 eth1中的mac地址   eth1網卡的mac地址00:0c:29:50:bd:17   然後修改   vi /etc/sysconfig/network-scripts/ifcfg-eth0  修改  DEVICE=eth1   HWADDR=00:0C:29:0f:b8:70  重啟網卡   service  network restart3如果網卡已經存在      1 臨時修改           ifconfig  eth0 172.16.10.82     2永久修改     例子:由原來的DHCP改固定IP
DEVICE=eth0HWADDR=00:0C:29:F7:EF:BFONBOOT=yesTYPE=EthernetNETMASK=255.255.255.0IPADDR=192.168.0.68GATEWAY=192.168.0.1 重啟/etc/init.d/network restart ########################防火牆設定

1、重啟後永久性生效

開啟:chkconfig iptables on 

關閉:chkconfig iptables off 

2、即時生效,重啟後失效:

開啟:service iptables start 

關閉:service iptables stop

/etc/init.d/iptables status   會得到一系列資訊,說明防火牆開著。

/etc/rc.d/init.d/iptables stop 關閉防火牆

/etc/init.d/iptables stop

linux 修改ip地址 和關閉防火牆設定

聯繫我們

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