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
相关推荐
零基础的修炼1 分钟前
Linux---线程封装
linux·c++·算法
---学无止境---4 分钟前
Linux中比较两个字符串的前count个字符的汇编实现
linux
文火冰糖的硅基工坊13 分钟前
[嵌入式系统-115]:鸿蒙操作系统(HarmonyOS)与欧拉操作系统(openEuler)、Linux操作系统的关系、比较及异同如下:
linux·服务器·科技·华为·重构·架构·harmonyos
黄焖鸡能干四碗23 分钟前
MES生产执行制造系统建设(Java+Mysql)
java·大数据·开发语言·信息可视化·需求分析
2401_8370885025 分钟前
Redis的vim基本操作
linux·编辑器·vim
馨谙28 分钟前
标题:Linux 系统中的“保险库管理员”:深入浅出理解 /etc/shadow 文件
linux·运维·服务器
舒克日记31 分钟前
基于springboot的民谣网站的设计与实现
java·spring boot·后端
---学无止境---32 分钟前
Linux中zonelist分配策略初始化
linux
撬动未来的支点1 小时前
【Linux内核】Linux系统启动之旅
linux
凯子坚持 c2 小时前
Docker 深度解析:从虚拟化到新一代应用构建、运行与交付
运维·docker·容器