* Question on Netlink IPv6 routing table lookup
@ 2013-09-23 19:41 Fernando Gont
2013-09-24 0:04 ` Hannes Frederic Sowa
0 siblings, 1 reply; 4+ messages in thread
From: Fernando Gont @ 2013-09-23 19:41 UTC (permalink / raw)
To: netdev
Folks,
I'm performing IPv6 routing table lookups with a netlink socket, and it
seems that specifying the Source Address with the RTA_SRC element does
not have any effect on the result of the look-up.
In my network setup, I have two interfaces, as follows:
NET1 (fc00:1::/64) <------> MY_NODE <------> NET2 (fc00:2::/64)
For simplicity sake, let's say that my nodes' address on NET1 is
fc00:1::1, and my node's address on NET2 is fc00:2::1. And my node has
two default routes (one in NET1, and another in NET2).
I'd expect that if I set RTA_SRC to fc00:1::1, the default route on NET1
is selected, but if I set RTA_SRC to fc00:2::1, it is the default route
on NET2 that is selected.
However, the result of the routing tale look-up is always the same,
regardless of RTA_SRC.
I looked at /proc/net/ipv6_route, and it seems that, for all routes, the
"source network" is always set to :: (all zeroes), thus probably
explaining the above behavior.
Is there any way to influence the routing-table look-up based on the
IPv6 source address?
If that's not (currently) possible, should I expect RTA_SRC to work as
described above at some point in the future?
--
Fernando Gont
e-mail: fernando@gont.com.ar || fgont@si6networks.com
PGP Fingerprint: 7809 84F5 322E 45C7 F1C9 3945 96EE A9EF D076 FFF1
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Question on Netlink IPv6 routing table lookup
2013-09-23 19:41 Question on Netlink IPv6 routing table lookup Fernando Gont
@ 2013-09-24 0:04 ` Hannes Frederic Sowa
2013-09-26 10:36 ` Fernando Gont
0 siblings, 1 reply; 4+ messages in thread
From: Hannes Frederic Sowa @ 2013-09-24 0:04 UTC (permalink / raw)
To: Fernando Gont; +Cc: netdev
On Mon, Sep 23, 2013 at 04:41:07PM -0300, Fernando Gont wrote:
> If that's not (currently) possible, should I expect RTA_SRC to work as
> described above at some point in the future?
The RTA_SRC attriute matches on sutrees in the ipv6 routing table:
ip -6 r a default via fe80::1 dev eth0 from 2000::/64
ip -6 r a default via fe80::2 dev eth0 from 2000:1:/64
ip -6 r g :: from 2000::
ip -6 r g :: from 2000:1::
...should return different routes. The from parameter is the RTA_SRC
attribute.
Greetings,
Hannes
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Question on Netlink IPv6 routing table lookup
2013-09-24 0:04 ` Hannes Frederic Sowa
@ 2013-09-26 10:36 ` Fernando Gont
2013-09-27 0:16 ` Hannes Frederic Sowa
0 siblings, 1 reply; 4+ messages in thread
From: Fernando Gont @ 2013-09-26 10:36 UTC (permalink / raw)
To: netdev; +Cc: Hannes Frederic Sowa
Hi, Hannes,
On 09/23/2013 09:04 PM, Hannes Frederic Sowa wrote:
> On Mon, Sep 23, 2013 at 04:41:07PM -0300, Fernando Gont wrote:
>> If that's not (currently) possible, should I expect RTA_SRC to work as
>> described above at some point in the future?
>
> The RTA_SRC attriute matches on sutrees in the ipv6 routing table:
>
> ip -6 r a default via fe80::1 dev eth0 from 2000::/64
> ip -6 r a default via fe80::2 dev eth0 from 2000:1:/64
>
> ip -6 r g :: from 2000::
> ip -6 r g :: from 2000:1::
>
> ...should return different routes. The from parameter is the RTA_SRC
> attribute.
Isn't the "from" the "source network" in /proc/net/ipv6_route? (as
described in <http://www.tldp.org/HOWTO/Linux+IPv6-HOWTO/proc-net.html>)
I have a node with multiple Ethernet interfaces, each of which connected
to a different network where IPv6 Router Advertisements are received...
and the "source network" is set to all-zeros in all cases.
Thanks!
Best regards,
--
Fernando Gont
e-mail: fernando@gont.com.ar || fgont@si6networks.com
PGP Fingerprint: 7809 84F5 322E 45C7 F1C9 3945 96EE A9EF D076 FFF1
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Question on Netlink IPv6 routing table lookup
2013-09-26 10:36 ` Fernando Gont
@ 2013-09-27 0:16 ` Hannes Frederic Sowa
0 siblings, 0 replies; 4+ messages in thread
From: Hannes Frederic Sowa @ 2013-09-27 0:16 UTC (permalink / raw)
To: Fernando Gont; +Cc: netdev
On Thu, Sep 26, 2013 at 07:36:56AM -0300, Fernando Gont wrote:
> Hi, Hannes,
>
> On 09/23/2013 09:04 PM, Hannes Frederic Sowa wrote:
> > On Mon, Sep 23, 2013 at 04:41:07PM -0300, Fernando Gont wrote:
> >> If that's not (currently) possible, should I expect RTA_SRC to work as
> >> described above at some point in the future?
> >
> > The RTA_SRC attriute matches on sutrees in the ipv6 routing table:
> >
> > ip -6 r a default via fe80::1 dev eth0 from 2000::/64
> > ip -6 r a default via fe80::2 dev eth0 from 2000:1:/64
> >
> > ip -6 r g :: from 2000::
> > ip -6 r g :: from 2000:1::
> >
> > ...should return different routes. The from parameter is the RTA_SRC
> > attribute.
>
> Isn't the "from" the "source network" in /proc/net/ipv6_route? (as
> described in <http://www.tldp.org/HOWTO/Linux+IPv6-HOWTO/proc-net.html>)
Correct.
> I have a node with multiple Ethernet interfaces, each of which connected
> to a different network where IPv6 Router Advertisements are received...
> and the "source network" is set to all-zeros in all cases.
As soon as you add a route with RTA_SRC you will see those two fields != 0.
Subtrees don't get used by router advertisments. Only way to set these fields
is by using the RTA_SRC from user-land.
Greetings,
Hannes
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-09-27 0:16 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-23 19:41 Question on Netlink IPv6 routing table lookup Fernando Gont
2013-09-24 0:04 ` Hannes Frederic Sowa
2013-09-26 10:36 ` Fernando Gont
2013-09-27 0:16 ` Hannes Frederic Sowa
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.