首页 > 其他 > 详细

centos9 重启网络

时间:2021-02-28 00:08:27      阅读:35      评论:0      收藏:0      [点我收藏+]

systemctl restart network centos8失效了
重启网络可使用以下命令

#重启整个网络
nmcli n off && nmcli n on 
#重启指定网卡
nmcli c down eth0 && nmcli c up eth0 
ifdown eth0 && ifup eth0

注意一定要使用&&一起执行,否则关闭网络后,会无法远程连接到服务器
ifdown / ifup本质为调用nmcli的脚本

ps:
你可以通过图形化工具来设置网络

nmtui

参考:
https://www.centos.org/forums/viewtopic.php?p=302319
https://access.redhat.com/discussions/3791081
https://www.osetc.com/en/how-to-start-stop-restart-network-service-on-centos-8-or-rhel-8.html
https://www.tecmint.com/set-static-ip-address-in-rhel-8/
https://www.tecmint.com/configure-network-connections-using-nmcli-tool-in-linux/
https://www.certdepot.net/rhel7-configure-ipv4-addresses/

centos9 重启网络

原文:https://www.cnblogs.com/yipianchuyun/p/14456499.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!