TTR Networks

Intermediate · BGP communities, prepending and RTBH · section 2 of 6

Tag on the way in

✓ Lab-tested 18 October 2026 on VyOS 2026.10.16-0024-rolling, FRR 10.2.1

With two transits, R1 receives every route twice. Start by recording where each route came from, as it arrives: an import route-map per transit that adds a large community, 64500:100:1 for transit A and 64500:100:2 for transit B.

On a single router that looks like a formality. Its value shows up as soon as there's more than one router, or more than one policy:

  • Other routers in your AS (over iBGP) can act on the tag: prefer one transit for some destinations, send only certain routes to certain customers, report on traffic by source.
  • Export policy can match on tags instead of long prefix lists: "send customers everything tagged from transit", "never send routes tagged from peering to another peer".
  • Troubleshooting gets easier: show bgp ipv4 large-community 64500:100:1 lists exactly what came from transit A.

Tag on import, act on tags everywhere else. That's the pattern almost every network converges on.

R1: a tag per transit
set policy route-map TRANSIT-A-IN rule 10 action 'permit'
set policy route-map TRANSIT-A-IN rule 10 set large-community add '64500:100:1'
set policy route-map TRANSIT-B-IN rule 10 action 'permit'
set policy route-map TRANSIT-B-IN rule 10 set large-community add '64500:100:2'
set protocols bgp neighbor 203.0.113.0 address-family ipv4-unicast route-map import 'TRANSIT-A-IN'
set protocols bgp neighbor 203.0.113.2 address-family ipv4-unicast route-map import 'TRANSIT-B-IN'
  • Lines 1–2: Everything from transit A gets 64500:100:1.
  • Lines 3–4: Everything from transit B gets 64500:100:2.
  • Lines 5–6: Applied on import.
Tagged routes (real output)
vyos@R1:~$ show bgp ipv4 203.0.113.128/25
BGP routing table entry for 203.0.113.128/25, version 7
Paths: (2 available, best #1, table default)
  Not advertised to any peer
  64496 64511
    203.0.113.0 from 203.0.113.0 (203.0.113.0)
      Origin IGP, valid, external, best (Router ID)
      Large Community: 64500:100:1
      Last update: Sat Oct 17 13:34:53 2026
  64497 64511
    203.0.113.2 from 203.0.113.2 (203.0.113.2)
      Origin IGP, valid, external
      Large Community: 64500:100:2
      Last update: Sat Oct 17 13:34:53 2026
vyos@R1:~$ show bgp ipv4 large-community 64500:100:1
BGP table version is 7, local router ID is 198.51.100.1, vrf id 0
Default local pref 100, local AS 64500
Status codes:  s suppressed, d damped, h history, u unsorted, * valid, > best, = multipath,
               i internal, r RIB-failure, S Stale, R Removed
Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self
Origin codes:  i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop            Metric LocPrf Weight Path
 *>  0.0.0.0/0        203.0.113.0              0             0 64496 i
 *>  203.0.113.128/25 203.0.113.0                            0 64496 64511 i

Displayed 2 routes and 5 total paths
  • Line 8: Learnt from transit A…
  • Line 13: …and from transit B.
  • Lines 15–26: Everything tagged as from transit A.