DEV Community

Yaroslav Polyakov
Yaroslav Polyakov

Posted on • Edited on

2 2

Create-react-app and apt freezes + script to enable/disable IPv6

Sometimes npx create-react-app just freezes and does not work at all:

$ npx create-react-app myapp
^C
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

Optionally, you may put this to /etc/sysctl.conf:

net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
Enter fullscreen mode Exit fullscreen mode

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

Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

Speedy emails, satisfied customers

Postmark Image

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay