| 1 comments ]

Before configuring BGP, you need gather information about your network and peer. Basically, configuring BGP on Juniper router is the same with Cisco or another router. Basic configuration is just configure BGP session the advertise our network.

Step for configuring BGP on Juniper to external AS.
Configure the autonomous system number and router ID:
[edit routing-options]
admin@BorderA# set autonomous-system 65500
admin@BorderA# set router-id 192.168.16.1
To configure an EBGP session to the border router in the other AS:
[edit protocols bgp]
admin@BorderA# set group session-to-AS65505 type external
admin@BorderA# set group session-to-AS65505 peer-as 65505
admin@BorderA# set group session-to-AS65505 neighbor 10.0.31.1
[edit protocols]
admin@BorderA# show
bgp {
group session-to-AS65505 {
type external;
peer-as 65505;
neighbor 10.0.31.1;
}
}

If the peer in AS 65505 just one, you also can exclude peer-as group, so the configuration will be
[edit protocols bgp]
admin@BorderA# set group EXTERNAL-PEER type external
admin@BorderA# set group EXTERNAL-PEER peer-as 65505
admin@BorderA# set group EXTERNAL-PEER neighbor 10.0.31.1 peer-as 65505
[edit protocols]
admin@BorderA# show
bgp {
group EXTERNAL-PEER {
type external;
neighbor 10.0.31.1 {
peer-as 65505;

To IBGP on the border router and on all the routers within your AS. On each router, configure an IBGP group:
[edit protocols bgp]
admin@BorderA# set group TO-INTERNAL type internal
admin@BorderA# set group TO-INTERNAL local-address 192.168.16.1
admin@BorderA# set group TO-INTERNAL neighbor 192.168.15.1
admin@BorderA# set group TO-INTERNAL neighbor 192.168.17.1

Advertise IP address need that IP exist in IGP routing table.
The way to add the network that want to advertise if it is not exist in IGP routing table is using atomic aggregate.
[edit routing-options]
admin@BorderA#set aggregate route 192.168.1.0/24 as-path atomic-aggregate

Then you need configure filter so that your IP will be advertise,
admin@BorderA#set policy-options policy-statement TO-EXTERNAL from route-filter 192.168.1.0/24 exact accept

Apply this policy in BGP configuration,
[edit protocols bgp]
admin@BorderA# set group EXTERNAL-PEER export TO-EXTERNAL

Using Next-Hop Self
BGP will advertise to network that have valid next-hop. Next-hop usually coming from IGP routing table.
For the border router, that connect with internal router and external router, it is good useing next-hop-self for the following reason:
1. Sometime you don't redistribute connected interface to IGP routing protocol
2. For stability reason
With configure next-hop feature, the next-hop address of the external BGP routing when advertised to internal peer will be next-hop address inside internal AS.

Configure next-hop self in Juniper router with policy-options
[edit policy-options]
admin@BorderA# set policy-statement next-hop-self term 1 from protocol bgp
admin@BorderA# set policy-statement next-hop-self term 1 then next-hop self

Then apply the policy as an export policy in the IBGP group on the border router:
[edit protocols bgp]
admin@BorderA# set group TO-INTERNAL export next-hop-self

Using Peer Group
Peer group can reduce router resource consumption, and configuration effort.  Peer group is a group of neighbor with same policy.  See another my post about configuring peer group.

Filtering Routes
If a network is not a transit AS, it must filter bgp routes that advertised to it's private peer, so your private peers not use your AS as transit to internet.  You need to filter advertised routes so that only your local routing that advertised to your private peers.  If your are transit AS, you can advertise all internet routing to your customer.
Filtering BGP routes can be done by filtering prefixes and AS path.  Here are sample BGP filter using prefixes and AS path.

BGP Configuration
neighbor 192.168.1.1 {
    description PEER1;
    export TO-PEER1;                       #export policy refer to policy-option policy-statement TO-PEER1
    peer-as 65000;

Policy Configuration
policy-statement TO-PEER1 {
    term OUR-PREFIX {
        from as-path LOCAL-AS;                                               #only local AS that advertised    
        route-filter 192.168.0.0/20 upto /24;                                #only your IP That advertised
        then accept;
    }
    term INTERNET {
        then reject;                                                                       #reject all internet routing to advertised

AS Path Configuration
as-path LOCAL-AS "()";

1 comments

Gear Net Technologies said... @ September 1, 2022 at 8:16 PM

Gear Net Technologies is one of the leading providers of new and reconditioned Juniper network equipment. It provides deep network environment knowledge and a wide selection of Juniper Router Accessories.

Post a Comment