centos 8 如何重启网络 service network restart - systemctl restart network 失效的解决办法


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

nmcli networking off && nmcli networking on 
ifdown eth0 && ifup eth0 
nmcli con down eth0 && nmcli con up eth0 

注意一定要使用&&一起执行,否则关闭网络后,会无法远程连接到服务器

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/


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM