CentOS7 IPV6無効化する

CentOS7 IPV6無効化する

CentOS7でipv6を無効化する方法を記載してます。

環境

# cat /etc/centos-release
CentOS Linux release 7.7.1908 (Core)

設定ファイル変更

## ファイルのバックアップ
cp -piv /etc/sysctl.conf /etc/sysctl.conf.`date "+%Y%m%d"

## 設定追加
vi /etc/sysctl.conf

<下記を追加>
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1

## 設定反映
sysctl -p

以上で完了となります。