ifconfig_vtnet0_ipv6="inet6 2001:db8:1234:5678::1/64" ipv6_defaultrouter="2001:db8:1234:5678::ffff"
OSのdhclientはDHCPv6未対応のため、ISC DHCPクライントをインストールします。
# pkg install isc-dhcp43-client
IPv6アドレス割当て時にDynamic DNSでIPv6アドレスが自動的に登録されるようにします。
send host-name = pick-first-value(gethostname(), "ISC-dhclient"); send dhcp-lease-time 3600; supersede domain-search "next-hop.net"; request subnet-mask, broadcast-address, time-offset, routers, domain-name, domain-name-servers, host-name; require subnet-mask, domain-name-servers; timeout 60; retry 60; reboot 10; select-timeout 5; initial-interval 2; script "/usr/local/sbin/dhclient-script"; interface "vtnet0" { #send fqdn.fqdn = gethostname(); send fqdn.fqdn = "client1.next-hop.net"; #send fqdn.encoded on; #send fqdn.server-update on; also request fqdn, dhcp6.fqdn; }
search_domains="next-hop.net"
dhclient_program="/usr/local/sbin/dhclient" dhclient_flags="-q"
起動時に自動実行されるようにします。
#!/bin/sh if [ -x /usr/local/sbin/dhclient ]; then /usr/local/sbin/dhclient -6 vtnet0 & fi
IPv6を設定したはずなのに何故かIPv4で通信してしまうときはプレフィックステーブルの優先度に問題があるかもしれません。
Prefix Precedence Label ::1/128 50 0 ::/0 40 1 ::ffff:0:0/96 35 4 2002::/16 30 2 2001::/32 5 5 fc00::/7 3 13 ::/96 1 3 fec0::/10 1 11 3ffe::/16 1 12
IPv4の優先度が高くなるように設定されてます。
% ip6addrctl
Prefix Prec Label Use
::1/128 50 0 0
::/0 40 1 0
::ffff:0.0.0.0/96 100 4 0
2002::/16 30 2 0
2001::/32 5 5 0
fc00::/7 3 13 0
::/96 1 3 0
fec0::/10 1 11 0
3ffe::/16 1 12 0
デフォルトプレフィックステーブルを強制的に RFC6724 に準拠するようにます。
ip6addrctl_policy="ipv6_prefer"
% ip6addrctl Prefix Prec Label Use ::1/128 50 0 0 ::/0 40 1 0 ::ffff:0.0.0.0/96 35 4 0 2002::/16 30 2 0 2001::/32 5 5 0 fc00::/7 3 13 0 ::/96 1 3 0 fec0::/10 1 11 0 3ffe::/16 1 12 0
Copyright ©2000-2018 T.Hiraga <hiraga@next-hop.net> All Rights Reserved. Last modified: $Date: 2016/02/14 00:39:17 $ |