• 记录一次网卡问题


    问题:

    [root@rac19c01 ~]# ip a
    1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
        link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
        inet 127.0.0.1/8 scope host lo
           valid_lft forever preferred_lft forever
        inet6 ::1/128 scope host
           valid_lft forever preferred_lft forever
    2: ens33: mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
        link/ether 00:0c:29:73:28:16 brd ff:ff:ff:ff:ff:ff
        inet 192.168.1.61/24 brd 192.168.1.255 scope global noprefixroute ens33
           valid_lft forever preferred_lft forever
        inet6 fe80::99e4:3fd5:dee8:ea21/64 scope link noprefixroute
           valid_lft forever preferred_lft forever
    3: ens34: mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
        link/ether 00:50:56:37:17:0d brd ff:ff:ff:ff:ff:ff

    4: virbr0: mtu 1500 qdisc noqueue state DOWN group default qlen 1000
        link/ether 52:54:00:59:a5:44 brd ff:ff:ff:ff:ff:ff
        inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
           valid_lft forever preferred_lft forever
    5: virbr0-nic: mtu 1500 qdisc pfifo_fast master virbr0 state DOWN group default qlen 1000
        link/ether 52:54:00:59:a5:44 brd ff:ff:ff:ff:ff:ff

    修改配置文件后重启网络服务:

    [root@rac19c01 ~]# ifconfig ens34 up

    --重启未报错

    --再次检查,依旧不生效

    总结:ens34网段未生效,检查虚拟机网络配置和相关windows的网络配置,均显示正常

    解决

    后找人询问后发现是因为配置文件书写错误

    正确如下:

    [root@rac19c01 ~]# vi /etc/sysconfig/network-scripts/ifcfg-ens34
    TYPE=Ethernet
    PROXY_METHOD=none
    BROWSER_ONLY=no
    BOOTPROTO=none
    DEFROUTE=yes
    IPV4_FAILURE_FATAL=no
    IPV6INIT=yes
    IPV6_AUTOCONF=yes
    IPV6_DEFROUTE=yes
    IPV6_FAILURE_FATAL=no
    IPV6_ADDR_GEN_MODE=stable-privacy
    NAME=ens34
    UUID=30760386-ffe4-4245-b3b4-47710c316c54
    DEVICE=ens34
    ONBOOT=yes    #此处onboot需设置成yes,设置成开机自启动
    IPADDR=192.168.2.61
    PREFIX=24
    #GATEWAY=192.168.2.1   #此处网关设置需要注释掉,否则ip不生效
    IPV6_PRIVACY=no

    随机重启网络服务:

    [root@rac19c01 ~]# service network restart
    Restarting network (via systemctl):                        [  OK  ]

    --网络服务重启正常

    --再次检查,发现ip生效,ens34启动成功
     

    1. [root@rac19c01 ~]# ip a
    2. 1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    3. link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    4. inet 127.0.0.1/8 scope host lo
    5. valid_lft forever preferred_lft forever
    6. inet6 ::1/128 scope host
    7. valid_lft forever preferred_lft forever
    8. 2: ens33: mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    9. link/ether 00:0c:29:73:28:16 brd ff:ff:ff:ff:ff:ff
    10. inet 192.168.1.61/24 brd 192.168.1.255 scope global noprefixroute ens33
    11. valid_lft forever preferred_lft forever
    12. inet6 fe80::99e4:3fd5:dee8:ea21/64 scope link noprefixroute
    13. valid_lft forever preferred_lft forever
    14. 3: ens34: mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    15. link/ether 00:50:56:37:17:0d brd ff:ff:ff:ff:ff:ff
    16. inet 192.168.2.61/24 brd 192.168.2.255 scope global noprefixroute ens34
    17. valid_lft forever preferred_lft forever
    18. inet6 fe80::63d2:b0ff:a37c:c981/64 scope link noprefixroute
    19. valid_lft forever preferred_lft forever
    20. 4: virbr0: mtu 1500 qdisc noqueue state DOWN group default qlen 1000
    21. link/ether 52:54:00:59:a5:44 brd ff:ff:ff:ff:ff:ff
    22. inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
    23. valid_lft forever preferred_lft forever
    24. 5: virbr0-nic: mtu 1500 qdisc pfifo_fast master virbr0 state DOWN group default qlen 1000
    25. link/ether 52:54:00:59:a5:44 brd ff:ff:ff:ff:ff:ff
    26. [root@rac19c01 ~]#

  • 相关阅读:
    【数据结构初阶】复杂链表复制+带头双向循环链表+缓存级知识
    linux安装MySQL8.0,密码修改权限配置等常规操作详解
    短视频简单无脑玩法,播放量10w+的藏头诗玩法,操作思路分享给你!
    Docker容器
    20 C++设计模式之迭代器(Iterator)模式
    phpoffice/phpspreadsheet读取excel表格中的图片并保存到本地
    基于SpringMVC实现常见功能
    java高级用法之:无所不能的java,本地方法调用实况
    Drools实战
    前端(二十)——Vite和Webpack:前端开发中常用的构建工具
  • 原文地址:https://blog.csdn.net/weixin_43475880/article/details/128206690