ubuntu指令模式修改IP等信息
生活随笔
收集整理的這篇文章主要介紹了
ubuntu指令模式修改IP等信息
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
http://blog.igevin.info/posts/ubuntu-1404-ip-dns/
先安裝vim,然后按a啟動編輯,兩次按大寫的Z結束編輯并保存。
修改/etc/network/interfaces設置靜態IP
sudo vi /etc/network/interfaces用下面的代碼替換有關eth0的內容:
# The primary network interface auto eth0 #表示讓網卡開機自動掛載eth0 iface eth0 inet static address 192.168.2.1 gateway 192.168.2.254 netmask 255.255.255.0 #network 192.168.2.0 #broadcast 192.168.2.255重啟網絡使上面的配置生效:
sudo /etc/init.d/networking restart如果上面命令無法令ubuntu重啟網絡,則使用下面命令:
sudo ifdown eth0 && sudo ifup eth0為Ubuntu14.04設置固定DNS
通過/etc/network/interfaces,在它的最后增加一句:
dns-nameservers 8.8.8.8# 如果多個dns: # dns-nameservers X.X.X.X Y.Y.Y.Y Z.Z.Z.Z 創作挑戰賽新人創作獎勵來咯,堅持創作打卡瓜分現金大獎總結
以上是生活随笔為你收集整理的ubuntu指令模式修改IP等信息的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 蓝湖支持「切图压缩」了!
- 下一篇: Ubuntu failed to fet