toreanderson / clatd

A 464XLAT CLAT implementation for Linux
MIT License
213 stars 19 forks source link

ip -6 route get with netmask failed #12

Closed genofire closed 5 years ago

genofire commented 5 years ago

Log:

Starting clatd v1.4 by Tore Anderson <tore@fud.no>
Performing DNS64-based PLAT prefix discovery (cf. RFC 7050)
Using PLAT (NAT64) prefix: 64:ff9b::/96
Error: ipv6: Invalid values in header for get route request.
<error> get_plat_dev(): 'ip -6 route get 64:ff9b::/96' failed

Some example ip -6 route get commands

genoHost ~ $ ip -6 route get 64:ff9b::/96
Error: ipv6: Invalid values in header for get route request.
genoHost ~ $  ip -6 route get 64:ff9b::
64:ff9b:: from :: via fe80::1441:95ff:fe40:f7dc dev wlp4s0 ens3 ra src my::ipv6:addr metric 600 pref medium
genoHost ~ $  ip -6 route get 64:ff9b::8.8.8.8
64:ff9b::808:808 from :: via fe80::1441:95ff:fe40:f7dc dev ens3 proto ra src my::ipv6:addr metric 600 pref medium
genoHost ~ $  ip -6 route get 64:ff9b::1.1.1.1
64:ff9b::101:101 from :: via fe80::1441:95ff:fe40:f7dc dev ens3 proto ra src my::ipv6:addr metric 600 pref medium
toreanderson commented 5 years ago

Thanks for the report! Could you confirm that the issue12 branch fixes the problem?

genofire commented 5 years ago

Works for me, thx.

by the way, nice to have notes like this

 Note: traffic between IPv6 hosts and private IPv4 addresses (i.e. to/from 64:ff9b::10.0.0.0/104, 64:ff9b::192.168.0.0/112, etc) will be dropped.  Use a translation prefix within your organization's IPv6 address space instead of 64:ff9b::/96 if you need your IPv6 hosts to communicate with private IPv4 addresses.
toreanderson commented 5 years ago

Pushed fix to master, thanks.

The message you quote comes from TAYGA, not clatd. It just informs you that you cannot use 64:ff9b::/96 to communicate with RFC1918 addresses (see RFC 6052 section 3.1).

genofire commented 5 years ago

I know the RFC, but not where it is from. :+1: