Linux之IP 网关 DNS(ubuntu 16.04)
1.设置IP 网关 DNS
sudo nano /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.10.150
network 192.168.10.0
netmask 255.255.255.0
broadcast 192.168.10.255
gateway 192.168.10.10
dns-nameservers 192.168.10.10
2.查看IP 网关 DNS
查看IP:ip addr
查看网关:route -n
查看DNS:nslookup www.baidu.com