next up previous contents
Next: Email Transmission Up: IPv6 網路 Previous: IPv6 設定   Contents

IPv6 互 ping

  1. kvm7 ping6 kvm5 已設定好的 ipv6 位址,回應 Network is unreachable,原因為本身沒有 ipv6 的 ip。
    [root@kvm7 ~]# ping6 '2001:ac18::135'
    connect: Network is unreachable
    
  2. 查看 kvm7 目前只有 eth0 連線。
    [root@kvm7 ~]# nmcli connection show 
    NAME  UUID                                  TYPE            DEVICE 
    eth0  2b7d2642-13f3-48aa-a5e1-be77693ea318  802-3-ethernet  eth0
    
  3. 查看 kvm7 網路連線 eth0 只有本機 ipv6 位址 fe80::5054:ff:feff:f82a,沒有設定網域 ipv6 位址。
    [root@kvm7 ~]# nmcli connection show eth0 | egrep -i ipv?6
    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:                     --
    IP6.ADDRESS[1]:                         fe80::5054:ff:feff:f82a/64
    IP6.GATEWAY:
    
  4. kvm7 在 connection eth0 上增加 ipv6 位址 2001:ac18::137/64
    [root@kvm7 ~]# nmcli connection modify eth0 ipv6.addresses '2001:ac18::137/64' ipv6.method manual
    
  5. 查看 kvm7 網路連線 eth0 已加入 ipv6 位址 2001:ac18::137/64
    [root@kvm7 ~]# nmcli connection show eth0 | egrep -i ipv?6
    ipv6.method:                            manual
    ipv6.dns:                               
    ipv6.dns-search:                        
    ipv6.addresses:                         2001:ac18::137/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.dhcp-send-hostname:                yes
    ipv6.dhcp-hostname:                     --
    IP6.ADDRESS[1]:                         fe80::5054:ff:feff:f82a/64
    IP6.GATEWAY:
    
  6. kvm7 重新啟動網路。
    [root@kvm7 ~]# systemctl restart network.service
    
  7. kvm7 成功 ping6 kvm5 2001:ac18::135
    [root@kvm7 ~]# ping6 -c2 2001:ac18::135
    connect: Network is unreachable
    [root@kvm7 ~]# systemctl restart network.service 
    [root@kvm7 ~]# ping6 -c2 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=1.10 ms
    64 bytes from 2001:ac18::135: icmp_seq=2 ttl=64 time=0.345 ms
    
  8. kvm5 也成功 ping6 kvm7 2001:ac18::137
    [root@kvm5 ~]# ping6 -c2 2001:ac18::137
    PING 2001:ac18::137(2001:ac18::137) 56 data bytes
    64 bytes from 2001:ac18::137: icmp_seq=1 ttl=64 time=0.362 ms
    64 bytes from 2001:ac18::137: icmp_seq=2 ttl=64 time=0.293 ms
    
    --- 2001:ac18::137 ping statistics ---
    2 packets transmitted, 2 received, 0% packet loss, time 999ms
    rtt min/avg/max/mdev = 0.293/0.327/0.362/0.038 ms
    
  9. 如果無法成功 ping6 kvm5 2001:ac18::135,請以 root 權限在 deyu.wang(192.168.122.1) 主機增加 ip6 防火牆的 FORWARD。
    [root@dywnb ~]# ip6tables -I FORWARD -i virbr0 -o virbr0 -j ACCEPT
    
  10. 考試時 kvm5 及 kvm7 都有指定 ipv6 位址,請依題意要求設定,題目要求在那張網卡設定 ipv6 必須看清楚,若有指定 ipv6 gateway 則一併設定。


2017-11-30