#author("2020-03-24T18:02:00+09:00","default:egashira","egashira") #author("2020-03-24T18:03:39+09:00","default:egashira","egashira") [[CentOS7]] *IPv6 を無効化 [#q7da65fe] |BGCOLOR(black):COLOR(white):|c |[root@localhost ~]# vi /etc/sysctl.conf| |net.ipv6.conf.all.disable_ipv6 = 1 &color(lime){← 追加します。}; &br; net.ipv6.conf.default.disable_ipv6 = 1 &color(lime){← 追加します。};| ''変更を反映'' |BGCOLOR(black):COLOR(white):|c |[root@localhost ~]# sysctl -p| **SSH対応 [#ab69f4ee] ''IPv4'' のみ接続させる |BGCOLOR(black):COLOR(white):|c |[root@localhost ~]# vi /etc/ssh/sshd_config| |AddressFamily inet &color(lime){←「#」を削除し、「any」の部分を「inet」に変更};| ※ちなみに ''IPv6'' のみ接続させる場合 |BGCOLOR(black):COLOR(white):|c |[root@localhost ~]# vi /etc/ssh/sshd_conf| |AddressFamily inet6 &color(lime){←「#」を削除し、「any」の部分を「inet6」に変更};| **postfix対応 [#v31bb2dc] postfix はデフォルトでIPv6が有効で、そのまま使っていたため、システム側でIPv6を無効にした場合はpostfix側でも無効にしてやる必要がある。 |BGCOLOR(black):COLOR(white):|c |[root@localhost ~]# vi /etc/postfix/main.cf| |inet_protocols = all &br; ↓&br; inet_protocols = ipv4| |[root@localhost ~]# systemctl restart postfix| **dovecot対応 [#hb9a8045] |BGCOLOR(black):COLOR(white):|c |[root@localhost ~]# vi /etc/dovecot/dovecot.conf| |#listen = *,:: &br; ↓&br; listen = *| **hostsファイル対応 [#g6238f1b] ''/etc/hosts の記述'' デフォルトでIPv6記述が入っているので削除しておく必要がある。/etc/hosts の以下などv6の行を削除またはコメントアウトします。 |BGCOLOR(black):COLOR(white):|c |[root@localhost ~]# cp /etc/hosts /etc/hosts.backup &color(lime){←バックアップ作成};| |[root@localhost ~]# vi /etc/hosts| |&color(lime){ipv6に関する行を削除する};| **chronyd(ntpサーバ) [#b75bdd52] |BGCOLOR(black):COLOR(white):|c |[root@localhost ~]# vi /etc/sysconfig/chronyd| |OPTIONS=""&br; ↓ &br; OPTIONS="-4"| |[root@localhost ~]# systemctl restart chronyd| **squid [#c5378392] ''SquidのDNSでIPv4を優先にする'' |BGCOLOR(black):COLOR(white):|c |[root@localhost ~]# vi /etc/squid/squid.conf| |dns_v4_first on &color(lime){←追加}; &br; udp_incoming_address 0.0.0.0 &color(lime){←追加}; &br; udp_outgoing_address 0.0.0.0 &color(lime){←追加};| **httpd [#z967ceb6] **Apache [#z967ceb6] |BGCOLOR(black):COLOR(white):|c |[root@localhost ~]# vi /etc/httpd/conf/httpd.conf| |Listen 80 &br; ↓ &br; Listen 0.0.0.0:80|