Linux 主机配置ipv6地址

ifconfig

bash 复制代码
# ifconfig
docker0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 172.17.0.1  netmask 255.255.0.0  broadcast 172.17.255.255
        ether 02:42:02:db:ce:da  txqueuelen 0  (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

ens160: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.200.108.171  netmask 255.255.255.0  broadcast 10.200.108.255
        inet6 fe80::250:56ff:febd:1953  prefixlen 64  scopeid 0x20<link>
        inet6 2409:806a:5af0:2000::f8ab  prefixlen 64  scopeid 0x0<global>
        ether 00:50:56:bd:19:53  txqueuelen 1000  (Ethernet)
        RX packets 1458  bytes 137838 (134.6 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 999  bytes 124779 (121.8 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0


[root@vga2prdfootk8snew71 ~]# 

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

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

bash 复制代码
# ifconfig ens160 inet6 add  2409:806a:5af0:2000::f8ab/118
SIOCSIFADDR: 文件已存在

需要先删除

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

bash 复制代码
# ifconfig ens160 del 2409:806a:5af0:2000::f8ab/64
[root@vga2prdfootk8snew71 ~]# 
[root@vga2prdfootk8snew71 ~]# ifconfig
docker0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 172.17.0.1  netmask 255.255.0.0  broadcast 172.17.255.255
        ether 02:42:02:db:ce:da  txqueuelen 0  (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

ens160: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.200.108.171  netmask 255.255.255.0  broadcast 10.200.108.255
        inet6 fe80::250:56ff:febd:1953  prefixlen 64  scopeid 0x20<link>
        ether 00:50:56:bd:19:53  txqueuelen 1000  (Ethernet)
        RX packets 1585  bytes 149480 (145.9 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1077  bytes 135639 (132.4 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

再添加

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

bash 复制代码
# ifconfig ens160 inet6 add 2409:806a:5af0:2000::f8ab/118
[root@vga2prdfootk8snew71 ~]# 
[root@vga2prdfootk8snew71 ~]# ifconfig
docker0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 172.17.0.1  netmask 255.255.0.0  broadcast 172.17.255.255
        ether 02:42:02:db:ce:da  txqueuelen 0  (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

ens160: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.200.108.171  netmask 255.255.255.0  broadcast 10.200.108.255
        inet6 fe80::250:56ff:febd:1953  prefixlen 64  scopeid 0x20<link>
        inet6 2409:806a:5af0:2000::f8ab  prefixlen 118  scopeid 0x0<global>
        ether 00:50:56:bd:19:53  txqueuelen 1000  (Ethernet)
        RX packets 1734  bytes 163672 (159.8 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1146  bytes 146065 (142.6 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
相关推荐
炸膛坦客4 小时前
Linux - Ubuntu - PC端:(三)切换中英文,Fcitx5
linux·ubuntu
7yewh4 小时前
jetson_yolo_deployment 01_linux_dev_env
linux·嵌入式硬件·yolo·机器人·嵌入式
cyber_两只龙宝4 小时前
【Haproxy】Haproxy的算法详解及配置
linux·运维·服务器·云原生·负载均衡·haproxy·调度算法
美好的事情能不能发生在我身上4 小时前
Hot100中的:贪心专题
java·数据结构·算法
阿常呓语4 小时前
Linux命令 jq详解
linux·运维·shell·jq
myloveasuka5 小时前
Java与C++多态访问成员变量/方法 对比
java·开发语言·c++
Andya_net5 小时前
Spring | @EventListener事件机制深度解析
java·后端·spring
lang201509285 小时前
18 Byte Buddy 进阶指南:解锁 `@Pipe` 注解,实现灵活的方法转发
java·byte buddy
重庆小透明5 小时前
【java基础篇】详解BigDecimal
java·开发语言
君生我老6 小时前
Linux 权限
linux