ubuntu 22.04配置静态ip
vim /etc/netplan/01-network-manager-all.yaml
# Let NetworkManager manage all devices on this system
network:
renderer: NetworkManager
ethernets:
enp4s0f1:
addresses:
- 192.168.1.18/24
dhcp4: false
routes:
- to: default
via: 192.168.1.1
nameservers:
addresses:
- 192.168.1.1
- 8.8.8.8
search:
- workgroup
version: 2
启动
netplan apply