啟用設定IPv6網路

    版本為 05:52, 14 Jan 2025

    到這個版本。

    返回到 版本存檔.

    查閱目前版本

    Official Tutorial: https://cloudsupport.digitalocean.co...N000000CorQQAS

    Control Panel

    • Droplets > {your-droplet} > Networking >
    • Public IPv6 network = Enable

    NOTE: once enabled you will get the details of IPv6 network on the same page.

    Your droplet

    登入 droplet

    #> ssh root@{public_ipv4_address}
    
    #> ip -6 addr show eth0
    2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qlen 1000
        inet6 fe80::601:1eff:feb8:ee01/64 scope link
           valid_lft forever preferred_lft forever
    

    NOTE: As you can see, we already have one address in the configuration. This is the link-local address and is a mandatory requirement for various routing and protocol functions. This is not our public address; we still need to configure that.

    設定 IPv6 address

    #> ip -6 addr add {public_ipv6_address}/64 dev eth0
    #> ip -6 route add {default via public_ipv6_gateway) dev eth0
    #> ip -6 route add default via {default via public_ipv6_gateway)
    

    完成上述設定後,IPv6網路已經可以運作,但系統如有重開機,這些設定會自動消失。

    檢查 the IPv6 default gateway

    route -n -A inet6
    ip -6 route show
    

    測試 IPv6 網路

    #> ping6 2001:4860:4860::8888
    PING 2001:4860:4860::8888(2001:4860:4860::8888) 56 data bytes
    64 bytes from 2001:4860:4860::8888: icmp_seq=0 ttl=60 time=3.76 ms
    64 bytes from 2001:4860:4860::8888: icmp_seq=1 ttl=60 time=0.789 ms
    64 bytes from 2001:4860:4860::8888: icmp_seq=2 ttl=60 time=0.764 ms
    
    #> dig @2001:4860:4860::8888 www.google.com
    ...
    ;; ANSWER SECTION:
    www.google.com.		123	IN	A	74.125.24.106
    www.google.com.		123	IN	A	74.125.24.103
    www.google.com.		123	IN	A	74.125.24.147
    www.google.com.		123	IN	A	74.125.24.105
    www.google.com.		123	IN	A	74.125.24.104
    www.google.com.		123	IN	A	74.125.24.99
    ... 
    

    永久設定 IPv6 網路

    /etc/sysconfig/network

    ...
    NETWORKING_IPV6=yes
    

    /etc/sysconfig/network-scripts/ifcfg-eth0

    ...
    IPV6INIT=yes
    IPV6ADDR=primary_ipv6_address/64
    IPV6_DEFAULTGW=ipv6_gateway
    IPV6_AUTOCONF=no
    ...
    
    Powered by MindTouch Core