CentOS Stream9更改ip地址,网关(设置静态ip)

使用grep命令查询ens160文件所在的文件夹处
grep -rnw '/etc' -e 'ens160'
然后用vi命令打开文件进行修改
vi /etc/NetworkManager/system-connections/ens160.nmconnection
配置:

假设将ip地址改为192.168.200.130

[connection]
id=ens33
uuid=0050f214-01a7-395e-ab19-b6e95412995a
type=ethernet
autoconnect-priority=-999
interface-name=ens33

[ipv4]
address1=192.168.200.130,192.168.200.2  #ip地址,网关
dns=192.168.200.2        #域名解析器
method=manual