ubuntu14 04設定靜態ip

2021-07-09 06:15:59 字數 585 閱讀 5429

1. 找到檔案並作如下修改:

sudo vim /etc/network/inte***ces

修改如下部分:

auto eth0

iface eth0 inet static

address 192.168.0.117

gateway 192.168.0.1 #這個位址你要確認下 閘道器是不是這個位址

netmask 255.255.255.0

network 192.168.0.0

broadcast 192.168.0.255

2. 修改dns解析

因為以前是dhcp解析,所以會自動分配dns伺服器位址

而一旦設定為靜態ip後就沒有自動獲取到的dns伺服器了

要自己設定乙個

sudo vim /etc/resolv.conf

寫上乙個公網的dns

nameserver 202.96.128.86

(注意:8.8.8.8是谷歌的dns伺服器,但是解析速度慢,還是找到乙個國內的dns來用)

3. 重啟網絡卡:

sudo /etc/init.d/networking restart

Ubuntu1404設定靜態ip

設定固定ip前先檢視系統自動分配的ip所屬網段,通過命令ifconfig檢視。這裡假設看到的是192.168.134網段,那麼你可以設定固定ip為192.168.134.138或192.168.134.139等 auto lo iface lo inet loopback iface eth0 in...

ubuntu14 04設定靜態ip

ubuntu14.04設定靜態ip 1.找到檔案並作如下修改 sudo vim etc network inte ces 修改如下部分 auto eth0 iface eth0 inet static address 192.168.0.117 gateway 192.168.0.1 這個位址你要確...

Ubuntu14 04設定靜態IP

networkmanager配置檔案位置 etc networkmanager system connections 有線 802 3 ethernet duplex full mac address b8 27 eb 14 e0 bf connection id eth0 這個uuid並沒有任何含...