Re: RTS_STATIC_DEVICE oddity

2020-08-22 Thread Nigel Kukard


On 2020-08-22 17:02, Ondrej Zajicek wrote:
> On Fri, Aug 21, 2020 at 06:23:57AM +, Nigel Kukard wrote:
>> Hi guys,
>>
>> I may be going blind or just dumb, but I could of sworn this worked like
>> a year ago in v2.
>>
>> I have a t_static4 table, with a static device route, I pipe this to my
>> master4 table, then pipe my master4 table to RIP and only pick out the
>> RTS_STATIC_DEVICE routes.
> Hi
>
> RTS_STATIC_DEVICE was removed in BIRD 2 (we probably forgot it in
> documentation and parser, so it does not generate errors).
>
> It does not make sense as one can have ECMP route with one direct
> (device) and one indirect (gateway) nexthop.

Thanks Ondrej,

I checked over the code today and found no use of RTS_STATIC_DEVICE, I
then checked where RTS_STATIC was used and saw the nexthop code, so I
was bordering the same conclusion.

Thanks again for clarifying, much appreciated.

-N



Re: RTS_STATIC_DEVICE oddity

2020-08-22 Thread Ondrej Zajicek
On Fri, Aug 21, 2020 at 06:23:57AM +, Nigel Kukard wrote:
> Hi guys,
> 
> I may be going blind or just dumb, but I could of sworn this worked like
> a year ago in v2.
> 
> I have a t_static4 table, with a static device route, I pipe this to my
> master4 table, then pipe my master4 table to RIP and only pick out the
> RTS_STATIC_DEVICE routes.

Hi

RTS_STATIC_DEVICE was removed in BIRD 2 (we probably forgot it in
documentation and parser, so it does not generate errors).

It does not make sense as one can have ECMP route with one direct
(device) and one indirect (gateway) nexthop.

-- 
Elen sila lumenn' omentielvo

Ondrej 'Santiago' Zajicek (email: santi...@crfreenet.org)
OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net)
"To err is human -- to blame it on a computer is even more so."


RTS_STATIC_DEVICE oddity

2020-08-21 Thread Nigel Kukard
Hi guys,

I may be going blind or just dumb, but I could of sworn this worked like
a year ago in v2.

I have a t_static4 table, with a static device route, I pipe this to my
master4 table, then pipe my master4 table to RIP and only pick out the
RTS_STATIC_DEVICE routes.

However the source is set to RTS_STATIC not RTS_STATIC_DEVICE?  enum(30)1

Full config file attached. I tried to summarize it a bit below. I also
attached a diagram.svg of the r1 setup below.

-N



ipv4 table t_static4;

protocol static static4 {
    ipv4 {
    table t_static4;
    export none;
    import all;
    };
*    route 192.168.20.0/24 via "eth1";*
};

protocol pipe p_static4_to_master4 {
    table t_static4;
    peer table master4;

    export all;
    import none;
};

ipv4 table t_rip4;

filter f_rip_export4 {
    # Redistribute static device routes
    if (source = RTS_STATIC_DEVICE) then {
    accept;
    }
    # Redistribute RIP routes
    if (source = RTS_RIP) then {
    accept;
    }
    reject;
};

filter f_rip_import4 {
    # Import all RIP routes by default
    accept;
};

filter f_rip_master4_export {
    # Do not export default route to master
    if (net = 0.0.0.0/0) then {
    reject;
    }
    # Only export RIP routes o the master table
    if (source = RTS_RIP) then {
    accept;
    }
    # Reject everything else;
    reject;
};

filter f_rip_master4_import {
    print "rip to master";
    print source;
*    # Import static device routes into RIP (redistribute static_device)
    if (source = RTS_STATIC_DEVICE) then {
    accept;
    }*
    reject;
};

protocol rip rip4 {
    description "RIP protocol for IPv4";

    ipv4 {
    table t_rip4;

    export filter f_rip_export4;
    import filter f_rip_import4;

    };

    interface "eth0" {
    update time 5;
    metric 2;
    };
};


Here is the result  (sorry its in JSON)...


-
RIP4(r1)
--
{}

STATIC4(r1)

{'192.168.20.0/24': [{'nexthops': [{'interface': 'eth1'}],
  'pref': '200',
  'prefix_type': 'unicast',
  'protocol': 'static4',
  'since': '2020-08-21 05:57:43',
  'type': ['static', 'univ']}]}

MASTER4(r1)

{'192.168.20.0/24': [{'nexthops': [{'interface': 'eth1'}],
  'pref': '200',
  'prefix_type': 'unicast',
  'protocol': 'static4',
  'since': '2020-08-21 05:57:43',
  'type': ['static', 'univ']}]}

KERNEL4(r1)

{'192.168.20.0/24': [{'nexthops': [{'interface': 'eth1'}],
  'pref': '200',
  'prefix_type': 'unicast',
  'protocol': 'static4',
  'since': '2020-08-21 05:57:43',
  'type': ['static', 'univ']}]}

And the full log...


LOGFILE(r1)

2020-08-21 05:57:43  device1: Initializing
2020-08-21 05:57:43  kernel4: Channel ipv4 connected to table
t_kernel4
2020-08-21 05:57:43  kernel4: Initializing
2020-08-21 05:57:43  kernel6: Channel ipv6 connected to table
t_kernel6
2020-08-21 05:57:43  kernel6: Initializing
2020-08-21 05:57:43  p_master4_to_kernel4: Channel pri connected
to table master4
2020-08-21 05:57:43  p_master4_to_kernel4: Channel sec connected
to table t_kernel4
2020-08-21 05:57:43  p_master4_to_kernel4: Initializing
2020-08-21 05:57:43  p_master6_to_kernel6: Channel pri connected
to table master6
2020-08-21 05:57:43  p_master6_to_kernel6: Channel sec connected
to table t_kernel6
2020-08-21 05:57:43  p_master6_to_kernel6: Initializing
2020-08-21 05:57:43  static4: Channel ipv4 connected to table
t_static4
2020-08-21 05:57:43  static4: Initializing
2020-08-21 05:57:43  static6: Channel ipv6 connected to table
t_static6
2020-08-21 05:57:43  static6: Initializing
2020-08-21 05:57:43  p_static4_to_master4: Channel pri connected
to table