网络上有三种方法,比较了下,这种方法改动最小:能够实现固定IP 且DNS能够生效(否则无法打开网页) 首先看下当前网络情况:有network-manager cd /etc/network ls cat interfaces cd interfaces.d ls
cat /etc/init.d/networking cat /etc/init.d/network-manager
查看到以上文件,所以和ubuntu网络配置方法基本一致咯。
配置方法::~~~~~~~~~~~~~~~
cd /etc/network
sudo vim interfaces
我的interfaces 配置如下(主要是增加了一行dns-nameservers)
# interfaces(5) file used by ifup(8) and ifdown(8)
# Include files from /etc/network/interfaces.d:
#source-directory /etc/network/interfaces.d
#auto lo
#iface lo inet loopback
# this is static
auto eth0
iface eth0 inet static
pre-up ifconfig eth0 hw eher 7a:35:e7:f7:fc:f5
address 192.168.1.102
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameservers 114.114.114.114
#broadcast 192.168.16.255
#network 10.1.1.0
#dns-nameservers 114.114.114.114
#this
|