how to set ipv6 next hope

Yogi asked:

I have a tunneling tool that will encap an ipv4 packet in ipv6 packet. However I am not able to configure route to ipv6 next-hop

My next-hop is 2003::1:70:16:234, which is reachable

machine1:/tmp# ping6 2003::1:70:16:234
PING 2003::1:70:16:234(2003::1:70:16:234) 56 data bytes
64 bytes from 2003::1:70:16:234: icmp_seq=1 ttl=64 time=4.29 ms
64 bytes from 2003::1:70:16:234: icmp_seq=2 ttl=64 time=1.73 ms
64 bytes from 2003::1:70:16:234: icmp_seq=3 ttl=64 time=1.75 ms

--- 2003::1:70:16:234 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2001ms
rtt min/avg/max/mdev = 1.731/2.590/4.290/1.203 ms

As I try to add route so as to route ipv4 packet destined to 8.8.8.0/24 through next hop/gw as 2003::1:70:16:234/64, it fails

machine1:/tmp#  route add -net 8.8.8.0/24 gw 2003::1:70:16:234/64
2003::1:70:16:234/64: **Unknown host  <<<<<<<<<---- ERROR**

However when tried to set next hop as an IPv4 address, route add is successful.

machine1:/tmp#  route add -net 8.8.8.0/24 gw 1.70.16.234
machine1:/tmp#  route del -net 8.8.8.0/24 gw 1.70.16.234

Any input on what’s so fundamentally wrong in my route command ?

My answer:


What’s fundamentally wrong here is that IPv4 and IPv6 are completely different protocols. You can’t route IPv4 traffic to IPv6 addresses.

I suspect you are trying to tunnel IPv4 traffic somewhere, but since you’ve given no details about that, it’s impossible to say anything further.


View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.