網路上有三種方法,比較了下,這種方法改動最小:能夠實作固定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
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/338211.html
標籤:java
