Pages

Thursday, August 23, 2012

IPv6 network commands for Free BSD

I am using a Free BSD machine in my office to run some test scripts. BSD is similar to Linux but not Linux. The commands to use in BSD interface is little different from commands being used in Linux. Many times I spent hours just find the correct syntax. So here I have given some commands' syntax.


Add IPv6 address
syntax: ifconfig <interface_name> inet6 <ipv6_address>/<prefix_len>
example: ifconfig vr0 inet6 3fff::2/64
des: Assigning ipv6 address 3fff::2 with prefix length 64 to the interface vr0

Delete IPv6 address
syntax: ifconfig <interface_name> inet6 <ipv6_address>/<prefix_len> delete
example: ifconfig vr0 inet6 3fff::2/64 delete
des: Removing ipv6 address 3fff::2 with prefix length 64 from the interface vr0

Add route in routing table
syntax: route add -inet6 <subnet> <gateway>
example: route add -inet6 ::/0 fe80::2
des: Adding default route to gateway fe80::2

Remove route from routing table
syntax: route del -inet6 <subnet> <gateway>
example: route del -inet6 ::/0 fe80::2
des: Removing default route to gateway fe80::2 from routing table

Show routing table
#netstat -nr

IPv6 address look-up (nslookup for ipv6)
syntax: nslookup -q=AAAA <domain_name>
example: nslookup -q=AAAA six.example.org
des: look up for ipv6 address to the domain six.example.org

ping ipv6 address
syntax: ping6 [-I <interface>] [-c <count>] <ipv6_address or domain having ipv6_address>
example: ping6 -I vr0 fe80::4
                 ping6 -I vr0 -c 4 six.example.org
des: first line pings to the ipv6 address fe80::4 via the interface vr0. Second line pings to the domain six.example.org which is having at-least an ipv6 address via interface vr0 four times. The second line first does DNS lookup for the name six.example.org

No comments:

Post a Comment