Re: Recursive nexthop via kernel route in proto static not working

2023-08-15 Thread Maria Matejka via Bird-users

Hello!

On 7/5/23 00:34, Daniel Gröber wrote:



There are some details in the recursive nexthop resolution algorithm
(preventing infinite resolution loops) which may apply to your case.

Can you point me to the right bits in the code so I can have a look?


The appropriate function is rt_update_hostentry()in nest/rt-table.c

Sorry for late answer.
Maria

--
Maria Matejka (she/her) | BIRD Team Leader | CZ.NIC, z.s.p.o.


Re: Recursive nexthop via kernel route in proto static not working

2023-07-04 Thread Daniel Gröber
Hi Maria,

So I just did a bird restart on the router I was testing on after poking
around some more and now the recursive route is suddenly working without a
change in config.

On Tue, Jun 27, 2023 at 09:50:14PM +0200, Maria Matejka wrote:
> this looks fishy. I tried a trivial config like this on my laptop as follows
> and it works. Could you please disclose the full table? 

My master6 just has a full-table plus kernel/device routes. For some reason
before the restart all of them were "unreachable"[1] but now they seem to
resolve via the default route now. I didn't save the dump I did before the
restart unfortunately.

[1]: Not sure why, but it doesn't matter since I just use the BGP feed on
this router as a reflector and BGP routes are not exported to the kernel.

None of the BGP routes were covering :: (I checked with `route show for
::`) so I don't really see why `recursive ::` suddenly works now. I tried
this on another one of my routers that has a similar setup and it's also
working there.

I guess I'll just keep an eye on this for now.

> There are some details in the recursive nexthop resolution algorithm
> (preventing infinite resolution loops) which may apply to your case.

Can you point me to the right bits in the code so I can have a look?

> BTW, is there really no message in the log?

I don't see any log messages, but maybe my verbosity itn's high
enough. What options do I have to twiddle to make sure?

Thanks,
--Daniel


Re: Recursive nexthop via kernel route in proto static not working

2023-06-27 Thread Maria Matejka via Bird-users

Hello Daniel,

this looks fishy. I tried a trivial config like this on my laptop as 
follows and it works. Could you please disclose the full table? There 
are some details in the recursive nexthop resolution algorithm 
(preventing infinite resolution loops) which may apply to your case. 
BTW, is there really no message in the log?


The config:

protocol device {}
protocol kernel {
  ipv6 { import all; export none; };
  learn;
}

protocol static {
  ipv6;
  route fdca:db8::/32 recursive ::;
}

The table:

Table master6:
::/0 unicast [kernel1 21:42:38.893] * (10)
    via fe80::feed:dee4:fe00:23d3 on wlo1
    Type: inherit univ
    Kernel.source: 9
    Kernel.metric: 600
2a00:1028:dead:beef::/64 unicast [kernel1 21:42:38.893] * (10)
    dev wlo1
    Type: inherit univ
    Kernel.source: 9
    Kernel.metric: 600
fdca:db8::/32    unicast [static1 21:42:38.891] * (200)
    via fe80::feed:dee4:fe00:23d3 on wlo1
    Type: static univ

Have a nice evening or any other part of the day!
Maria

On 6/27/23 18:03, Daniel Gröber wrote:

Hi Alexander,

On Tue, Jun 27, 2023 at 04:48:46PM +0200, Alexander Zubkov wrote:

Not sure, but I would guess it can be related to the local address. It
might try to pick the first interface with such network.
Could you try your setup with some route that has the nexthop from a
unique subnet configured on the interface? At least to check if it will
become reachable or not.

Ok, if I add a route like `2000::/64 dev enp1s0 via
fe80::fc00:3ff:fec7:cd05` to the kernel and recurse through that it does
work.

 protocol static static_export_kernel2 {
 ipv6;
 igp table master6;
 route 2001:db8::/64 recursive 2000::1234;
 }

 $ ip -6 route add 2000::/64 dev enp1s0 via fe80::fc00:3ff:fec7:cd05
 $ birdc show route protocol static_export_kernel2 all
 2001:db8::/64unicast [static_export_kernel2 16:01:20.131] * (200)
 via fe80::fc00:3ff:fec7:cd05 on enp1s0
 Type: static univ


