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
相关推荐
kobesdu7 小时前
【ROS2实战笔记-19】ROS2 生命周期节点的启动顺序、状态转换陷阱与热备方案
java·前端·笔记·机器人·ros·ros2
岳来7 小时前
Docker 的 --privileged 特权模式学习
docker·容器·--privileged
neo_Ggx237 小时前
Maven 版本管理详解:SNAPSHOT、Release 与 Nexus 仓库的区别和影响
java·maven
彩色的黑'''7 小时前
[root@localhost ~]#,Linux系统的命令提示符为啥现在变成-bash-4.2#了,哪里设置的
linux·运维·bash
matlabgoodboy7 小时前
软件开发定制小程序APP帮代做java代码代编写C语言设计python编程
java·c语言·小程序
江离w8 小时前
新版vibecoding项目初始化指令
java
源远流长jerry8 小时前
Linux 网络发送机制深度解析:从应用到网线
linux·服务器·网络·网络协议·tcp/ip
tongluowan0078 小时前
Spring MVC 底层工作流程+源码分析
java·spring·mvc
南境十里·墨染春水8 小时前
linux学习进展 shell编程
linux·运维·学习
goyeer9 小时前
【ITIL4】32服务实践 - 问题管理(Problem Management)
linux·运维·服务器·企业数字化·it管理·itil·it治理