文章摘要
GPT 4

进入系统以后:

编辑网络配置文件(nano或者vim

1
2
3
4
5
6
7
8
couture@couture:~$ sudo vim /etc/netplan/00-installer-config.yaml 

# This is the network config written by 'subiquity'
network:
ethernets:
ens33:
dhcp4: true
version: 2

dhcp4: true 修改为 dhcp4: false,然后在ethernets下添加您的静态IP配置

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
~
network:
version: 2
ethernets:
ens160:
dhcp4: false
dhcp6: false
addresses:
- x.x.x.x/x
- x:x:x:x::x:x65/x
gateway4: x.x.x.x # IPv4的网关
gateway6: x:x:x:x::x:x # IPv6的网关
nameservers:
addresses:
- x.x.x.x # IPV4 DNS服务器
- x:x:x:x::x:x # IPV6 DNS服务器

关闭并且保存文件,然后重启网络

1
2
3
sudo netplan apply

sudo systemctl restart network-manager