Or it might be that routes imported from the kernel are marked as
recursive, so it does not resolve because Bird does not allow double
recursion.

If I remove the 2000::/64 route the recursive route goes back to
unreachable. So something seems to be preventing recursion through the
default route specifically, but it evidently doesn't have anything to do
with the route coming from the kernel.

 $ ip -6 route del 2000::/64 dev enp1s0 via fe80::fc00:3ff:fec7:cd05
 $ birdc show route protocol static_export_kernel2 all
 2001:db8::/64unreachable [static_export_kernel2 16:01:20.131] * 
(200)
 Type: static univ

Weird.

Thanks for your suggestions,
--Daniel


--
Maria Matejka (she/her) | BIRD Team Leader | CZ.NIC, z.s.p.o.


Re: Recursive nexthop via kernel route in proto static not working

2023-06-27 Thread Daniel Gröber
Hi Alexander,

On Tue, Jun 27, 2023 at 04:48:46PM +0200, Alexander Zubkov wrote:
> Not sure, but I would guess it can be related to the local address. It
> might try to pick the first interface with such network.

> Could you try your setup with some route that has the nexthop from a
> unique subnet configured on the interface? At least to check if it will
> become reachable or not.

Ok, if I add a route like `2000::/64 dev enp1s0 via
fe80::fc00:3ff:fec7:cd05` to the kernel and recurse through that it does
work.

protocol static static_export_kernel2 {
ipv6;
igp table master6;
route 2001:db8::/64 recursive 2000::1234;
}

$ ip -6 route add 2000::/64 dev enp1s0 via fe80::fc00:3ff:fec7:cd05
$ birdc show route protocol static_export_kernel2 all
2001:db8::/64unicast [static_export_kernel2 16:01:20.131] * (200)
via fe80::fc00:3ff:fec7:cd05 on enp1s0
Type: static univ

> Or it might be that routes imported from the kernel are marked as
> recursive, so it does not resolve because Bird does not allow double
> recursion.

If I remove the 2000::/64 route the recursive route goes back to
unreachable. So something seems to be preventing recursion through the
default route specifically, but it evidently doesn't have anything to do
with the route coming from the kernel.

$ ip -6 route del 2000::/64 dev enp1s0 via fe80::fc00:3ff:fec7:cd05
$ birdc show route protocol static_export_kernel2 all
2001:db8::/64unreachable [static_export_kernel2 16:01:20.131] * 
(200)
Type: static univ

Weird.

Thanks for your suggestions,
--Daniel



Re: Recursive nexthop via kernel route in proto static not working

2023-06-27 Thread Alexander Zubkov via Bird-users
Also try to enable debugging. It might log something about why it
cannot resolve the recursive route.

