1:设定IP
gedit /etc/network/interfaces
文件内容修改为:
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.1.101
gateway 192.168.1.1
netmask 255.255.255.0
network 192.168.1.1
broadcast 192.168.1.255
然后重启networking
/etc/init.d/networking restart
2:设置DNS
gedit /etc/resolv.conf
文件内容修改为:
# Generated by NetworkManager
domain localdomain
search localdomain
nameserver 192.168.1.1
不需要重启操作,这是修改后马上生效的
输入任意网址进行测试,如果连接成功即设置静态IP成功