assistance with route tagging via OSPF on CN quagga 3.0


I'm currently trying to get a route tag installed on a route that quagga is announcing for OSPF.  However I cannot confirm that the tag is working as there is no output on the 'show ip route tag 1280' command.  see below

### CONFIG ### [root@server1 quagga]# cat zebra.conf; cat ospfd.conf ! ! Zebra configuration saved from vty ! 2009/06/07 09:49:00 ! hostname server1 log file /var/log/quagga/zebra.log ! password zebra enable password zebra ! interface eno16780032 ! ! interface lo ! line vty ! ! ospfd.conf file hostname server1 log file /var/log/quagga/ospfd.log debugging password zebra enable password zebra ! interface eno16780032 ip ospf authentication message-digest ip ospf message-digest-key 1 md5 ! interface lo ! ip prefix-list ANYCAST seq 10 permit 10.90.171.241/32 route-map BAR permit 10 match ip address prefix-list ANYCAST set tag 1280 ! router ospf ospf router-id 10.90.170.32 log-adjacency-changes redistribute connected route-map BAR network 10.90.170.0/24 area 0.0.0.0 network 10.90.171.240/28 area 0.0.0.0 area 0.0.0.0 authentication message-digest ! ### IP ADDRESSES ### [root@server1 quagga]# ip a 1: lo: mtu 65536 qdisc noqueue state UNKNOWN link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet 10.90.171.241/32 scope global lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: eno16780032: mtu 1500 qdisc mq state UP qlen 1000 link/ether 00:50:56🇦🇨47:72 brd ff:ff:ff:ff:ff:ff inet 10.90.170.32/24 brd 10.90.170.255 scope global eno16780032 valid_lft forever preferred_lft forever inet6 fe80::250:56ff:feac:4772/64 scope link valid_lft forever preferred_lft forever ### QUAGGA STATUS ### server1# show ip route Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF, I - IS-IS, B - BGP, T - Table, > - selected route, * - FIB route K>* 0.0.0.0/0 via 10.90.170.1, eno16780032 O 10.90.170.0/24 [110/10] is directly connected, eno16780032, 00:13:02 C>* 10.90.170.0/24 is directly connected, eno16780032 O 10.90.171.241/32 [110/0] is directly connected, lo, 00:13:02 C>* 10.90.171.241/32 is directly connected, lo server1# show ip ospf database OSPF Router with ID (10.90.170.32) Router Link States (Area 0.0.0.0) Link ID ADV Router Age Seq# CkSum Link count 10.90.170.32 10.90.170.32 642 0x800000b1 0x7e69 2 10.90.170.255 10.90.170.255 256 0x80000394 0x5904 1 Net Link States (Area 0.0.0.0) Link ID ADV Router Age Seq# CkSum 10.90.170.1 10.90.170.255 256 0x8000002e 0x7f30 server1# show ip ospf route ============ OSPF network routing table ============ N 10.90.170.0/24 [10] area: 0.0.0.0 directly attached to eno16780032 N 10.90.171.241/32 [0] area: 0.0.0.0 directly attached to lo ============ OSPF router routing table ============= R 10.90.170.255 [10] area: 0.0.0.0, ABR via 10.90.170.1, eno16780032 ============ OSPF external routing table =========== server1# show ip route tag 1280 server1# show ip route 10.90.171.241/32
Routing entry for 10.90.171.241/32
  Known via "ospf", distance 110, metric 0
  Last update 01:33:32 ago
    directly connected, lo
  
Routing entry for 10.90.171.241/32
  Known via "connected", distance 0, metric 0, best
  * directly connected, lo

2 replies

It appears that you're trying to set a tag on a redistributed connected that is also covered by a network statement. If this is what you're attempting, then I'm pretty sure this won't work. Route tags are only permitted on external LSAs and if a connected prefix is covered by a network statement, the external LSA is not created. If you noticed in the output above of "show ip ospf database", there aren't any external LSAs.

If you don't want peers across that interface and want it tagged, try removing the matching network statement and see if the external LSA is created and the tag applied.

Here's an example from a quick test here:

router ospf
ospf router-id 3.3.3.3
redistribute connected route-map BAR
redistribute static route-map FOO
network 172.16.1.0/24 area 0.0.0.0
!
ip prefix-list ANYCAST seq 20 permit 172.16.10.0/24
ip prefix-list STATIC seq 10 permit 11.11.11.11/32
!
route-map FOO permit 10
match ip address prefix-list STATIC
set tag 1100
!
route-map BAR permit 10
match ip address prefix-list ANYCAST
set tag 1280
!

And the show ip ospf database output:
cumulus# sh ip ospf data
OSPF Router with ID (3.3.3.3)

Router Link States (Area 0.0.0.0)

Link ID ADV Router Age Seq# CkSum Link count
1.1.1.1 1.1.1.1 737 0x80000025 0x43a8 5
3.3.3.3 3.3.3.3 1235 0x80000012 0xa9d9 2
4.4.4.4 4.4.4.4 320 0x8000041a 0x9042 4

Net Link States (Area 0.0.0.0)

Link ID ADV Router Age Seq# CkSum
172.16.2.4 4.4.4.4 330 0x8000002e 0xd570

AS External Link States

Link ID ADV Router Age Seq# CkSum Route
11.11.11.11 3.3.3.3 324 0x80000001 0x3e39 E2 11.11.11.11/32 [0x44c]
172.16.10.0 3.3.3.3 1235 0x80000002 0xb035 E2 172.16.10.0/24 [0x500]

Notice both external LSAs have tags applied (inside the square brackets).
AH ok so I had a correct implementation before it was just a mind-fart about what that show ip route tag meant.

Things make a lot more sense now. Thanks for the assist.

PS... i removed the
network 10.90.171.240/28 area 0.0.0.0
And now i see the route in the external LSA like I should have been expecting all along.

Reply