This is an old revision of the document!
Table of Contents
Disable ipv6 support
Apache
By default, Apache will listen on all IPs, both IPv6 and IPv4. This is controlled by the Listen directive:
Listen 80
To turn off IPv6 in Apache, just change the Listen directive in /etc/apache2/ports.conf
to
Listen 0.0.0.0:80
Repeat this for port 443 for HTTPS connections.
Then restart apache
/etc/init.d/apache2 restart
SSHD
By default, SSHD will listen on all IPs. This is configured in /etc/ssh/sshd_config
as ListenAddress option.
To force SSHD to only listen to IPv4 explicitly set this:
ListenAddress 0.0.0.0
Then restart SSHD
/etc/init.d/ssh restart
postfix
vi /etc/postfix/main.cf
Add inet_protocols line after inet_interfaces:
inet_protocols = ipv4
and restart postfix
/etc/init.d/postfix restart
Dovecot
vi /etc/dovecot/dovecot.conf
and add/change listen after the protocols = imap etc line, so it reads
listne = *
and restart dovecot
/etc/init.d/dovecot restart
EXIM
vi /etc/exim4/update-exim4.conf.conf
and change dc_local_interfaces so it reads
dc_local_interfaces='127.0.0.1'
and restart exim
/etc/init.d/exim4 restart
System wide
echo "# Disable IPv6" >> /etc/sysctl.conf echo "net.ipv6.conf.all.disable_ipv6 = 1" >> /etc/sysctl.conf echo "#" >> /etc/sysctl.conf sysctl -p
reboot system at some point
Confirm open connections
lsof -i