IPv6 Linux snippets

Mostly based onĀ this Linux IPv6 HOWTO.

Adding v6 address

ip -6 addr add <ipv6address>/<prefixlength> dev <interface>
# or
ifconfig <interface> inet6 add <ipv6address>/<prefixlength>

Removing v6 address

Same as adding, with "del" instead of "add".

Adding a v6 route

ip -6 route add <ipv6network>/<prefixlength> via <ipv6address>
# or
route -A inet6 add <ipv6network>/<prefixlength> gw <ipv6address> [dev <device>]