爱笔记爱笔记

CentOS 9 Stream设置固定IP

CentOS Stream设置固定IP

环境查看

# cat /etc/redhat-release 
CentOS Stream release 9
# uname -a
Linux localhost.localdomain 5.14.0-381.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Mon Oct 30 23:56:21 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

修改配置文件

# cat /etc/NetworkManager/system-connections/ens3.nmconnection 
[connection]
id=ens3
uuid=09bcb246-d013-36dd-975b-cac8484af6c4
type=ethernet
autoconnect-priority=-999
interface-name=ens3
timestamp=1699436140

[ethernet]

[ipv4]
#method=auto
#自动修改为手动
method=manual
#设置ip地址和网关
address1=192.168.3.203/24,192.168.3.1
#设置DNS
dns=192.168.3.1;114.114.114.114

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

[proxy]

设置生效

# 重置网络
#sudo nmcli c reload
# 启动网卡,名称ens3根据网卡实际名称修改
#sudo nmcli c up ens3

我的设置

[connection]
id=ens160
uuid=6e706b10-ed78-3156-af02-b7cf731358f7
type=ethernet
autoconnect-priority=-999
interface-name=ens160
timestamp=1726622840

[ethernet]

[ipv4]
#method=auto
method=manual
#设置ip地址和网关
address1=192.168.0.114/24,192.168.0.1
#设置DNS
dns=8.8.8.8;114.114.114.114

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

[proxy]

来自
https://www.cnblogs.com/minseo/p/17818980.html

本原创文章未经允许不得转载 | 当前页面:爱笔记 » CentOS 9 Stream设置固定IP