# Disabling ipv6 on Debian

**URL:** <https://linux-tips.com/t/disabling-ipv6-on-debian/39>\
**Category:** Distributions\
**Created:** [December 15, 2014, 10:03pm UTC](https://linux-tips.com/t/disabling-ipv6-on-debian/39 "2014-12-15T22:03:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![MisterNo](https://linux-tips.com/user_avatar/linux-tips.com/misterno/32/55_2.png) [@MisterNo](https://linux-tips.com/u/MisterNo)\
**Post date:** [December 15, 2014, 10:03pm UTC](https://linux-tips.com/t/disabling-ipv6-on-debian/39/1 "2014-12-15T22:03:11Z")

</div>

What is the correct way to disable ipv6 on Debian?

---

<div class="post-metadata">

**Author:** ![demirten](https://linux-tips.com/user_avatar/linux-tips.com/demirten/32/64_2.png) [@demirten](https://linux-tips.com/u/demirten)\
**Post date:** [December 15, 2014, 10:37pm UTC](https://linux-tips.com/t/disabling-ipv6-on-debian/39/2 "2014-12-15T22:37:10Z")

</div>

Append `ipv6.disable=1` to the `GRUB_CMDLINE_LINUX` variable in `/etc/default/grub` and run `update-grub` and reboot.

Another option is to setting sysctl options like this:

```
cat << EOF > /etc/sysctl.d/00-disable-ipv6.conf
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
net.ipv6.conf.eth0.disable_ipv6 = 1
EOF

```

Repeat for other network interfaces too.

To activate new sysctl settings you can run `sysctl -p` or reboot the system.

You may want to disable ipv6 in exim4 too, otherwise you can continue to get following warnings:

```
2014-12-15 16:08:49 1Y0dov-0000KP-8d IPv6 socket creation failed: Address family not supported by protocol

```

To disable ipv6 lookup in exim4, you have to append `disable_ipv6='true'` line to `/etc/exim4/update-exim4.conf.conf` and run `update-exim4.conf` and restart exim4.

---

<div class="post-metadata">

**Author:** ![fmvc](https://linux-tips.com/letter_avatar_proxy/v4/letter/f/c67d28/32.png) [@fmvc](https://linux-tips.com/u/fmvc)\
**Post date:** [December 19, 2014, 1:20am UTC](https://linux-tips.com/t/disabling-ipv6-on-debian/39/3 "2014-12-19T01:20:13Z")

</div>

Or you can also append this to **/etc/rc.local** (before _exit 0_) : **echo 1 \> /proc/sys/net/ipv6/conf/all/disable\_ipv6**  
Writing “1” to this file disables IPv6.
