Centos中常见error(网卡、网络、防火墙)
生活随笔
收集整理的這篇文章主要介紹了
Centos中常见error(网卡、网络、防火墙)
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
一:Centos使用前需了解的
1:網(wǎng)卡
centos6的網(wǎng)卡重啟方法:
service network restart
centos7的網(wǎng)卡重啟方法:
systemctl restart network
2:防火墻
開啟防火墻:systemctl start firewalld
關(guān)閉防火墻:systemctl stop firewalld
查看防火墻狀態(tài):systemctl status firewalld.service
開機(jī)自動啟動:systemctl enable firewalld
關(guān)閉防火墻并設(shè)置開機(jī)不啟動:systemctl disable firewalld
查看開機(jī)是否啟動:chkconfig --list|grep network(RHLE6)
3、關(guān)閉安全增強(qiáng)性(在生產(chǎn)環(huán)境中一定要關(guān)閉):
vim /etc/selinux/config或vim /etc/sysconfig/selinux
二:啟動網(wǎng)卡服務(wù)錯(cuò)誤
systemctl start network 啟動網(wǎng)卡服務(wù)報(bào)錯(cuò)
[root@localhost home]# systemctl restart network Job for network.service failed because the control process exited with error code. See "systemctl status network.service" and "journal ctl -xe" for details.- 提示錯(cuò)誤:
Job for network.service failed because the control process exited with error code. See “systemctl status network.service” and “journal
ctl -xe” for details
解決思路:查看錯(cuò)誤日志
[root@localhost home]# systemctl status network.service ● network.service - LSB: Bring up/down networkingLoaded: loaded (/etc/rc.d/init.d/network; bad; vendor preset: disabled)Active: failed (Result: exit-code) since Sun 2021-08-01 11:03:33 PDT; 13min agoDocs: man:systemd-sysv-generator(8)Process: 4841 ExecStart=/etc/rc.d/init.d/network start (code=exited, status=1/FAILURE)CGroup: /system.slice/network.service└─999 /sbin/dhclient -1 -q -lf /var/lib/dhclient/dhclient-bbefb2ab-4633-33f7-b5b5-dffb4e3eb945-ens33.lease -pf /var/run/...Aug 01 11:03:33 localhost.localdomain network[4841]: RTNETLINK answers: File exists Aug 01 11:03:33 localhost.localdomain network[4841]: RTNETLINK answers: File exists Aug 01 11:03:33 localhost.localdomain network[4841]: RTNETLINK answers: File exists Aug 01 11:03:33 localhost.localdomain network[4841]: RTNETLINK answers: File exists Aug 01 11:03:33 localhost.localdomain network[4841]: RTNETLINK answers: File exists Aug 01 11:03:33 localhost.localdomain network[4841]: RTNETLINK answers: File exists Aug 01 11:03:33 localhost.localdomain systemd[1]: network.service: control process exited, code=exited status=1 Aug 01 11:03:33 localhost.localdomain systemd[1]: Failed to start LSB: Bring up/down networking. Aug 01 11:03:33 localhost.localdomain systemd[1]: Unit network.service entered failed state. Aug 01 11:03:33 localhost.localdomain systemd[1]: network.service failed.- 輸入以下命令即可解決
- 再重啟網(wǎng)卡服務(wù),不會報(bào)錯(cuò)
三:橋接模式下無法上網(wǎng)
總結(jié)
以上是生活随笔為你收集整理的Centos中常见error(网卡、网络、防火墙)的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 【老王来了】之不眠不休教网络协议(RIP
- 下一篇: Centos 设置zookeeper开机