Ubuntu20.04设置方法
配置文件位置:/etc/netplan/00-installer-config.yaml
DHCP配置:
network:
ethernets:
ens33:
dhcp4: true
version: 2
手动配置 :
network:
ethernets:
ens33:
addresses:
- xxx.xxx.xxx.xxx/24
gateway4: xxx.xxx.xxx.xxx
nameservers:
addresses:
- 223.5.5.5
search:
- 223.5.5.5
version: 2
Ubuntu14.04设置方法
NetworkManager配置文件位置/etc/NetworkManager/system-connections
有线:
[802-3-ethernet]
duplex=full
mac-address=B8:27:EB:14:E0:BF
[connection]
id=eth0
#这个uuid并没有任何含义, 可以用uuidgen产生的新值替换
uuid=512de3e4-5bb7-11e5-8cbe-b827eb14e0bf
type=802-3-ethernet
timestamp=1442327046
[ipv6]
#ipv6默认关闭
method=ignore
[ipv4]
#自动ip这里填auto, 静态如下
method=manual
dns=192.168.1.1;223.5.5.5;
address1=192.168.1.22/24,192.168.1.1
无线:
[connection]
id=tars-2.4G
uuid=fbc73a26-94f4-49aa-9c72-93e7e8db6655
type=802-11-wireless
timestamp=1442228433
[802-11-wireless]
ssid=tars-2.4G
mode=infrastructure
mac-address=E8:4E:06:29:06:52
#无线ap的mac地址
seen-bssids=04:A1:51:AE:0A:6F;
security=802-11-wireless-security
[802-11-wireless-security]
#无线安全部分
key-mgmt=wpa-psk
psk=tarsbot.702
[ipv4]
method=manual
dns=192.168.1.1;223.5.5.5;
address1=192.168.1.33/24,192.168.1.1
[ipv6]
method=ignore
重启网络服务:
sudo /etc/init.d/networking restart