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 <TRACE> device1: Initializing
2020-08-21 05:57:43 <TRACE> kernel4: Channel ipv4 connected
to table t_kernel4
2020-08-21 05:57:43 <TRACE> kernel4: Initializing
2020-08-21 05:57:43 <TRACE> kernel6: Channel ipv6 connected
to table t_kernel6
2020-08-21 05:57:43 <TRACE> kernel6: Initializing
2020-08-21 05:57:43 <TRACE> p_master4_to_kernel4: Channel
pri connected to table master4
2020-08-21 05:57:43 <TRACE> p_master4_to_kernel4: Channel
sec connected to table t_kernel4
2020-08-21 05:57:43 <TRACE> p_master4_to_kernel4:
Initializing
2020-08-21 05:57:43 <TRACE> p_master6_to_kernel6: Channel
pri connected to table master6
2020-08-21 05:57:43 <TRACE> p_master6_to_kernel6: Channel
sec connected to table t_kernel6
2020-08-21 05:57:43 <TRACE> p_master6_to_kernel6:
Initializing
2020-08-21 05:57:43 <TRACE> static4: Channel ipv4 connected
to table t_static4
2020-08-21 05:57:43 <TRACE> static4: Initializing
2020-08-21 05:57:43 <TRACE> static6: Channel ipv6 connected
to table t_static6
2020-08-21 05:57:43 <TRACE> static6: Initializing
2020-08-21 05:57:43 <TRACE> p_static4_to_master4: Channel
pri connected to table t_static4
2020-08-21 05:57:43 <TRACE> p_static4_to_master4: Channel
sec connected to table master4
2020-08-21 05:57:43 <TRACE> p_static4_to_master4:
Initializing
2020-08-21 05:57:43 <TRACE> p_static6_to_master6: Channel
pri connected to table t_static6
2020-08-21 05:57:43 <TRACE> p_static6_to_master6: Channel
sec connected to table master6
2020-08-21 05:57:43 <TRACE> p_static6_to_master6:
Initializing
2020-08-21 05:57:43 <TRACE> rip4: Channel ipv4 connected to
table t_rip4
2020-08-21 05:57:43 <TRACE> rip4: Initializing
2020-08-21 05:57:43 <TRACE> rip6: Channel ipv6 connected to
table t_rip6
2020-08-21 05:57:43 <TRACE> rip6: Initializing
2020-08-21 05:57:43 <TRACE> p_rip4_to_master4: Channel pri
connected to table t_rip4
2020-08-21 05:57:43 <TRACE> p_rip4_to_master4: Channel sec
connected to table master4
2020-08-21 05:57:43 <TRACE> p_rip4_to_master4: Initializing
2020-08-21 05:57:43 <TRACE> p_rip6_to_master6: Channel pri
connected to table t_rip6
2020-08-21 05:57:43 <TRACE> p_rip6_to_master6: Channel sec
connected to table master6
2020-08-21 05:57:43 <TRACE> p_rip6_to_master6: Initializing
2020-08-21 05:57:43 <TRACE> device1: Starting
2020-08-21 05:57:43 <TRACE> device1: Scanning interfaces
2020-08-21 05:57:43 <TRACE> device1: State changed to up
2020-08-21 05:57:43 <TRACE> kernel4: Starting
2020-08-21 05:57:43 <TRACE> kernel4: State changed to up
2020-08-21 05:57:43 <TRACE> kernel6: Starting
2020-08-21 05:57:43 <TRACE> kernel6: State changed to up
2020-08-21 05:57:43 <TRACE> p_master4_to_kernel4: Starting
2020-08-21 05:57:43 <TRACE> p_master4_to_kernel4: State
changed to up
2020-08-21 05:57:43 <TRACE> p_master6_to_kernel6: Starting
2020-08-21 05:57:43 <TRACE> p_master6_to_kernel6: State
changed to up
2020-08-21 05:57:43 <TRACE> static4: Starting
2020-08-21 05:57:43 <TRACE> static4: State changed to up
2020-08-21 05:57:43 <TRACE> static4 > added [best]
192.168.20.0/24 unicast
2020-08-21 05:57:43 <TRACE> static6: Starting
2020-08-21 05:57:43 <TRACE> static6: State changed to up
2020-08-21 05:57:43 <TRACE> static6 > added [best]
fc20::/64 unicast
2020-08-21 05:57:43 <TRACE> p_static4_to_master4: Starting
2020-08-21 05:57:43 <TRACE> p_static4_to_master4: State
changed to up
2020-08-21 05:57:43 <TRACE> p_static6_to_master6: Starting
2020-08-21 05:57:43 <TRACE> p_static6_to_master6: State
changed to up
2020-08-21 05:57:43 <TRACE> rip4: Starting
2020-08-21 05:57:43 <TRACE> rip4: State changed to up
2020-08-21 05:57:43 <TRACE> rip6: Starting
2020-08-21 05:57:43 <TRACE> rip6: State changed to up
2020-08-21 05:57:43 <TRACE> p_rip4_to_master4: Starting
2020-08-21 05:57:43 <TRACE> p_rip4_to_master4: State changed
to up
2020-08-21 05:57:43 <TRACE> p_rip6_to_master6: Starting
2020-08-21 05:57:43 <TRACE> p_rip6_to_master6: State changed
to up
2020-08-21 05:57:43 <INFO> Started
2020-08-21 05:57:43 <TRACE> kernel4 < interface lo goes
up
2020-08-21 05:57:43 <TRACE> kernel4 < interface eth0 goes
up
2020-08-21 05:57:43 <TRACE> kernel4 < interface eth1 goes
up
2020-08-21 05:57:43 <TRACE> kernel6 < interface lo goes
up
2020-08-21 05:57:43 <TRACE> kernel6 < interface eth0 goes
up
2020-08-21 05:57:43 <TRACE> kernel6 < interface eth1 goes
up
2020-08-21 05:57:43 <TRACE> p_static4_to_master4 < added
192.168.20.0/24 unicast
2020-08-21 05:57:43 <TRACE> p_static4_to_master4 > added
[best] 192.168.20.0/24 unicast
2020-08-21 05:57:43 <TRACE> p_master4_to_kernel4 < added
192.168.20.0/24 unicast
2020-08-21 05:57:43 <TRACE> p_master4_to_kernel4 > added
[best] 192.168.20.0/24 unicast
2020-08-21 05:57:43 <TRACE> p_master4_to_kernel4 <
rejected by protocol 192.168.20.0/24 unicast
2020-08-21 05:57:43 <TRACE> kernel4 < added
192.168.20.0/24 unicast
2020-08-21 05:57:43 <TRACE> p_static4_to_master4 <
rejected by protocol 192.168.20.0/24 unicast
2020-08-21 05:57:43 <INFO> rip to master
2020-08-21 05:57:43 <INFO> (enum 30)1
2020-08-21 05:57:43 <TRACE> p_rip4_to_master4 < filtered
out 192.168.20.0/24 unicast
2020-08-21 05:57:43 <TRACE> p_static4_to_master4 <
rejected by protocol 192.168.20.0/24 unicast
2020-08-21 05:57:43 <TRACE> p_static6_to_master6 < added
fc20::/64 unicast
2020-08-21 05:57:43 <TRACE> p_static6_to_master6 > added
[best] fc20::/64 unicast
2020-08-21 05:57:43 <TRACE> p_master6_to_kernel6 < added
fc20::/64 unicast
2020-08-21 05:57:43 <TRACE> p_master6_to_kernel6 > added
[best] fc20::/64 unicast
2020-08-21 05:57:43 <TRACE> p_master6_to_kernel6 <
rejected by protocol fc20::/64 unicast
2020-08-21 05:57:43 <TRACE> kernel6 < added fc20::/64
unicast
2020-08-21 05:57:43 <TRACE> p_static6_to_master6 <
rejected by protocol fc20::/64 unicast
2020-08-21 05:57:43 <INFO> rip to master
2020-08-21 05:57:43 <INFO> (enum 30)1
2020-08-21 05:57:43 <TRACE> p_rip6_to_master6 < filtered
out fc20::/64 unicast
2020-08-21 05:57:43 <TRACE> p_static6_to_master6 <
rejected by protocol fc20::/64 unicast
2020-08-21 05:57:43 <TRACE> rip4 < interface lo goes up
2020-08-21 05:57:43 <TRACE> rip4 < interface eth0 goes up
2020-08-21 05:57:43 <TRACE> rip4: Adding interface eth0
2020-08-21 05:57:43 <TRACE> rip4 < interface eth1 goes up
2020-08-21 05:57:43 <TRACE> rip6 < interface lo goes up
2020-08-21 05:57:43 <TRACE> rip6 < interface eth0 goes up
2020-08-21 05:57:43 <TRACE> rip6: Adding interface eth0
2020-08-21 05:57:43 <TRACE> rip6 < interface eth1 goes up
2020-08-21 05:57:43 <INFO> rip to master
2020-08-21 05:57:43 <INFO> (enum 30)1
2020-08-21 05:57:43 <TRACE> p_rip4_to_master4 < filtered
out 192.168.20.0/24 unicast
2020-08-21 05:57:43 <INFO> rip to master
2020-08-21 05:57:43 <INFO> (enum 30)1
2020-08-21 05:57:43 <TRACE> p_rip6_to_master6 < filtered
out fc20::/64 unicast
2020-08-21 05:57:43 <TRACE> kernel4: Scanning routing table
2020-08-21 05:57:43 <TRACE> kernel4: Pruning table t_kernel4
2020-08-21 05:57:43 <TRACE> kernel4: Pruning inherited
routes
2020-08-21 05:57:43 <TRACE> kernel6: Pruning table t_kernel6
2020-08-21 05:57:43 <TRACE> kernel6: Pruning inherited
routes
2020-08-21 05:57:43 <TRACE> rip6: Starting interface eth0
2020-08-21 05:57:43 <TRACE> rip4: Starting interface eth0
2020-08-21 05:57:43 <TRACE> rip4: Interface timer fired for
eth0
2020-08-21 05:57:43 <TRACE> rip4: Sending triggered updates
for eth0
2020-08-21 05:57:43 <TRACE> rip6: Interface timer fired for
eth0
2020-08-21 05:57:43 <TRACE> rip6: Sending triggered updates
for eth0
2020-08-21 05:57:45 <TRACE> rip4: Interface timer fired for
eth0
2020-08-21 05:57:45 <TRACE> rip4: Sending regular updates
for eth0
2020-08-21 05:57:46 <TRACE> rip6: Interface timer fired for
eth0
2020-08-21 05:57:46 <TRACE> rip6: Sending regular updates
for eth0
2020-08-21 05:57:50 <TRACE> rip4: Interface timer fired for
eth0
2020-08-21 05:57:50 <TRACE> rip4: Sending regular updates
for eth0