Linux Redhat 7.7 IPV6静态配置

1. IPV6信息查询

1.1. 查看IPv6地址

[root@localhost ~]# ifconfig
eno1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.10.3.11  netmask 255.255.255.0  broadcast 192.10.3.255
        inet6 fe80::28c:faff:fef1:dd24  prefixlen 64  scopeid 0x20<link>
        ether 00:8c:fa:f1:dd:24  txqueuelen 1000  (Ethernet)
        RX packets 49501354  bytes 29731085315 (27.6 GiB)
        RX errors 0  dropped 1204  overruns 0  frame 0
        TX packets 707190  bytes 461594037 (440.2 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device memory 0xc7200000-c727ffff  

eno2: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether 00:8c:fa:f1:dd:25  txqueuelen 1000  (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
        device memory 0xc7100000-c717ffff  

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 0  (Local Loopback)
        RX packets 122  bytes 11983 (11.7 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 122  bytes 11983 (11.7 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

1.2. 查看IPv6默认网关

[root@localhost ~]# ip -6 route show dev eno1
fe80::/64  proto kernel  metric 256

2. IPv6静态配置

2.1. 配置sysctl.conf 文件

vi /etc/sysctl.conf
net.ipv6.conf.all.disable_ipv6=0
net.ipv6.conf.default.disable_ipv6=0
net.ipv6.conf.lo.disable_ipv6=0

2.2. disable_ipv6.conf

vi /etc/modprobe.d/disable_ipv6.conf
options ipv6 disable=0

2.3. 配置

vi /etc/sysconfig/network
NETWORKING_IPV6=yes
vi /etc/sysconfig/network-scripts/ifcfg-eno1
NAME=eno1
UUID=ec075e28-30b1-48db-8d48-74e7d416a0b9
DEVICE=eno1
ONBOOT=yes
IPADDR=192.10.3.11
PREFIX=24
GATEWAY=192.10.3.1
IPV6INIT=yes
IPV6_AUTOCONF=no
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6ADDR=fe80::28c:faff:fef1:dd24
IPV6_DEFAULTGW=fe80::/64

2.4. 重启网络服务

[root@localhost network-scripts]# systemctl restart network

3. 验证是否能够ping通

[root@localhost sysconfig]# ping6 -I eno1 fe80::28c:faff:fef1:dd24
PING fe80::28c:faff:fef1:dd24(fe80::28c:faff:fef1:dd24) from fe80::28c:faff:fef1:dd24 eno1: 56 data bytes
64 bytes from fe80::28c:faff:fef1:dd24: icmp_seq=1 ttl=64 time=0.023 ms
64 bytes from fe80::28c:faff:fef1:dd24: icmp_seq=2 ttl=64 time=0.012 ms
64 bytes from fe80::28c:faff:fef1:dd24: icmp_seq=3 ttl=64 time=0.022 ms
64 bytes from fe80::28c:faff:fef1:dd24: icmp_seq=4 ttl=64 time=0.022 ms
  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值