Centos中常见error(网卡、网络、防火墙)

一:Centos使用前需了解的

1:网卡

centos6的网卡重启方法:
service network restart

centos7的网卡重启方法:
systemctl restart network

2:防火墙

开启防火墙:systemctl start firewalld
关闭防火墙:systemctl stop firewalld
查看防火墙状态:systemctl status firewalld.service
在这里插入图片描述
开机自动启动:systemctl enable firewalld
关闭防火墙并设置开机不启动:systemctl disable firewalld
在这里插入图片描述
查看开机是否启动:chkconfig --list|grep network(RHLE6)
在这里插入图片描述

3、关闭安全增强性(在生产环境中一定要关闭):
vim /etc/selinux/configvim /etc/sysconfig/selinux
在这里插入图片描述
在这里插入图片描述

二:启动网卡服务错误

systemctl start network 启动网卡服务报错

[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.
  • 提示错误:
    Job for network.service failed because the control process exited with error code. See “systemctl status network.service” and “journal
    ctl -xe” for details

解决思路:查看错误日志

[root@localhost home]# systemctl status network.service 
 network.service - LSB: Bring up/down networking
   Loaded: 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 ago
     Docs: 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.

  • 输入以下命令即可解决
[root@localhost zzc]# systemctl stop NetworkManager
[root@localhost zzc]# systemctl disable NetworkManager
[root@localhost zzc]# 
  • 再重启网卡服务,不会报错
[root@localhost home]# systemctl restart network
[root@localhost home]#

三:桥接模式下无法上网

在这里插入图片描述

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

YJ Thoreau

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值