Disable IPv6: Difference between revisions

From Notes to self
Jump to navigation Jump to search
No edit summary
No edit summary
Line 16: Line 16:
<pre>Listen 0.0.0.0:80</pre>
<pre>Listen 0.0.0.0:80</pre>
(in <code>/etc/httpd/httpd.conf</code> and/or <code>/etc/httpd/extra/httpd-ssl.conf</code>)
(in <code>/etc/httpd/httpd.conf</code> and/or <code>/etc/httpd/extra/httpd-ssl.conf</code>)
*To disable IPv6 in <code>bind</code> put
<pre>NAMED_OPTIONS="-4"</pre>
to <code>/etc/default/named</code> and add
<pre>filter-aaaa-on-v4 yes;</pre>
to <code>options</code> in <code>/etc/named.conf</code>
*To disable IPv6 in <code>postfix</code> use the option <code>inet_protocols</code> in <code>/etc/postfix/main.cf</code>
*To disable IPv6 in <code>postfix</code> use the option <code>inet_protocols</code> in <code>/etc/postfix/main.cf</code>
*To disable IPv6 in <code>sendmail</code> use the option <code>Family=inet</code> in <code>DAEMON_OPTIONS</code> and <code>CLIENT_OPTIONS</code>
*To disable IPv6 in <code>sendmail</code> use the option <code>Family=inet</code> in <code>DAEMON_OPTIONS</code> and <code>CLIENT_OPTIONS</code>
[[Category: Linux]]
[[Category: Linux]]

Revision as of 14:05, 28 November 2020

  • The kernel option ipv6.disable=1 disables the whole IPv6 stack
  • If using the kernel option is not possible, add the following parameters to /etc/sysctl.conf:
# Disable IPv6
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
...

to prevent configuration of IPv6 for listed interfaces.

  • To force ntpd to not use IPv6 add -4 to
CMDLINE="/usr/sbin/ntpd -4 -g"

in /etc/rc.d/rc.ntpd

  • To force sshd to listen IPv4 only add
AddressFamily inet

to /etc/ssh/sshd_config

  • To force httpd to listen IPv4 only, specify an IPv4 address on all Listen directives, for example,
Listen 0.0.0.0:80

(in /etc/httpd/httpd.conf and/or /etc/httpd/extra/httpd-ssl.conf)

  • To disable IPv6 in bind put
NAMED_OPTIONS="-4"

to /etc/default/named and add

filter-aaaa-on-v4 yes;

to options in /etc/named.conf

  • To disable IPv6 in postfix use the option inet_protocols in /etc/postfix/main.cf
  • To disable IPv6 in sendmail use the option Family=inet in DAEMON_OPTIONS and CLIENT_OPTIONS