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
相关推荐
大路谈数字化11 分钟前
Centos中内存CPU硬盘的查询
linux·运维·centos
long31643 分钟前
构建者设计模式 Builder
java·后端·学习·设计模式
吐个泡泡v1 小时前
Maven 核心命令详解:compile、exec:java、package 与 IDE Reload 机制深度解析
java·ide·maven·mvn compile
天上掉下来个程小白1 小时前
微服务-01.导入黑马商城
java·微服务·架构
luoqice1 小时前
linux下查看 UDP Server 端口的启用情况
linux
Noii.1 小时前
Spring Boot初级概念及自动配置原理
java·spring boot·后端
探索java1 小时前
Tomcat Server 组件原理
java·后端·tomcat
勿在浮沙筑高台1 小时前
无法获取实体类com.example.springdemo2.entity.po.UserPO对应的表名!
java·spring boot·mybatis
用户8356290780512 小时前
Java使用Spire.Doc实现Word转PDF:格式精准的自动化解决方案
java
陆小叁2 小时前
基于Flink CDC实现联系人与标签数据实时同步至ES的实践
java·elasticsearch·flink