This instruction is tested valid for Debian 9.
Sign in as root mode.
Modify the sysctl.conf to enable IPV6 network.
Add the content as follows:
Save and exit.
Make the new settings be valid:
Modify the networking interfaces:
Note: Please check whether your network interface’s name is eth0, or change the name according to your vps.
For only one IPV6 address:
For more IPV6 addresses:
save and exit.
Restart your network:
Check the IPV6 settings:
After you set up the IPV6 successfully, the IPV6 gateway will prevail.
You could change the /etc/gai.conf to make the IPV4 gateway still be the default route.
Delete the # for this line:
Save and exit.
Thanks for reading.