ubuntu18.04设置静态IP
添加网卡配置
sudo vim /etc/netplan/01-network-manager-all.yaml
network:
ethernets:
ens33:
dhcp4: no
addresses: [192.168.8.166/24]
gateway4: 192.168.8.1
nameservers:
addresses:
- 192.168.8.1
- 8.8.8.8
- 114.114.114.114
version: 2
renderer: networkd
sudo netplan apply
双网卡配置
# This is the network config written by 'subiquity'
network:
ethernets:
ens33:
dhcp4: true
ens34:
addresses:
- 192.168.241.129/24
gateway4: 192.168.1.1
nameservers:
addresses:
- 144.144.144.144
search:
- local
version: 2
本文来自博客园,作者:GreeneGe,转载请注明原文链接:https://www.cnblogs.com/greene/p/15579433.html