SlapOS Home SlapOS

    How To Get A Local IPv6 Network

    How to set up a local IPv6 Network for multiple users.
    • Last Update:2021-03-10
    • Version:004
    • Language:en

    Rapid.Space provides IPv6 connection on all servers, however, most ISP (Internet Service Provider) in China only provide IPv4 network. In order to help Rapid.Space users in China to adopt IPv6, without using proxy to access Rapid.Space service, we are going to introduce a reliable way to get a local IPv6 network by setting up a Raspberry Pi with Re6stnet and its token, so that all devices under this network can enjoy IPv6 and access Rapid.Space.

    The alternative way is to install IPv6 in your particular machine(Linux, Windows or Mac), which is explained on HowTo Install IPv6 On Your PC.

     

    Agenda

    1. Prerequisites
    2. Install Re6st in a Raspberry Pi
    3. Verify the IPv6 network
    4. Troubleshooting

    1. Prerequisites

    2. Install Re6st in a Raspberry Pi

    Set Raspberry Pi Network

    The default user of Raspberry Pi is “pi” and password is “raspberry”. If you are using wifi you need to set the wifi like below. Otherwise, just plug the Ethernet cable to the Raspberry Pi.
    Edit /etc/network/interfaces to have (this configure IP on the ethernet and wifi)

    auto wlan0
    iface wlan0 inet dhcp
            wpa-ssid yourwifiname
            wpa-psk yourpassword
    

    Install And Setup Re6st On Raspberry Pi

    Download re6st (For the people not in China, please visit download re6st by this link: https://deploy.erp5.net/gnet/re6st):

    wget https://deploy.erp5.cn/gnet/re6st
    

    Since you already have a token from 1. Prerequisites - Re6st Token, you can just run the re6st command with root then:

    sudo FORCE=yes bash re6st
    

    It will download some packages and then install re6st. Type the token you got in above when the script asks like below:
    Beware that if you want to broadcast IPv6 to every device in the same local network, you are required to type “yes” after Enable Router Advertisement [no]:.

    Your token  [notoken]: [Your_token]
    Enable Router Advertisement [no]: yes
    

    After this done. Reboot the Raspberry Pi and you will see the IPv6 address from the command ip -6 route.
    Unplug and plug Ethernet cable to ensure it works.
    TIP: if you forgot to put “yes” after Enable Router Advertisement [no]: you can simply rerun the command:

    sudo FORCE=yes bash re6st
    

    Don’t need to type your token again, you can just type “yes” to this question.

    3. Verify the IPv6 network

    There are multiple ways to check if you can access IPv6 network. You can see the IPv6 address from the command ip -6 route. You can easily go to some test IPv6 website like https://test-ipv6.com/ with your different devices under the local network.

    4. Troubleshooting

    When installing Re6st on your Raspberry Pi, if you skipped the question: Enable Router Advertisement [no]:, it kept “no” by default. You are able to check /etc/re6stnet/re6stnet.conf file on your Raspberry Pi (Linux machine has the similar file too, it can help you to debug).

    Here is an example:
    (The bad Configuration file)

    registry http://re6stnet.gnet.erp5.cn/
    ca ca.crt
    cert cert.crt
    key cert.key
    # increase re6stnet verbosity:
    #verbose 3
    # enable OpenVPN logging:
    #ovpnlog
    # uncomment the following 2 lines to increase OpenVPN verbosity:
    #O--verb
    #O3
    O--socket-flags
    O"TCP_NODELAY"
    

    (And the good one)

    registry http://re6stnet.gnet.erp5.cn/
    ca ca.crt
    cert cert.crt
    key cert.key
    daemon "exec dnsmasq -k8 - -i $re6stnet_iface -F ${re6stnet_subnet%/*},ra-only,${re6stnet_subnet#*/},1d"
    main-interface wlan0
    interface wlan0
    # increase re6stnet verbosity:
    #verbose 3
    # enable OpenVPN logging:
    #ovpnlog
    # uncomment the following 2 lines to increase OpenVPN verbosity:
    #O--verb
    #O3
    O--socket-flags
    O"TCP_NODELAY"
    

    It seems like the problem is dnsmasq didn’t launch. After rerun the command to install Re6st and enable router advertisement, you can check dnsmasq by

    ps aux | grep dnsmasq
    

    And you will get the result like:

    nobody     754  0.0  0.7  14484  6664 ?        S    13:58   0:05 dnsmasq -k8 - -i wlan0 -F 2401:5180:xxxx:xxxx:xxxx:,ra-only,64,1d
    pi        6735  0.0  0.0   7320   524 pts/0    S+   18:55   0:00 grep --colour=auto dnsmasq
    

    You will see that dnsmasq is launched to do “router advertisement” so if someone connects on the local network, your Raspberry will broadcast a message telling the new guy he can use an IPv6 from the Raspberry.
    ra-only means router advertisement.
    And you can see now that the router advertisement lasts 1 day (see the “1d”).
    Your raspberry is actually a router now but for IPv6 only.