• linux network报 RTNETLINK answers: File exists或者Could not load file '/etc/sysconfig/network-scripts/ifcfg-lo


    1.简单解决

    chkconfig network on

    chkconfig NetworkManager off
    service NetworkManager stop
    service network restart

    还是不行的话接着

    2解决virbr0问题

    service network restart

    2.1 重启网络

    还是报错

    [root@localhost ~]# journalctl -xe
    Mar 27 01:46:09 localhost.localdomain polkitd[639]: Registered Authentication Agent for unix-process:3228:511341 (system bus name :1.147 [/u
    Mar 27 01:46:09 localhost.localdomain systemd[1]: Starting LSB: Bring up/down networking...
    -- Subject: Unit network.service has begun start-up
    -- Defined-By: systemd
    -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
    -- 
    -- Unit network.service has begun starting up.
    Mar 27 01:46:11 localhost.localdomain NET[3361]: /etc/sysconfig/network-scripts/ifup-post : updated /etc/resolv.conf
    Mar 27 01:46:11 localhost.localdomain network[3235]: Bringing up loopback interface:  [  OK  ]
    Mar 27 01:46:11 localhost.localdomain NetworkManager[646]: <info>  [1585298771.5452] agent-manager: req[0x55beaec813c0, :1.158/nmcli-connect
    Mar 27 01:46:11 localhost.localdomain NetworkManager[646]: <info>  [1585298771.5703] audit: op="connection-activate" uuid="79df13d6-0d33-4de
    Mar 27 01:46:11 localhost.localdomain network[3235]: Bringing up interface eno16777736:  Error: Connection activation failed: No suitable de
    Mar 27 01:46:11 localhost.localdomain network[3235]: [FAILED]

    2.2 干 掉virbr0

    接着看,有virbr0,干 掉

    [root@localhost ~]# ifconfig
    lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
            inet 127.0.0.1  netmask 255.0.0.0
            inet6 ::1  prefixlen 128  scopeid 0x10<host>
            loop  txqueuelen 1000  (Local Loopback)
            RX packets 512  bytes 44544 (43.5 KiB)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 512  bytes 44544 (43.5 KiB)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
    
    virbr0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
            inet 192.168.122.1  netmask 255.255.255.0  broadcast 192.168.122.255
            ether 52:54:00:8c:be:b1  txqueuelen 1000  (Ethernet)
            RX packets 0  bytes 0 (0.0 B)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 0  bytes 0 (0.0 B)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

    2.3禁用libvirtd 服务

    干 掉,在 CentOS 7 系统的安装过程中,如果有选择相关虚拟化的的服务安装系统后,启动网卡时会发现有一个以网桥连接的私网地址的 virbr0 网卡,这个是因为在虚拟化中有使用到 libvirtd 服务生成的,如果不需要可以关闭后去掉

    [root@node ~]# ifconfig virbr0 down
    [root@node ~]# brctl delbr virbr0  #brctl删除网桥
    [root@node ~]# systemctl stop libvirtd.service    
    [root@node ~]# systemctl disable libvirtd.service    # 禁用libvirtd 服务开机自启动
    [root@node ~]# systemctl status libvirtd.service  
    root@localhost ~]# ifconfig virbr0 down
    [root@localhost ~]# brctl delbr virbr0  #brctl
    [root@localhost ~]# systemctl stop libvirtd.service
    [root@localhost ~]# systemctl disable libvirtd.service
    Removed symlink /etc/systemd/system/multi-user.target.wants/libvirtd.service.
    Removed symlink /etc/systemd/system/sockets.target.wants/virtlogd.socket.
    [root@localhost ~]# systemctl status libvirtd.service
    ● libvirtd.service - Virtualization daemon
       Loaded: loaded (/usr/lib/systemd/system/libvirtd.service; disabled; vendor preset: enabled)
       Active: inactive (dead) since Fri 2020-03-27 01:56:04 PDT; 20s ago
    [root@localhost ~]# ifconfig
    lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
            inet 127.0.0.1  netmask 255.0.0.0
            inet6 ::1  prefixlen 128  scopeid 0x10<host>
            loop  txqueuelen 1000  (Local Loopback)
            RX packets 512  bytes 44544 (43.5 KiB)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 512  bytes 44544 (43.5 KiB)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
    
    [root@localhost ~]# 

     3:解决ens33问题

    3.1 无ens33文件,


    若ifconfig -a出现ens33,无enozzzzzzzz,则mv ifcfg-enzzzz ifcfg-ens33,修改device name 为ens33

    3.2删除rules文件

    [root@localhost network-scripts]# cd /etc/udev/rules.d
    [root@localhost rules.d]# ll
    total 8
    -rw-r--r-- 1 root root 628 Feb  5  2019 70-persistent-ipoib.rules
    -rw-r--r-- 1 root root 161 Mar 26 22:38 90-eno-fix.rules
    [root@localhost rules.d]# rm -rf *.rules
    [root@localhost rules.d]# ll
    total 0

    ifconfig -a

    [root@localhost rules.d]# ifconfig -a
    eno16777736: flags=4098<BROADCAST,MULTICAST>  mtu 1500
            ether 00:0c:29:24:77:5f  txqueuelen 1000  (Ethernet)
            RX packets 0  bytes 0 (0.0 B)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 0  bytes 0 (0.0 B)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
    
    lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
            inet 127.0.0.1  netmask 255.0.0.0
            inet6 ::1  prefixlen 128  scopeid 0x10<host>
            loop  txqueuelen 1000  (Local Loopback)
            RX packets 512  bytes 44544 (43.5 KiB)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 512  bytes 44544 (43.5 KiB)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
    
    virbr0-nic: flags=4098<BROADCAST,MULTICAST>  mtu 1500
            ether 52:54:00:8c:be:b1  txqueuelen 1000  (Ethernet)
            RX packets 0  bytes 0 (0.0 B)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 0  bytes 0 (0.0 B)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
    
    [root@localhost rules.d]# 

     3.3编辑网卡文件,保证文件名,name device一致

     3.4 启动网卡,验证

    ifconfig eno16777736 up




  • 相关阅读:
    Oracle expdp导出多表或表中的部分数据
    sklearn随机森林-分类参数详解
    python中函数 reshape(-1,1)
    Scikit-Learn & TensorFlow机器学习实用指南(二):一个完整的机器学习项目【上】
    查看包内函数:
    盘点 | Python自带的那些数据集
    机器学习之数据预处理
    Python Numpy模块函数np.c_和np.r_
    Pandas dataframe数据写入文件和数据库
    机器学习入门-文本数据-构造Tf-idf词袋模型(词频和逆文档频率) 1.TfidfVectorizer(构造tf-idf词袋模型)
  • 原文地址:https://www.cnblogs.com/pu20065226/p/12575208.html
Copyright © 2020-2023  润新知