How to use ip rule and ip route commands for IPv6 addresses?

6,626

The equivalent IPv6 versions require you to use "-6":

Add rule:

ip -6 rule add from 1234:5678:9abc:def0::/64 table 60 

Add route:

ip -6 route 1234:5678:9abc:def0::/64 dev eth0
Share:
6,626

Related videos on Youtube

test-01
Author by

test-01

Updated on September 18, 2022

Comments

  • test-01
    test-01 over 1 year

    For IPv4 we use:

    ip rule add from (ipv4 address) table 60
    ip route -net (ipv4 address) mask (ipv4 mask) (interface number)
    

    How do I use the ip rule and ip route commands for IPv6 addresses?

    • Zoredache
      Zoredache over 11 years
      What happens when you use the exact same syntax for an IPv6 rule and route, but with the -6 option or -family inet6 where appropriate?
    • WeloSefer
      WeloSefer over 11 years
      man ip would tell you all you need.