次に示す ifconfig コマンドは、まず hme0:3 論理インタフェースを 1234::5678/64 IPv6 アドレスに作成します。次に up オプションでインタフェースを使用可能にし、状態を報告し、インタフェースを使用不可にします。最後に、インタフェースを削除します。
# ifconfig hme0 inet6 addif 1234::5678/64 up Created new logical interface hme0:3 # ifconfig hme0:3 inet6 hme0:3: flags=2000841<UP,RUNNING,MULTICAST,IPv6> mtu 1500 index 2 inet6 1234::5678/64 # ifconfig hme0:3 inet6 down # ifconfig hme0 inet6 removeif 1234::5678 |
次に示す ifconfig コマンドは、まず物理インタフェース名に関連付けられたデバイスを開きます。次に TCP/IP がデバイスを使用するために必要なストリームを構成し、デバイスの状態を報告し、トンネルのソースアドレスと宛先アドレスを構成します。最後に、構成後のデバイスの最新状態を報告します。
# ifconfig ip.tun0 inet6 plumb index 13 # ifconfig ip.tun0 inet6 ip.tun0: flags=2200850<POINTOPOINT,RUNNING,MULTICAST,NONUD, #IPv6> mtu 1480 index 13 inet tunnel src 0.0.0.0 inet6 fe80::/10 --> :: # ifconfig ip.tun0 inet6 tsrc 120.46.86.158 tdst 120.46.86.122 # ifconfig ip.tun0 inet6 ip.tun0: flags=2200850<POINTOPOINT,RUNNING,MULTICAST,NONUD, IPv6> mtu 1480 index 13 inet tunnel src 120.46.86.158 tunnel dst 120.46.86.122 inet6 fe80::8192:569e/10 --> fe80::8192:567a |
# ifconfig ip.6to4tun0 inet6 plumb # ifconfig ip.6to4tun0 inet tsrc 129.146.86.187 \ 2002:8192:56bb:1::8192:56bb/64 up |
# ifconfig ip.6to4tun0 inet6 ip.6to4tun0: flags=2200041<UP,RUNNING,NONUD,IPv6>mtu 1480 index 11 inet tunnel src 129.146.86.187 tunnel hop limit 60 inet6 2002:8192:56bb:1::8192:56bb/64 |
この 6to4 擬似インタフェース設定例は、サブネット ID として 1 を使用し、ホスト ID を 16 進形式で指定しています。
# ifconfig ip.6to4tun0 inet6 plumb # ifconfig ip.6to4tun0 inet tsrc 129.146.86.187 up |
# ifconfig ip.6to4tun0 inet6 ip.6to4tun0: flags=2200041<UP,RUNNING,NONUD,IPv6>mtu 1480 index 11 inet tunnel src 129.146.86.187 tunnel hop limit 60 inet6 2002:8192:56bb::1/64 |