CentOS 7.6 绑定多个IP

songjun  2021-09-28 21:07:05  阅读 1885 次 评论 29 条
摘要:

CentOS 7 批量绑定IP

确认网卡

ip addr

定位配置位置,(通常都在 /etc/sysconfig/network-scripts/目录中),配置文件通常都以 ifcfg-设备名称 的命名格式存在

打开网卡地址

cd /etc/sysconfig/network-scripts

复制网卡

cp ifcfg-eth0 ifcfg-eth0:1

cp ifcfg-eth0 ifcfg-eth0:2

CentOS 7 批量绑定IP

确认网卡

ip addr

定位配置位置,(通常都在 /etc/sysconfig/network-scripts/目录中),配置文件通常都以 ifcfg-设备名称 的命名格式存在

打开网卡地址

cd /etc/sysconfig/network-scripts

复制网卡

cp ifcfg-eth0 ifcfg-eth0:1

cp ifcfg-eth0 ifcfg-eth0:2

编辑主网卡比如以下例子:

vi ifcfg-eth0

原始代码为:

此处为隐藏内容,请评论后查看隐藏内容,谢谢!!!!

改后为:

此处为隐藏内容,请评论后查看隐藏内容,谢谢!!!!

编辑其他IP设置例子1:

vi ifcfg-eth0:1

改为以下内容

此处为隐藏内容,请评论后查看隐藏内容,谢谢!!!!

编辑其他IP设置例子2:

vi ifcfg-eth0:2

改为以下内容

此处为隐藏内容,请评论后查看隐藏内容,谢谢!!!!

重启网卡

service network restart

查看网卡状态

ifconfig或者ip addr


本文地址:https://www.elw.cc/index.php/post/49.html
版权声明:本文为原创文章,版权归 songjun 所有,欢迎分享本文,转载请保留出处!

发表评论


表情

评论列表

  1. dingjidong
    dingjidong  @回复

    哈哈,学习

  2. 访客
    访客  @回复

    123

  3. 访客
    访客  @回复

    8888

  4. laidichao
    laidichao  @回复

    666666666

  5. linvom
    linvom  @回复

    学习来了

  6. zhanzhangtadie
    zhanzhangtadie  @回复

    jiji

  7. sssk5
    sssk5  @回复

    sadsada

  8. 1111
    1111  @回复

    6666

  9. OUyan
    OUyan  @回复

    666

  10. 523232
    523232  @回复

    666666666

  11. qweasdzxc
    qweasdzxc  @回复

    666

  12. AhYu
    AhYu  @回复

    666666

  13. 6666
    6666  @回复

    6666

  14. 666666
    666666  @回复

    666666666

  15. 6666666
    6666666  @回复

    11111111111111

  16. loveaj83
    loveaj83  @回复

    1111111111

  17. dk123
    dk123  @回复

    来看看

  18. 1
    1  @回复

    1

  19. qqewe
    qqewe  @回复

    11

  20. 1
    1  @回复

    1

  21. 阿萨德
    阿萨德  @回复

    少室山

  22. 阿萨德
    阿萨德  @回复

    学习

  23. 阿萨德
    阿萨德  @回复

    666

  24. 不错
    不错  @回复

    666

  25. 12
    12  @回复

    的个呵呵我

  26. 1
    1  @回复

    6666

  27. 毒蝎
    毒蝎  @回复

    666

  28. 咚咚咚
    咚咚咚  @回复

    6666

  29. 咚咚咚
    咚咚咚  @回复

    666