Need help disable ipV6 at startup

Connection sharing, Firewall, Samba..etc
Forum rules
Before you post please read how to get help
Post Reply
briliath
Level 1
Level 1
Posts: 13
Joined: Wed Feb 15, 2017 10:03 pm

Need help disable ipV6 at startup

Post by briliath » Thu Jan 25, 2018 12:57 pm

Hello,
I am using Linux Mint and I have found out that I am leaking ipV6 even when using my VPN. So I found a way to disable ipV6 by doing this:

sudo sh -c "echo 'net.ipv6.conf.all.disable_ipv6=1\nnet.ipv6.conf.default.disable_ipv6=1\nnet.ipv6.conf.lo.disable_ipv6=1' >> /etc/sysctl.conf"

then this:

sudo sysctl -p

and it all works like a charm. The thing is - I have to do this every time I boot up. Can someone explain to me (I'm still sort of a noob) how I can write a script to have these commands work automatically at startup, so my ipV6 is automatically disabled every time I start the computer? I would need it all explained in simple terms. I have never written a script before. Thanks for any help.

User avatar
thx-1138
Level 6
Level 6
Posts: 1048
Joined: Fri Mar 10, 2017 12:15 pm
Location: Athens, Greece

Re: Need help disable ipV6 at startup

Post by thx-1138 » Thu Jan 25, 2018 1:18 pm

Code: Select all

gksudo xed /etc/default/grub
Change:

Code: Select all

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
To=>

Code: Select all

GRUB_CMDLINE_LINUX_DEFAULT="ipv6.disable=1 quiet splash"
Then run in a terminal:

Code: Select all

sudo update-grub
Reboot - that's all to it.
To undo: repeat the above after you have (...obviously) removed ipv6.disable=1 from the grub entry...

briliath
Level 1
Level 1
Posts: 13
Joined: Wed Feb 15, 2017 10:03 pm

Re: Need help disable ipV6 at startup

Post by briliath » Thu Jan 25, 2018 1:43 pm

Thanks!!!! That was so easy even I could do it. Do you know - will I need to do this every time I update to a new kernel? Or will this stick around until I remove it? The latest one I have is 4.13.0-31

User avatar
thx-1138
Level 6
Level 6
Posts: 1048
Joined: Fri Mar 10, 2017 12:15 pm
Location: Athens, Greece

Re: Need help disable ipV6 at startup

Post by thx-1138 » Thu Jan 25, 2018 2:02 pm

briliath wrote:Or will this stick around until I remove it?
Unless you change it back manually yourself, it will stick... :)

briliath
Level 1
Level 1
Posts: 13
Joined: Wed Feb 15, 2017 10:03 pm

Re: Need help disable ipV6 at startup

Post by briliath » Thu Jan 25, 2018 2:37 pm

FANTASTIC. Thank you so much!

Post Reply

Return to “Other networking topics”