ubuntu 14.04網卡配置以及關閉防火牆


一、Ubuntu網卡配置如下:

在文件/etc/network/interfaces中進行以下配置

auto lo

iface lo inet lookback

auto eth0

iface eth0 inet static

address 192.168.1.150

netmask 255.255.255.0

gateway 192.168.1.1

network 192.168.0.0

broadcast 192.168.1.255

在/etc/resolv.conf 添加dns

nameserver 114.114.114.114

 

完成以上配置后,需要重啟網卡,重啟方式(如果其中一種方式不可以,請嘗試另外一種)

1、sudo /etc/init.d/networking restart

2、sudo ifconfig eth0 down

     sudo ifconfig eth1 up

3、sudo ifdown eth0

     sudo ifup eth0

二、防火牆

1、Ubuntu14.0.4開啟

    ufw enable

2、Ubuntu14.0.4關閉

    ufw disable

3、卸載iptables

apt-get remove iptables

4、關閉Ubuntu14.0.4的iptables的相關命令

iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
iptables -F

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM