IPv6 設定

  1. 先查看目前 kvm5.deyu.wang 有 eth0, eth1, eth2 三張網卡,一張網路聚合網卡 team0。
    DEVICE  TYPE      STATE         CONNECTION 
    eth0    ethernet  connected     eth0       
    team0   team      connected     team0      
    eth1    ethernet  disconnected  --         
    eth2    ethernet  disconnected  --         
    lo      loopback  unmanaged     --
    
  2. 查看目前 eth0 一個網路連線及 team0 網路聚合。
    [root@kvm5 ~]# nmcli connection 
    NAME         UUID                                  TYPE            DEVICE 
    eth0         dbc2d531-7194-4fce-89b7-21ab6b9808fe  802-3-ethernet  eth0   
    team0        593ae0c3-5e03-44af-9baa-3969a7e6f1ba  team            team0  
    team0-port1  8265eab8-2dfc-4f0d-8e1d-b28758d9e457  802-3-ethernet  --     
    team0-port2  c8d637dc-6737-4ea9-a7dc-e8c6d1b2b239  802-3-ethernet  --
    
  3. 查看目前 eth0 沒有設定 ipv6 位址。
    [root@kvm5 ~]# nmcli connection show eth0 | grep ipv6
    ipv6.method:                            auto
    ipv6.dns:                               
    ipv6.dns-search:                        
    ipv6.addresses:                         
    ipv6.gateway:                           --
    ipv6.routes:                            
    ipv6.route-metric:                      -1
    ipv6.ignore-auto-routes:                no
    ipv6.ignore-auto-dns:                   no
    ipv6.never-default:                     no
    ipv6.may-fail:                          yes
    ipv6.ip6-privacy:                       -1 (unknown)
    ipv6.dhcp-send-hostname:                yes
    ipv6.dhcp-hostname:                     --
    
  4. 沒有指定那個連線設定 ipv6,則可以直接修改 eth0 網路連線,增加 ipv6 位址。
    [root@kvm5 ~]# nmcli connection modify eth0 ipv6.addresses 2001:ac18::135/64 ipv6.method manual
    
  5. 重新啟動網路。
    [root@kvm5 ~]# systemctl restart network.service
    
  6. 網卡 eth0 已有 ipv6 的 ip。
    [root@kvm5 ~]# nmcli connection show eth0 | egrep -i ipv?6
    ipv6.method:                            manual
    ipv6.dns:                               
    ipv6.dns-search:                        
    ipv6.dns-options:                       (default)
    ipv6.dns-priority:                      0
    ipv6.addresses:                         2001:ac18::135/64
    ipv6.gateway:                           --
    ipv6.routes:                            
    ipv6.route-metric:                      -1
    ipv6.ignore-auto-routes:                no
    ipv6.ignore-auto-dns:                   no
    ipv6.never-default:                     no
    ipv6.may-fail:                          yes
    ipv6.ip6-privacy:                       -1 (unknown)
    ipv6.addr-gen-mode:                     stable-privacy
    ipv6.dhcp-send-hostname:                yes
    ipv6.dhcp-hostname:                     --
    ipv6.token:                             --
    IP6.ADDRESS[1]:                         2001:ac18::135/64
    IP6.ADDRESS[2]:                         fe80::abb4:2fb4:cf34:4d24/64
    IP6.GATEWAY:
    
  7. 使用 ping6 ping 自己。
    [root@kvm5 ~]# ping6 -c3 2001:ac18::135
    PING 2001:ac18::135(2001:ac18::135) 56 data bytes
    64 bytes from 2001:ac18::135: icmp_seq=1 ttl=64 time=0.068 ms
    64 bytes from 2001:ac18::135: icmp_seq=2 ttl=64 time=0.115 ms
    64 bytes from 2001:ac18::135: icmp_seq=3 ttl=64 time=0.120 ms
    
    --- 2001:ac18::135 ping statistics ---
    3 packets transmitted, 3 received, 0% packet loss, time 2078ms
    rtt min/avg/max/mdev = 0.068/0.101/0.120/0.023 ms