centos修改网卡配置

修改网卡配置

设置临时 ip

1
2
ip a a 192.168.1.66/24 dev ens33
ip r a default via 192.168.1.1

/etc/NetworkManager/system-connections/ens33.nmconnection 默认配置

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
[connection]
id=ens160
uuid=7d70b1ab-4706-39a8-ae25-4e6a102e709d
type=ethernet
autoconnect-priority=-999
interface-name=ens160
timestamp=1687798131

[ethernet]

[ipv4]
method=auto

[ipv6]
addr-gen-mode=eui64
method=auto

[proxy]

修改,手动配置 ip

1
2
3
4
5
[ipv4]
#method=auto
method=manual
address1=192.168.1.66/24,192.168.1.1
dns=192.168.1.1;114.114.114.114;8.8.8.8

重载网卡

1
2
nmcli c reload
nmcli c up ens33