Large BGP Communities

Examples

This page lists several configuration and output examples for implementations that support BGP Large Communities.

Juniper Junos Configuration

user@junos# show policy-options community large_community01
members large:15562:1:2

# match
user@junos# show policy-options policy-statement match_large
term 10
    from {
        protocol bgp;
        community large_community01;
    }
    then accept;
}

# scrub / delete
user@junos# show policy-options policy-statement delete_large
term 10
    from community large_community01;
    then {
        community delete large_community01;
        accept;
    }
}

# set
user@junos# show policy-options policy-statement set_large
term 10
    from protocol bgp;
    then {
        community add large_community01;
        accept;
    }
}

BIRD Configuration

# match
if ((15562, 1, 2) ~ bgp_large_community) then return true;

# scrub / delete
bgp_large_community.delete([(15562, *, *)]);
bgp_large_community.delete([(15562, 0, 1)]);

# set
bgp_large_community.add((15562, 0, 100));
bgp_large_community.add([(15562, 0, 100), (15562, 2, 333)]);

Cisco IOS XR Configuration

# match
route-policy set-something
  if large-community matches-any (15562:4:3) then
    set local-preference 120
  endif
end-policy

# scrub / delete
route-policy set-something
  delete large-community in (15562:*:*)
  delete large-community in (15562:4:3)
end-policy

# set
route-policy set-something
  set large-community (15562:45:29) additive
end-policy

Nokia SR OS Configuration (Classic CLI)

policy-options
    community "set" members "15562:45:29"
    community "match" members "15562:4:3"
    community "delete" members "15562:4:3"
    policy-statement "set-something"
        entry 10              
            description "match"
            from              
                community "match"
            exit              
            action accept     
                local-preference 120
            exit              
        exit                  
        entry 20              
            description "scrub / delete"
            action accept     
                community remove "delete"
            exit              
        exit                  
        entry 30              
            description "set" 
            action accept     
                community add "set"
            exit              
        exit                  
    exit                      
exit 

Nokia SR OS Configuration (MD-CLI)

policy-options {
    community "delete" {
        member "15562:4:3" { }
    }
    community "match" {
        member "15562:4:3" { }
    }
    community "set" {
        member "15562:45:29" { }
    }
    policy-statement "set-something" {
        entry 10 {
            description "match"
            action {
                action-type accept
                local-preference "120"
            }
            from {
                community {
                    name "match"
                }
            }
        }
        entry 20 {
            description "scrub / delete"
            action {
                action-type accept
                community {
                    remove ["delete"]
                }
            }
        }
        entry 30 {
            description "set"
            action {
                action-type accept
                community {
                    add ["set"]
                }
            }
        }
    }
}

OpenBGPD Configuration

# match
allow from any large-community 15562:1:2
match from any large-community 15562:1:2 set localpref 300
deny to any peer-as neighbor-as large-community 15562:6:neighbor-as

# scrub / delete
match from any set { large-community delete 15562:*:* }
match from any set { large-community delete 15562:1:2 }

# set
match from any set { large-community 15562:1:2 }
match from any set { large-community 15562:1:2 large-community 15562:4034:24824 }

tcpdump 4.9.0 Packet Capture

# ./tcpdump -i eth3 -n -v -c 1 src port 179
tcpdump: listening on eth3, link-type EN10MB (Ethernet), capture size 262144 bytes
16:22:08.992920 IP (tos 0xc0, ttl 64, id 41807, offset 0, flags [DF], proto TCP (6), length 181)
 94.142.247.3.179 > 94.142.247.6.33785: Flags [P.], cksum 0xabce (incorrect -> 0x1e40), seq 58743671:58743800, ack 2012368616, win 2270, options [nop,nop,TS val 857977378 ecr 149127175], length 129: BGP
	Update Message (2), length: 129
	  Origin (1), length: 1, Flags [T]: IGP
	  AS Path (2), length: 34, Flags [T]: 38930 1299 3910 721 27065 1554 1555 1501
	  Next Hop (3), length: 4, Flags [T]: 94.142.247.3
	  Multi Exit Discriminator (4), length: 4, Flags [O]: 0
	  Local Preference (5), length: 4, Flags [T]: 100
	  Atomic Aggregate (6), length: 0, Flags [T]:
	  Aggregator (7), length: 8, Flags [OT]:  AS #1501, origin 144.105.202.0
	  Community (8), length: 8, Flags [OT]: 1299:20000, 15562:14
	  Large Community (32), length: 12, Flags [OTP]:
	    15562:6:14
	  Updated routes:
	    136.210.249.0/24

Wireshark 2.3.0 (Prerelease) Packet Capture:

Wireshark Packet Capture