ntpdでIPv6を使わないようしたい。
でも、「/etc/ntp.conf」に
server ntp.nict.jp -4 iburst server ntp.nict.jp -4 iburst server ntp.nict.jp -4 iburst server ntp.nict.jp -4 iburst
って書いても問い合わせをIPv4でって意味なのでこれではダメ。
まず、ntpdのIPv6の状態を見てみる
# netstat -lanput|grep ntpd udp 0 0 aaaa:bbbb:cccc:dddd:gggg::123 :::* 1306/ntpd udp 0 0 fe80::gggg:ffff:eeee:dddd:123 :::* 1306/ntpd udp 0 0 ::1:123 :::* 1306/ntpd
なんか感じ悪いので、
CentOS
# vi /etc/sysconfig/ntpd # Drop root to id 'ntp:ntp' by default. OPTIONS="-4 -u ntp:ntp -p /var/run/ntpd.pid -g" # # service ntpd restart Shutting down ntpd: [ OK ] Starting ntpd: [ OK ]
「-4」を追記してntpdサービスを再起動
Ubuntu、Debian
# vi /etc/default/ntp NTPD_OPTS='-4 -g ' # # service ntp restart * Stopping NTP server ntpd [ OK ] * Starting NTP server ntpd [ OK ]
「-4」を追記してntpdサービスを再起動
[tegaki]IPv6怖い[/tegaki]