ubuntu 網絡設置mark

ubuntu上不了外網,可是內網ip都能ping通,網關能ping通,dns能ping通。 shell

排查了下,應該是dns沒有配置上去。 ubuntu

sudo gedit /etc/resolv.conf 下居然真的麼有配置nameserver.好吧,老老實實加上
nameserver 192.168.xxx.xxx oop

順便記錄下配置ip: code

sudo gedit /etc/network/interfaces server

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 192.168.21.188
gateway 192.168.21.1
netmask 255.255.255.0

這個能夠全局保持靜態的ip,不用開機每次去設置ip了 dns

相關文章
相關標籤/搜索