• Linux 主机配置ipv6地址


    ifconfig

    1. # ifconfig
    2. docker0: flags=4099 mtu 1500
    3. inet 172.17.0.1 netmask 255.255.0.0 broadcast 172.17.255.255
    4. ether 02:42:02:db:ce:da txqueuelen 0 (Ethernet)
    5. RX packets 0 bytes 0 (0.0 B)
    6. RX errors 0 dropped 0 overruns 0 frame 0
    7. TX packets 0 bytes 0 (0.0 B)
    8. TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
    9. ens160: flags=4163 mtu 1500
    10. inet 10.200.108.171 netmask 255.255.255.0 broadcast 10.200.108.255
    11. inet6 fe80::250:56ff:febd:1953 prefixlen 64 scopeid 0x20<link>
    12. inet6 2409:806a:5af0:2000::f8ab prefixlen 64 scopeid 0x0
    13. ether 00:50:56:bd:19:53 txqueuelen 1000 (Ethernet)
    14. RX packets 1458 bytes 137838 (134.6 KiB)
    15. RX errors 0 dropped 0 overruns 0 frame 0
    16. TX packets 999 bytes 124779 (121.8 KiB)
    17. TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
    18. [root@vga2prdfootk8snew71 ~]#

    我们看到ens160网卡上已经有ipv6dizhi ,

    这时直接添加,会报文件已存在

    1. # ifconfig ens160 inet6 add 2409:806a:5af0:2000::f8ab/118
    2. SIOCSIFADDR: 文件已存在

    需要先删除

    ifconfig ens160 del 2409:806a:5af0:2000::f8ab/64

    1. # ifconfig ens160 del 2409:806a:5af0:2000::f8ab/64
    2. [root@vga2prdfootk8snew71 ~]#
    3. [root@vga2prdfootk8snew71 ~]# ifconfig
    4. docker0: flags=4099 mtu 1500
    5. inet 172.17.0.1 netmask 255.255.0.0 broadcast 172.17.255.255
    6. ether 02:42:02:db:ce:da txqueuelen 0 (Ethernet)
    7. RX packets 0 bytes 0 (0.0 B)
    8. RX errors 0 dropped 0 overruns 0 frame 0
    9. TX packets 0 bytes 0 (0.0 B)
    10. TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
    11. ens160: flags=4163 mtu 1500
    12. inet 10.200.108.171 netmask 255.255.255.0 broadcast 10.200.108.255
    13. inet6 fe80::250:56ff:febd:1953 prefixlen 64 scopeid 0x20<link>
    14. ether 00:50:56:bd:19:53 txqueuelen 1000 (Ethernet)
    15. RX packets 1585 bytes 149480 (145.9 KiB)
    16. RX errors 0 dropped 0 overruns 0 frame 0
    17. TX packets 1077 bytes 135639 (132.4 KiB)
    18. TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

    再添加

    ifconfig ens160 inet6 add 2409:806a:5af0:2000::f8ab/118

    1. # ifconfig ens160 inet6 add 2409:806a:5af0:2000::f8ab/118
    2. [root@vga2prdfootk8snew71 ~]#
    3. [root@vga2prdfootk8snew71 ~]# ifconfig
    4. docker0: flags=4099 mtu 1500
    5. inet 172.17.0.1 netmask 255.255.0.0 broadcast 172.17.255.255
    6. ether 02:42:02:db:ce:da txqueuelen 0 (Ethernet)
    7. RX packets 0 bytes 0 (0.0 B)
    8. RX errors 0 dropped 0 overruns 0 frame 0
    9. TX packets 0 bytes 0 (0.0 B)
    10. TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
    11. ens160: flags=4163 mtu 1500
    12. inet 10.200.108.171 netmask 255.255.255.0 broadcast 10.200.108.255
    13. inet6 fe80::250:56ff:febd:1953 prefixlen 64 scopeid 0x20<link>
    14. inet6 2409:806a:5af0:2000::f8ab prefixlen 118 scopeid 0x0
    15. ether 00:50:56:bd:19:53 txqueuelen 1000 (Ethernet)
    16. RX packets 1734 bytes 163672 (159.8 KiB)
    17. RX errors 0 dropped 0 overruns 0 frame 0
    18. TX packets 1146 bytes 146065 (142.6 KiB)
    19. TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

  • 相关阅读:
    【flink】RowData copy/clone方式
    如何制作企业招聘二维码?
    Spring注册Bean系列--方法5:@Import+ImportBeanDefinitionRegistrar
    pyinstaller最简单教程
    【翻译】两阶段运动伪影(MA)去除算法
    高新技术企业知识产权评价
    Vue数据代理,事件处理,计算属性
    粘包/拆包问题一直都存在,只是到TCP就拆不动了。
    java编程基础总结——14.异常处理
    为了讲明白继承和super、this关键字,群主发了20块钱群红包
  • 原文地址:https://blog.csdn.net/red_sky_blue/article/details/134442912