Yaroslav Polyakov
Posted on December 3, 2022
Sometimes npx create-react-app
just freezes and does not work at all:
$ npx create-react-app myapp
^C
Same problem I had with APT on my debian virtual machine inside LXC/LXD container - it just freezes and not working.
In my case, this is because I use Wireguard VPN and tunnel IPv4, but not IPv6. Yes, right way would be to forward IPv6 over VPN too, but I'm too lazy.
one-line fix:
sudo sysctl net.ipv6.conf.all.disable_ipv6=1
Optionally, you may put this to /etc/sysctl.conf:
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
But if you need to toggle IPv6 on/off often, here is simple script, put it to /usr/local/bin/ipv6:
#!/bin/bash
case $1 in
yes | on)
echo enable IPv6
sudo sysctl net.ipv6.conf.all.disable_ipv6=0
;;
no | off)
echo disable IPv6
sudo sysctl net.ipv6.conf.all.disable_ipv6=1
;;
*)
echo on/off?
if [ `/usr/sbin/sysctl net.ipv6.conf.all.disable_ipv6 | cut -f 2 -d= | tr -d " "` == "0" ]
then
echo IPv6 is enabled now
else
echo IPv6 is disabled now
fi
;;
esac
chmod +x it and....
$ ipv6 on
enable IPv6
net.ipv6.conf.all.disable_ipv6 = 0
$ ipv6 off
disable IPv6
net.ipv6.conf.all.disable_ipv6 = 1
💖 💪 🙅 🚩
Yaroslav Polyakov
Posted on December 3, 2022
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.