On Tue, Jun 27, 2023 at 4:48 PM Alexander Zubkov  wrote:
>
> Hi,
>
> Not sure, but I would guess it can be related to the local address. It
> might try to pick the first interface with such network. Could you try
> your setup with some route that has the nexthop from a unique subnet
> configured on the interface? At least to check if it will become
> reachable or not.
> Or it might be that routes imported from the kernel are marked as
> recursive, so it does not resolve because Bird does not allow double
> recursion.
>
> On Tue, Jun 27, 2023 at 4:22 PM Daniel Gröber  wrote:
> >
> > Hi,
> >
> > I'm trying to configure a static route that uses the system's default
> > router. The default router is out of my control and is announced via IPv6
> > RA. Since the MAC might not be stable I'd prefer not to hardcode the
> > router's link-local address. So I tried:
> >
> > protocol static static_export_kernel2 {
> > ipv6;
> > igp table master6;
> > route 2001:db8::/48 recursive ::;
> > }
> >
> > The thinking being that :: ought to be resolvable through the default route
> > imported from proto kernel:
> >
> > birdc show route for :: all
> > Table master6:
> > ::/0 unicast [kernel1 2023-03-22] * (10)
> > via fe80::fc00:3ff:fec7:cd05 on enp1s0
> > Type: inherit univ
> > Kernel.source: 9
> > Kernel.metric: 1024
> > Kernel.hoplimit: 64
> >
> > However the static route ends up being "unreachable":
> >
> > 2a0d:f302:114::/48   unreachable [static_export_kernel2 13:59:32.819] * 
> > (200)
> > Type: static univ
> >
> > Any ideas why this isn't working?
> >
> > Thanks,
> > --Daniel
> >
> > PS: The reason I have to create this static route when it's already covered
> > by the default route has to do with an esoteric policy routing setup and
> > multiple routing daemons ask for details at your own peril :)



Re: Recursive nexthop via kernel route in proto static not working

2023-06-27 Thread Alexander Zubkov via Bird-users
Hi,

Not sure, but I would guess it can be related to the local address. It
might try to pick the first interface with such network. Could you try
your setup with some route that has the nexthop from a unique subnet
configured on the interface? At least to check if it will become
reachable or not.
Or it might be that routes imported from the kernel are marked as
recursive, so it does not resolve because Bird does not allow double
recursion.

On Tue, Jun 27, 2023 at 4:22 PM Daniel Gröber  wrote:
>
> Hi,
>
> I'm trying to configure a static route that uses the system's default
> router. The default router is out of my control and is announced via IPv6
> RA. Since the MAC might not be stable I'd prefer not to hardcode the
> router's link-local address. So I tried:
>
> protocol static static_export_kernel2 {
> ipv6;
> igp table master6;
> route 2001:db8::/48 recursive ::;
> }
>
> The thinking being that :: ought to be resolvable through the default route
> imported from proto kernel:
>
> birdc show route for :: all
> Table master6:
> ::/0 unicast [kernel1 2023-03-22] * (10)
> via fe80::fc00:3ff:fec7:cd05 on enp1s0
> Type: inherit univ
> Kernel.source: 9
> Kernel.metric: 1024
> Kernel.hoplimit: 64
>
> However the static route ends up being "unreachable":
>
> 2a0d:f302:114::/48   unreachable [static_export_kernel2 13:59:32.819] * 
> (200)
> Type: static univ
>
> Any ideas why this isn't working?
>
> Thanks,
> --Daniel
>
> PS: The reason I have to create this static route when it's already covered
> by the default route has to do with an esoteric policy routing setup and
> multiple routing daemons ask for details at your own peril :)



Recursive nexthop via kernel route in proto static not working

2023-06-27 Thread Daniel Gröber
Hi,

I'm trying to configure a static route that uses the system's default
router. The default router is out of my control and is announced via IPv6
RA. Since the MAC might not be stable I'd prefer not to hardcode the
router's link-local address. So I tried:

protocol static static_export_kernel2 {
ipv6;
igp table master6;
route 2001:db8::/48 recursive ::;
}

The thinking being that :: ought to be resolvable through the default route
imported from proto kernel:

birdc show route for :: all
Table master6:
::/0 unicast [kernel1 2023-03-22] * (10)
via fe80::fc00:3ff:fec7:cd05 on enp1s0
Type: inherit univ
Kernel.source: 9
Kernel.metric: 1024
Kernel.hoplimit: 64

However the static route ends up being "unreachable":

2a0d:f302:114::/48   unreachable [static_export_kernel2 13:59:32.819] * 
(200)
Type: static univ

Any ideas why this isn't working?

Thanks,
--Daniel

PS: The reason I have to create this static route when it's already covered
by the default route has to do with an esoteric policy routing setup and
multiple routing daemons ask for details at your own peril :)