LoginSignup
25
30

More than 5 years have passed since last update.

CentOSでIPv6 を無効にするとメールが送れなくなった

Posted at

恐らくpostfix以外にもいくつか影響は出てたと思いますが、とりあえず気づいたきっかけはpostfixでした。

sysctlを編集してipv6を無効にする

if [ `grep disable_ipv6 /etc/sysctl.conf | wc -l` -ne 2 ]; then
    cat >> /etc/sysctl.conf << EOM
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
EOM
fi
sysctl -w net.ipv6.conf.all.disable_ipv6=1
sysctl -w net.ipv6.conf.default.disable_ipv6=1

するとpostfixが立ち上がらなくなった

# /etc/init.d/postfix start
postfix を起動中:                                          [失敗]

maillogを見ると変なエラーが出ている。

/var/log/maillog
postfix[22483]: fatal: parameter inet_interfaces: no local interface found for ::1

::1 という事はおそらくどこかでipv6の設定がされているのだろうと予想。
その結果/etc/hostsにipv6の設定が残ってた。

/etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

::1の行をコメントアウト

/etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
#::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

postfix起動

# /etc/init.d/postfix restart
postfix を起動中:                                          [  OK  ]

成功した。

ipv6を無効にしたらhostsのipv6の行も消しましょうという事でした。

25
30
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
25
30