Thursday 14 March 2013

Disable IPv6 on Ubuntu

Edit your /etc/sysctl.conf file and add the following to the bottom:
#disable ipv6
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
Or you can use the following script:
echo "#disable ipv6" | sudo tee -a /etc/sysctl.conf
echo "net.ipv6.conf.all.disable_ipv6 = 1" | sudo tee -a /etc/sysctl.conf
echo "net.ipv6.conf.default.disable_ipv6 = 1" | sudo tee -a /etc/sysctl.conf
echo "net.ipv6.conf.lo.disable_ipv6 = 1" | sudo tee -a /etc/sysctl.conf
For this changes to take effect you must reboot your system.
After rebooting you can check if IPv6 has been disabled with the following command:
cat /proc/sys/net/ipv6/conf/all/disable_ipv6
0 means it's enabled and 1 - disabled.

Possibly Related Posts

Linux Stress tests

Consume CPU:

Fork bomb:

:(){ :|:& };:
The next one will load four CPU cores at 100%:
for i in `seq 1 4` ; do while : ; do : ; done & ; done
Or:
for i in `seq 1 4` ; do cat /dev/zero > /dev/null & ; done
Or:
#!/bin/bash
duration=120 # seconds
instances=4 # cpus
endtime=$(($(date +%s) + $duration))
for ((i=0; i<instances; i++))
do
while (($(date +%s) < $endtime)); do : ; done &
done
Using the stress tool:
stress --cpu 3

Consume RAM:

Create a 30gb ramdisk and fills it with file full of zeroes:
sudo mount -t tmpfs -o size=30G tmpfs /mnt
dd if=/dev/zero of=/mnt/tmp bs=10240 count=30720MB

Create a giant virable:
x="x" ; while : ; do x=$x$x ; echo -n "." ; done

Consume Disk:

dd if=/dev/zero of=bigfile bs=10240 count=30720MB

Simulate packet loss:

For randomly dropping 10% of incoming packets:
iptables -A INPUT -m statistic --mode random --probability 0.1 -j DROP
and for dropping 10% of outgoing packets:
iptables -A OUTPUT -m statistic --mode random --probability 0.1 -j DROP


Possibly Related Posts