Professional Documents
Culture Documents
Local Preference
AS Path
Origin
MED
A
EBGP
B 172.17.2.0/24
ISP C 192.168.27.0/24
ISP B ISP D
1 GE 10 GE
ISP A
IBGP
R1 R2
ISP C 192.168.27.0/24
ISP B ISP D
1 GE 10 GE
ISP A
IBGP
R1 R2
OC3 OC3
ISP E
172.17/16
R1
172.17/16
172.17/16
LP = 1000
LP = 1000
R3
172.17/16
R2 LP = 1000
172.17/16
172.17/16 R1 172.17/16
LP = 1000
172.17/16
LP = 1000
R3
172.17/16
R2 LP = 1000
172.17/16
AS 1
R2
AS 65000
AS2
R1
© 2012 Juniper Networks, Inc. All rights reserved. www.juniper.net | 17
No-Export-Subconfed
Routes go no farther than the sub-AS
AS 1
R3 R4
AS 65000
R2
AS2
R1
© 2012 Juniper Networks, Inc. All rights reserved. www.juniper.net | 18
No-Export
Routes go no farther than the entire AS
AS 1
R7
R6
R3 R4
R5
AS 65000
R2
AS2
R1
© 2012 Juniper Networks, Inc. All rights reserved. www.juniper.net | 19
Example Using No-Export
172.17.0/17
Internet
172.17/16
172.17.128/17
172.17/16
172.17.128/17 (No-export)
Internet
172.17/16
172.31/16
172.17/16 172.31/16
172.17/16 172.31/16
R2 R3
172.17/16 172.17.144/20
172.17.144/20 172.31/16
AS 1 AS 2
Customer
172.17.144/20 AS 20 172.17.144/20 (No-Export)
R1
172.17.144/20
R2 172.17/16 172.20/16 R3
Customer
AS 1 AS 20 AS 2
172.17.64/18 172.17/16 2:70
172.20/16 1:60 172.17.64/18
R1
172.20.128/18 172.17.64/18 172.20.128/18
172.20.128/18
1:60 = Local preference of 60 2:70 = Local preference of 70
National #1 routes: NO
Small ISP’s local routes: YES
National #1 routes
National #1 routes
R2 Small ISP
R1 Small ISP’s local routes
Small ISP needs to advertise its own routes, but never be transit AS!
© 2012 Juniper Networks, Inc. All rights reserved. www.juniper.net | 24
Configuring a BGP Community
Configure at [edit policy-options] hierarchy level
• Multiple community-ids mean a logical AND
[edit policy-options]
community name members community-ids;
Community ID format:
• as-number:community-value
• Community ID can also be:
• no-export
• no-advertise
• no-export-subconfed
Use in a policy as a match condition or an action
• Actions include add, delete, and set
[edit policy-options]
policy-statement community-actions {
term add-a-community
then community add test-comm;
}
}
community test-comm members 65001:1234;
[edit policy-options]
policy-statement community-actions {
term add-a-community
then community delete test-comm;
}
}
community test-comm members 64512:567;
[edit policy-options]
policy-statement community-actions {
term add-a-community
then community set test-comm;
}
}
community test-comm members 65001:1234;
[edit policy-options]
community customers members [56:2379 23:46944];
policy-statement from-customers { Export policy
from community customers;
then {
metric 20;
local-preference 200;
next policy;
[edit protocols bgp]
} group my-group {
} export from-customers;
neighbor 200.200.1.1;
}
policy-options {
community community-1 members 1:20;
}
Community pattern
Regex: Matches:
to match:
AS is 56 or 78 “^((56)|(78)):(.*)$” 56:1000,
78:65000
AS is 56 and value starts with a 2 “^56:(2.*)$” 56:234, 56:2,
56:222
AS can be anything and value ends “^(.*):(.*[579])$” 1234:5,
with either a 5, 7, or 9 78:2357,
34:65005
AS is 56 or 78, value starts with a “^((56)|(78)):(2.*[2-8])$” 56:22,
2 and ends with any value between 56:21197,
2 and 8 78:2678
"^((105)|(207)|(309)):((1.{3,4})|([256].*)|
(.*[3479]))$"