Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


How to use ipv4 instead of ipv6
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

How to use ipv4 instead of ipv6

My Debian VPS has both ipv4 and ipv6. When I try to install OpenVPN using following, tries to connect to github using ipv6 and fails but eventually tries ipv4 and succeeds.

https://github.com/Nyr/openvpn-install

Then when this OpenVPN script finally runs, it is showing my ipv6 to choose from. Why is it not showing ipv4 and how do I force it to use ipv4 only?

Comments

  • DPDP Administrator, The Domain Guy

    I used to just edit the script and comment/remove the IPv6 portion.

  • You can change IPv4 priority via following command
    echo "precedence ::ffff:0:0/96 100" >> /etc/gai.conf

    If that doesn't work just turn ipv6 off
    net.ipv6.conf.all.autoconf = 0
    net.ipv6.conf.default.autoconf = 0
    net.ipv6.conf.all.accept_ra = 0
    net.ipv6.conf.default.accept_ra = 0
    net.ipv6.conf.all.disable_ipv6 = 1
    net.ipv6.conf.default.disable_ipv6 = 1
    net.ipv6.conf.lo.disable_ipv6 = 1
    net.ipv6.conf.eth0.disable_ipv6 = 1
    sysctl -p

  • I went ahead and installed it using option 1 and after that I am able to connect to my OpenVPN via ipv4. Looks like it doesn't actually bind it to specific IP address and any IP address available on the system can be used to connect to.

  • I am not 100% sure (there isn't any pesky IPv6 on my systems to begin with) but sysctl -w net.ipv6.conf.all.disable_ipv6=1 is likely to fix any problems related to IPv6 once and for all (well, at least as long as you add the setting to sysctl.conf). An alternative option would be adding ipv6.disable=1 to your kernel commandline and rebooting.

Sign In or Register to comment.