Credit to Roxana Kovaci (https://twitter.com/RoxanaKovaci) and her SteelCon IPv6 workshop

Pivoting and routes

Adding routes

Using IP:

# /sbin/ip -6 route add <ipv6network>/<prefixlength> dev <device>

Example:

# /sbin/ip -6 route add default dev eth0 metric 1

or

# /sbin/ip -6 route add <ipv6> via 2001:0db8:0:f101::1

Metric ”1” is used here to be compatible with the metric used by route, because the default metric on using ”ip” is ”1024”.


Using "route":

Usage:

# /sbin/route -A inet6 add <ipv6network>/<prefixlength> dev <device>

Example:

# /sbin/route -A inet6 add default dev eth0

Removing routes

Removing an IPv6 route through an interface

Not so often needed to use by hand, configuration scripts will use such on shutdown.

Using "ip"