The Set-Up.

This is a set up. Rush. Adrenaline.

In this post I explain what I like to do in post-install setup of my Debian VMs. First, I disable ipv6. Yes, I am a luddite but I think the ipv6 designers should have spent more time with the user focus groups. Colons? Seriously? Take a look at your keyboard right now. I’ll wait. How do you type a colon? That’s right it’s Shift + the key that shares the colon and semicolon symbols. Now compare that to typing an ipv4 address on a numpad. You can probably do it with your eyes closed. Divine! This really shows the importance of involving the end users in your technical standard development. /rant. Plus, I don’t have ipv6 on my network. I have a router that NATs to the internet, so I think I’ll be fine with the ipv4 address space.

There are a number of ways to disable ipv6 on your Debian machine. You can run the following commands. But it won’t be persistent, meaning after reboot ipv6 will be enabled again.

sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1
sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1
sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=1

Confirm that it worked by running sudo sysctl -p.

To have ipv6 disabled permanently, edit /etc/sysctl.conf with your favorite text editor, I prefer nano, so like this sudo nano /etc/sysctl.conf. And add the following at the end:

net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1		net.ipv6.conf.lo.disable_ipv6 = 1

Another way to disable ipv6 is to give the GRand Unified Bootloader (GRUB) the Linux kernel boot parameters. To do so edit /etc/default/grub and change the lines GRUB_CMDLINE_LINUX_DEFAULT and GRUB_CMDLINE_LINUX to include parameter ipv6.disable=1. After editing the file, run sudo update-grub to, you guessed it, update GRUB.

Alternatively, create a bash script with the code below and run it as root.

#Disable ipv6
sysctl -w net.ipv6.conf.all.disable_ipv6=1
sysctl -w net.ipv6.conf.default.disable_ipv6=1
sysctl -w net.ipv6.conf.lo.disable_ipv6=1

#Update GRUB kernel parameters
sed -i'.bak' -e '/^GRUB_CMDLINE_LINUX.*/ s/"$/ ipv6.disable=1"/g;s/=" /="/g' /etc/default/grub
update-grub

#Update sysctl.conf file
cat >> /etc/sysctl.conf<< EOF
net.ipv6.conf.all.disable_ipv6=1
net.ipv6.conf.default.disable_ipv6=1
net.ipv6.conf.lo.disable_ipv6=1
EOF
sysctl -p

This is it for now. Not much trouble with these parts, just editing the config files. But hey. It’s free, at least.