3
1

More than 3 years have passed since last update.

CentOS8でしぶといIPv6を無効にする

Last updated at Posted at 2020-10-09

はじめに

掲題の件で、手間取って調べた時のメモ

まずは王道

まずはよくあるパターンとして以下を実行してreboot

/etc/sysctl.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.enp0s3.disable_ipv6 = 1

再起動後にip aでチェックすると、しぶとく残っている。

$sudo sysctl --all | grep disable_ipv6
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.enp0s3.disable_ipv6 = 0
net.ipv6.conf.lo.disable_ipv6 = 1

解決策

Network mangerで管理しているから、効かないらしい。
そこで以下のおまじないを実行してリブート(enp0s3は環境によって読み替える)

$sudo nmcli connection modify enp0s3 ipv6.method ignore

これで ip aで見ると、無効になっている。

ちなみに

この状態でnetstat で見てもapacheなどはIPv6でLISTENと表示される。
これについては以下が詳しい。
https://qiita.com/fetaro/items/d5164ba8271114d8a0c8

参考

3
1
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
3
1