1、Contos修改静态IP
vi /etc/sysconfig/network-scripts/ifcfg-ens33, 标记红色处可能序号会变动
参考linux配置网络不通解决方案_kylinv10sp2 网关不通-CSDN博客https://tanrt06.blog.csdn.net/article/details/132430485?spm=1001.2014.3001.5502
Kail时候NAT连接如何修改静态IP
百度后/etc/network/interfaces修改静态ip,修改后不生效
最终解决办法
nmcli
NetworkManager 的命来配置网络接口生效
查看 相当于cat
nmcli device show
IP静态地址更新
sudo nmcli con mod "Wired connection 1" ipv4.addresses "192.168.203.11/24"
网关设置
sudo nmcli con mod "Wired connection 1" ipv4.gateway "192.168.203.1"
DNS设置
sudo nmcli con mod "Wired connection 1" ipv4.dns "8.8.8.8 8.8.4.4"
设置 IP 配置方法为手动
sudo nmcli con mod "Wired connection 1" ipv4.method manual
关闭
sudo nmcli con down "Wired connection 1"
重新激活
sudo nmcli con up "Wired connection 1"