Hardcore Linux

Anything about Ubuntu, Centos, openSuSe and Fedora

Disable IPV6 on Ubuntu 9.04

I’ve been looking for ways to disable IPV6 without installing unofficial kernel in Ubuntu 9.04 (I think IPV6 embedded itself in kernel and not as a module). All those /etc/sysctl.conf modification up to the additional option in grub’s menu.lst are not working either.  So I come up with this idea using the stardard ip command.

The script should be runned as root to make it work without interaction (Adding it to root’s cron job) or you must specify sudoers to skip password asking for this running ip (which is a bad idea by the way).

Here’s my script:

#!/bin/sh
# Manually disables IPV6 in Ubuntu 9.04 without  unofficial Kernel update
#====================
# Hardc0l2e (c) 2009
# ronartos@gmail.com

ADDR_LIST=`ip -oneline -6 a | awk '{print $4 " dev " $2}'`
echo "$ADDR_LIST" | while read line
do
 sudo ip addr del $line
done

Done.

One response to “Disable IPV6 on Ubuntu 9.04

  1. Pingback: Disable IPV6 on Ubuntu 10.04 « Hardcore Linux

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: