How to add ipv6 default route

You need to add the route to the gateway first:

ip -6 route add 2004::3 dev eth0

To add a default gateway, and not one specific to an Ethernet interface (dev), use:

route add default gw <GW IP Address> # For IPv4
route add -A inet6 default gw <GW IP Address> # For IPv6; you must specify the Address Family (AF)

Notice, you don't have to specify the subnet mask, nor the outgoing Ethernet interface.

To verify your work, list the host's IP routing table suing:

netstat -rn # for IPv4
netstat -rn -A inet6  # for IPv6

Tags:

Ipv6

Route