ubuntu上不了外网,但是内网ip都能ping通,网关能ping通,dns能ping通。
排查了下,应该是dns没有配置上去。
sudo gedit /etc/resolv.conf 下竟然真的么有配置nameserver.好吧,老老实实加上
nameserver 192.168.xxx.xxx
顺便记录下配置ip:
sudo gedit /etc/network/interfaces
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了