ubuntu靜態IP設置

注意網關的設置:
    在宿主機器打開命令窗口,輸入命令ipconfig,查看宿主機器的ip、子網頁碼、網關,
將虛擬機的子網掩碼、網關設置成和宿主機器一致,ip設置不衝突便可:

/etc/network/interfaces

auto lo
iface lo inet loopback
iface eth0 inet static
address 192.168.1.231
netmask 255.255.255.0
gateway 192.168.1.1
auto eth0
html

設置DNS服務:網絡

vi /etc/resolv.confoop

nameserver 223.5.5.5rest


重啓網絡服務:
sudo /etc/init.d/networking restartserver


在unbuntu14.4中,系統重啓後,resolv.conf中的配置會被重置,解決該問題,作以下配置:htm

vi /etc/resolvconf/resolv.conf.d/baseip

nameserver 223.5.5.5get

nameserver 8.8.8.8
虛擬機

unbuntu14.04的網絡配置參考以下:it

http://jingyan.baidu.com/article/e5c39bf5bbe0e739d7603396.html

相關文章
相關標籤/搜索