You are on page 1of 19

1 IPv4 Routing with Juniper

Topology:

Configuration:
In JR1:

set system host-name JR1


set system root-authentication plain-text-password
New password: *********
Retype new password: *********

set interfaces em0 unit 0 description ***Connected-To-JR2***


set interfaces em0 unit 0 family inet address 172.16.10.2/30
set interfaces em1 unit 0 description ***Connected-To-r13-CAR1***
set interfaces em1 unit 0 family inet address 172.16.11.1/30
set interfaces em2 unit 0 description ***Connected-To-JR3***
set interfaces em2 unit 0 family inet address 172.16.10.9/30
set interfaces lo0 unit 0 description ***JR1-Loopback***
set interfaces lo0 unit 0 family inet address 172.16.15.1/32

OSPF:

set protocols ospf area 0.0.0.1 interface em0.0 interface-type p2p


set protocols ospf area 0.0.0.1 interface em2.0 interface-type p2p
set protocols ospf area 0.0.0.1 interface lo0.0 passive

iBGP:

Prepared By Md. Belal Hossain


2 IPv4 Routing with Juniper

set routing-options static route 172.16.11.0/27 discard


set routing-options router-id 172.16.15.1
set routing-options autonomous-system 17821

set protocols bgp group IPV4-iBGP-REG1 type internal


set protocols bgp group IPV4-iBGP-REG1 neighbor 172.16.15.2 description ***JR1-JR2***
set protocols bgp group IPV4-iBGP-REG1 neighbor 172.16.15.2 local-address 172.16.15.1
set protocols bgp group IPV4-iBGP-REG1 neighbor 172.16.15.2 import JR1-Prefix-IN
set protocols bgp group IPV4-iBGP-REG1 neighbor 172.16.15.2 export JR1-Prefix-OUT
set protocols bgp group IPV4-iBGP-REG1 neighbor 172.16.15.2 peer-as 17821
set protocols bgp group IPV4-iBGP-REG1 neighbor 172.16.15.3 description ***JR1-JR3***
set protocols bgp group IPV4-iBGP-REG1 neighbor 172.16.15.3 local-address 172.16.15.1
set protocols bgp group IPV4-iBGP-REG1 neighbor 172.16.15.3 import JR1-Prefix-IN
set protocols bgp group IPV4-iBGP-REG1 neighbor 172.16.15.3 export JR1-Prefix-OUT
set protocols bgp group IPV4-iBGP-REG1 neighbor 172.16.15.3 peer-as 17821

set policy-options policy-statement JR1-Prefix-IN term 1 then accept


set policy-options policy-statement JR1-Prefix-IN term 100 then reject

set policy-options policy-statement JR1-Prefix-OUT term 1 then accept


set policy-options policy-statement JR1-Prefix-OUT term 100 then reject

eBGP:

set protocols bgp group IPV4-eBGP-CUSTOMER-REG1-POP1 type external


set protocols bgp group IPV4-eBGP-CUSTOMER-REG1-POP1 neighbor 172.16.11.2 description ***r13-CAR1***
set protocols bgp group IPV4-eBGP-CUSTOMER-REG1-POP1 neighbor 172.16.11.2 local-address 172.16.11.1
set protocols bgp group IPV4-eBGP-CUSTOMER-REG1-POP1 neighbor 172.16.11.2 import r13-CAR1-Prefix-IN
set protocols bgp group IPV4-eBGP-CUSTOMER-REG1-POP1 neighbor 172.16.11.2 export default-only
set protocols bgp group IPV4-eBGP-CUSTOMER-REG1-POP1 neighbor 172.16.11.2 peer-as 65001

set policy-options policy-statement default-only term default-route from route-filter 0.0.0.0/0 exact
set policy-options policy-statement default-only term default-route then accept
set policy-options policy-statement default-only term reject-all-other-routes then reject
set policy-options policy-statement r13-CAR1-Prefix-IN term 1 from route-filter 172.16.16.0/23 upto /24
set policy-options policy-statement r13-CAR1-Prefix-IN term 1 then accept
set policy-options policy-statement r13-CAR1-Prefix-IN term 100 then reject

set protocols bgp group IPV4-iBGP-REG1 export next-hop-self


set policy-options policy-statement next-hop-self term se-nh then next-hop self

In JR2:

set system host-name JR2


set system root-authentication plain-text-password
New password: *********
Retype new password: *********

set interfaces em0 unit 0 description ***Connected-To-JR1***


set interfaces em0 unit 0 family inet address 172.16.10.1/30
set interfaces em1 unit 0 description ***Connected-To-JR3***
set interfaces em1 unit 0 family inet address 172.16.10.5/30
set interfaces em2 unit 0 description ***Connected-To-SW1***
set interfaces em2 unit 0 family inet address 172.16.12.2/24
set interfaces em3 unit 0 description ***Connected-To-SW2***

Prepared By Md. Belal Hossain


3 IPv4 Routing with Juniper

set interfaces em3 unit 0 family inet address 172.16.13.2/24


set interfaces em4 unit 0 description ***Connected-To-PC-1***
set interfaces em4 unit 0 family inet address 172.16.0.1/24
set interfaces lo0 unit 0 description ***JR2-Loopback***
set interfaces lo0 unit 0 family inet address 172.16.15.2/32

OSPF:

set protocols ospf area 0.0.0.0 interface em2.0


set protocols ospf area 0.0.0.0 interface em3.0
set protocols ospf area 0.0.0.0 interface lo0.0 passive
set protocols ospf area 0.0.0.1 interface em0.0 interface-type p2p
set protocols ospf area 0.0.0.1 interface em1.0 interface-type p2p

iBGP:

set routing-options static route 172.16.0.0/24 discard


set routing-options static route 172.16.1.0/24 discard
set routing-options router-id 172.16.15.2
set routing-options autonomous-system 17821
set protocols bgp group IPV4-iBGP-REG1 type internal
set protocols bgp group IPV4-iBGP-REG1 neighbor 172.16.15.1 description ***JR2-JR1***
set protocols bgp group IPV4-iBGP-REG1 neighbor 172.16.15.1 local-address 172.16.15.2
set protocols bgp group IPV4-iBGP-REG1 neighbor 172.16.15.1 export JR2-Prefix-OUT
set protocols bgp group IPV4-iBGP-REG1 neighbor 172.16.15.1 peer-as 17821
set protocols bgp group IPV4-iBGP-REG1 neighbor 172.16.15.3 description ***JR2-JR3***
set protocols bgp group IPV4-iBGP-REG1 neighbor 172.16.15.3 local-address 172.16.15.2
set protocols bgp group IPV4-iBGP-REG1 neighbor 172.16.15.3 export JR2-Prefix-OUT
set protocols bgp group IPV4-iBGP-REG1 neighbor 172.16.15.3 peer-as 17821

set policy-options policy-statement JR2-Prefix-OUT term 1 then accept


set policy-options policy-statement JR2-Prefix-OUT term 100 then reject

set protocols bgp group IPV4-iBGP-REG1 cluster 172.16.15.2

set protocols bgp group IPV4-iBGP-TRCORE type internal


set protocols bgp group IPV4-iBGP-TRCORE neighbor 172.16.15.5 description ***JR2-JR5***
set protocols bgp group IPV4-iBGP-TRCORE neighbor 172.16.15.5 local-address 172.16.15.2
set protocols bgp group IPV4-iBGP-TRCORE neighbor 172.16.15.5 export REG1-Prefix-OUT
set protocols bgp group IPV4-iBGP-TRCORE neighbor 172.16.15.5 peer-as 17821
set protocols bgp group IPV4-iBGP-TRCORE neighbor 172.16.15.8 description ***JR2-JR8***
set protocols bgp group IPV4-iBGP-TRCORE neighbor 172.16.15.8 local-address 172.16.15.2
set protocols bgp group IPV4-iBGP-TRCORE neighbor 172.16.15.8 export REG1-Prefix-OUT
set protocols bgp group IPV4-iBGP-TRCORE neighbor 172.16.15.8 peer-as 17821
set protocols bgp group IPV4-iBGP-TRCORE neighbor 172.16.15.11 description ***JR2-JR11***
set protocols bgp group IPV4-iBGP-TRCORE neighbor 172.16.15.11 local-address 172.16.15.2
set protocols bgp group IPV4-iBGP-TRCORE neighbor 172.16.15.11 export REG1-Prefix-OUT
set protocols bgp group IPV4-iBGP-TRCORE neighbor 172.16.15.11 peer-as 17821

set policy-options policy-statement REG1-Prefix-OUT term 1 then accept


set policy-options policy-statement REG1-Prefix-OUT term 100 then reject

In JR3:

set system host-name JR3

Prepared By Md. Belal Hossain


4 IPv4 Routing with Juniper

set system root-authentication plain-text-password


New password: *********
Retype new password: *********

set interfaces em0 unit 0 description ***Connected-To-JR2***


set interfaces em0 unit 0 family inet address 172.16.10.6/30
set interfaces em1 unit 0 description ***Connected-To-r14-CBR1***
set interfaces em1 unit 0 family inet address 172.16.11.33/30
set interfaces em2 unit 0 description ***Connected-To-JR1***
set interfaces em2 unit 0 family inet address 172.16.10.10/30
set interfaces lo0 unit 0 description ***JR3-Loopback***
set interfaces lo0 unit 0 family inet address 172.16.15.3/32

OSPF:

set protocols ospf area 0.0.0.1 interface em0.0 interface-type p2p


set protocols ospf area 0.0.0.1 interface em2.0 interface-type p2p
set protocols ospf area 0.0.0.1 interface lo0.0 passive

iBGP:

set routing-options static route 172.16.11.32/27 discard


set routing-options router-id 172.16.15.3
set routing-options autonomous-system 17821

set protocols bgp group IPV4-iBGP-REG1 type internal


set protocols bgp group IPV4-iBGP-REG1 neighbor 172.16.15.1 description ***JR3-JR1***
set protocols bgp group IPV4-iBGP-REG1 neighbor 172.16.15.1 local-address 172.16.15.3
set protocols bgp group IPV4-iBGP-REG1 neighbor 172.16.15.1 export JR3-Prefix-OUT
set protocols bgp group IPV4-iBGP-REG1 neighbor 172.16.15.1 peer-as 17821
set protocols bgp group IPV4-iBGP-REG1 neighbor 172.16.15.2 description ***JR3-JR2***
set protocols bgp group IPV4-iBGP-REG1 neighbor 172.16.15.2 local-address 172.16.15.3
set protocols bgp group IPV4-iBGP-REG1 neighbor 172.16.15.2 export JR3-Prefix-OUT
set protocols bgp group IPV4-iBGP-REG1 neighbor 172.16.15.2 peer-as 17821

set policy-options policy-statement JR3-Prefix-OUT term 1 then accept


set policy-options policy-statement JR3-Prefix-OUT term 100 then reject

eBGP:

set protocols bgp group IPV4-eBGP-CUSTOMER-REG1-POP2 neighbor 172.16.11.34 description ***r14-CBR1***


set protocols bgp group IPV4-eBGP-CUSTOMER-REG1-POP2 neighbor 172.16.11.34 local-address 172.16.11.33
set protocols bgp group IPV4-eBGP-CUSTOMER-REG1-POP2 neighbor 172.16.11.34 import r14-CBR1-Prefix-IN
set protocols bgp group IPV4-eBGP-CUSTOMER-REG1-POP2 neighbor 172.16.11.34 export default-only
set protocols bgp group IPV4-eBGP-CUSTOMER-REG1-POP2 neighbor 172.16.11.34 peer-as 65002

set policy-options policy-statement default-only term default-route from route-filter 0.0.0.0/0 exact
set policy-options policy-statement default-only term default-route then accept
set policy-options policy-statement default-only term reject-all-other-routes then reject
set policy-options policy-statement r14-CBR1-Prefix-IN term 1 from protocol bgp
set policy-options policy-statement r14-CBR1-Prefix-IN term 1 from route-filter 172.16.18.0/23 upto /24
set policy-options policy-statement r14-CBR1-Prefix-IN term 1 then accept
set policy-options policy-statement r14-CBR1-Prefix-IN term 100 then reject

set protocols bgp group IPV4-iBGP-REG1 export next-hop-self


set policy-options policy-statement next-hop-self term se-nh then next-hop self

Prepared By Md. Belal Hossain


5 IPv4 Routing with Juniper

In JR4:

set system host-name JR4


set system root-authentication plain-text-password
New password: *********
Retype new password: *********

set interfaces em0 unit 0 description ***Connected-To-JR5***


set interfaces em0 unit 0 family inet address 172.16.10.66/30
set interfaces em1 unit 0 description ***Connected-To-r15-CAR2***
set interfaces em1 unit 0 family inet address 172.16.11.65/30
set interfaces em2 unit 0 description ***Connected-To-JR6***
set interfaces em2 unit 0 family inet address 172.16.10.73/30
set interfaces lo0 unit 0 description ***JR4-Loopback***
set interfaces lo0 unit 0 family inet address 172.16.15.4/32

OSPF:

set protocols ospf area 0.0.0.2 interface em0.0 interface-type p2p


set protocols ospf area 0.0.0.2 interface em2.0 interface-type p2p
set protocols ospf area 0.0.0.2 interface lo0.0 passive

iBGP:

set routing-options static route 172.16.11.64/27 discard


set routing-options router-id 172.16.15.4
set routing-options autonomous-system 17821

set protocols bgp group IPV4-iBGP-REG2 type internal


set protocols bgp group IPV4-iBGP-REG2 neighbor 172.16.15.5 description ***JR4-JR5***
set protocols bgp group IPV4-iBGP-REG2 neighbor 172.16.15.5 local-address 172.16.15.4
set protocols bgp group IPV4-iBGP-REG2 neighbor 172.16.15.5 export JR4-Prefix-OUT
set protocols bgp group IPV4-iBGP-REG2 neighbor 172.16.15.5 peer-as 17821
set protocols bgp group IPV4-iBGP-REG2 neighbor 172.16.15.6 description ***JR4-JR6***
set protocols bgp group IPV4-iBGP-REG2 neighbor 172.16.15.6 local-address 172.16.15.4
set protocols bgp group IPV4-iBGP-REG2 neighbor 172.16.15.6 export JR4-Prefix-OUT
set protocols bgp group IPV4-iBGP-REG2 neighbor 172.16.15.6 peer-as 17821

set policy-options policy-statement JR4-Prefix-OUT term 1 then accept


set policy-options policy-statement JR4-Prefix-OUT term 100 then reject

eBGP:

set protocols bgp group IPV4-eBGP-CUSTOMER-REG2-POP1 neighbor 172.16.11.66 description ***r15-CAR2***


set protocols bgp group IPV4-eBGP-CUSTOMER-REG2-POP1 neighbor 172.16.11.66 local-address 172.16.11.65
set protocols bgp group IPV4-eBGP-CUSTOMER-REG2-POP1 neighbor 172.16.11.66 import r15-CAR2-Prefix-IN
set protocols bgp group IPV4-eBGP-CUSTOMER-REG2-POP1 neighbor 172.16.11.66 export default-only
set protocols bgp group IPV4-eBGP-CUSTOMER-REG2-POP1 neighbor 172.16.11.66 peer-as 65003

set policy-options policy-statement default-only term default-route from route-filter 0.0.0.0/0 exact
set policy-options policy-statement default-only term default-route then accept
set policy-options policy-statement default-only term reject-all-other-routes then reject

set policy-options policy-statement r15-CAR2-Prefix-IN term 1 from protocol bgp

Prepared By Md. Belal Hossain


6 IPv4 Routing with Juniper

set policy-options policy-statement r15-CAR2-Prefix-IN term 1 from route-filter 172.16.20.0/23 upto /24
set policy-options policy-statement r15-CAR2-Prefix-IN term 1 then accept
set policy-options policy-statement r15-CAR2-Prefix-IN term 100 then reject

set protocols bgp group IPV4-iBGP-REG2 export next-hop-self


set policy-options policy-statement next-hop-self term se-nh then next-hop self

In JR5:

set system host-name JR5


set system root-authentication plain-text-password
New password: *********
Retype new password: *********

set interfaces em0 unit 0 description ***Connected-To-JR4***


set interfaces em0 unit 0 family inet address 172.16.10.65/30
set interfaces em1 unit 0 description ***Connected-To-JR6***
set interfaces em1 unit 0 family inet address 172.16.10.69/30
set interfaces em2 unit 0 description ***Connected-To-SW2***
set interfaces em2 unit 0 family inet address 172.16.13.5/24
set interfaces em3 unit 0 description ***Connected-To-SW1***
set interfaces em3 unit 0 family inet address 172.16.12.5/24
set interfaces em4 unit 0 description ***Connected-To-PC-2***
set interfaces em4 unit 0 family inet address 172.16.2.1/24
set interfaces lo0 unit 0 description ***JR5-Loopback***
set interfaces lo0 unit 0 family inet address 172.16.15.5/32

OSPF:

set protocols ospf area 0.0.0.0 interface em3.0


set protocols ospf area 0.0.0.0 interface em2.0
set protocols ospf area 0.0.0.2 interface em0.0 interface-type p2p
set protocols ospf area 0.0.0.2 interface em1.0 interface-type p2p
set protocols ospf area 0.0.0.2 interface lo0.0 passive

iBGP:

set routing-options static route 172.16.2.0/24 discard


set routing-options static route 172.16.3.0/24 discard
set routing-options router-id 172.16.15.5
set routing-options autonomous-system 17821

set protocols bgp group IPV4-iBGP-REG2 type internal


set protocols bgp group IPV4-iBGP-REG2 cluster 172.16.15.5
set protocols bgp group IPV4-iBGP-REG2 neighbor 172.16.15.4 description ***JR5-JR4***
set protocols bgp group IPV4-iBGP-REG2 neighbor 172.16.15.4 local-address 172.16.15.5
set protocols bgp group IPV4-iBGP-REG2 neighbor 172.16.15.4 export JR5-Prefix-OUT
set protocols bgp group IPV4-iBGP-REG2 neighbor 172.16.15.4 peer-as 17821
set protocols bgp group IPV4-iBGP-REG2 neighbor 172.16.15.6 description ***JR5-JR6***
set protocols bgp group IPV4-iBGP-REG2 neighbor 172.16.15.6 local-address 172.16.15.5
set protocols bgp group IPV4-iBGP-REG2 neighbor 172.16.15.6 export JR5-Prefix-OUT
set protocols bgp group IPV4-iBGP-REG2 neighbor 172.16.15.6 peer-as 17821

set protocols bgp group IPV4-iBGP-TRCORE type internal

Prepared By Md. Belal Hossain


7 IPv4 Routing with Juniper

set protocols bgp group IPV4-iBGP-TRCORE neighbor 172.16.15.2 description ***JR5-JR2***


set protocols bgp group IPV4-iBGP-TRCORE neighbor 172.16.15.2 local-address 172.16.15.5
set protocols bgp group IPV4-iBGP-TRCORE neighbor 172.16.15.2 peer-as 17821
set protocols bgp group IPV4-iBGP-TRCORE neighbor 172.16.15.8 description ***JR5-JR8***
set protocols bgp group IPV4-iBGP-TRCORE neighbor 172.16.15.8 local-address 172.16.15.5
set protocols bgp group IPV4-iBGP-TRCORE neighbor 172.16.15.8 peer-as 17821
set protocols bgp group IPV4-iBGP-TRCORE neighbor 172.16.15.11 description ***JR5-JR11***
set protocols bgp group IPV4-iBGP-TRCORE neighbor 172.16.15.11 local-address 172.16.15.5
set protocols bgp group IPV4-iBGP-TRCORE neighbor 172.16.15.11 peer-as 17821

set policy-options policy-statement JR5-Prefix-OUT term 1 then accept


set policy-options policy-statement JR5-Prefix-OUT term 100 then reject

In JR6:

set system host-name JR6


set system root-authentication plain-text-password
New password: *********
Retype new password: *********

set interfaces em0 unit 0 description ***Connected-To-JR5***


set interfaces em0 unit 0 family inet address 172.16.10.70/30
set interfaces em1 unit 0 description ***Connected-To-r16-CBR2***
set interfaces em1 unit 0 family inet address 172.16.11.97/30
set interfaces em2 unit 0 description ***Connected-To-JR4***
set interfaces em2 unit 0 family inet address 172.16.10.74/30
set interfaces lo0 unit 0 description ***JR6-Loopback***
set interfaces lo0 unit 0 family inet address 172.16.15.6/32

OSPF:

set protocols ospf area 0.0.0.2 interface em0.0 interface-type p2p


set protocols ospf area 0.0.0.2 interface em2.0 interface-type p2p
set protocols ospf area 0.0.0.2 interface lo0.0

iBGP:

set routing-options static route 172.16.11.96/27 discard


set routing-options router-id 172.16.15.6
set routing-options autonomous-system 17821

set protocols bgp group IPV4-iBGP-REG2 type internal


set protocols bgp group IPV4-iBGP-REG2 neighbor 172.16.15.5 description ***JR6-JR5***
set protocols bgp group IPV4-iBGP-REG2 neighbor 172.16.15.5 local-address 172.16.15.6
set protocols bgp group IPV4-iBGP-REG2 neighbor 172.16.15.5 export JR6-Prefix-OUT
set protocols bgp group IPV4-iBGP-REG2 neighbor 172.16.15.5 peer-as 17821
set protocols bgp group IPV4-iBGP-REG2 neighbor 172.16.15.4 description ***JR6-JR4***
set protocols bgp group IPV4-iBGP-REG2 neighbor 172.16.15.4 local-address 172.16.15.6
set protocols bgp group IPV4-iBGP-REG2 neighbor 172.16.15.4 export JR6-Prefix-OUT
set protocols bgp group IPV4-iBGP-REG2 neighbor 172.16.15.4 peer-as 17821

set policy-options policy-statement JR6-Prefix-OUT term 1 then accept


set policy-options policy-statement JR6-Prefix-OUT term 100 then reject

Prepared By Md. Belal Hossain


8 IPv4 Routing with Juniper

eBGP:

set protocols bgp group IPV4-eBGP-CUSTOMER-REG2-POP2 type external


set protocols bgp group IPV4-eBGP-CUSTOMER-REG2-POP2 neighbor 172.16.11.98 description ***r16-CBR2***
set protocols bgp group IPV4-eBGP-CUSTOMER-REG2-POP2 neighbor 172.16.11.98 local-address 172.16.11.97
set protocols bgp group IPV4-eBGP-CUSTOMER-REG2-POP2 neighbor 172.16.11.98 import r16-CBR2-Prefix-IN
set protocols bgp group IPV4-eBGP-CUSTOMER-REG2-POP2 neighbor 172.16.11.98 export default-only
set protocols bgp group IPV4-eBGP-CUSTOMER-REG2-POP2 neighbor 172.16.11.98 peer-as 65004

set policy-options policy-statement default-only term default-route from route-filter 0.0.0.0/0 exact
set policy-options policy-statement default-only term default-route then accept
set policy-options policy-statement default-only term reject-all-other-routes then reject
set policy-options policy-statement r16-CBR2-Prefix-IN term 1 from protocol bgp
set policy-options policy-statement r16-CBR2-Prefix-IN term 1 from route-filter 172.16.22.0/23 upto /24
set policy-options policy-statement r16-CBR2-Prefix-IN term 1 then accept
set policy-options policy-statement r16-CBR2-Prefix-IN term 100 then reject

set protocols bgp group IPV4-iBGP-REG2 export next-hop-self


set policy-options policy-statement next-hop-self term se-nh then next-hop self

In JR7:

set system host-name JR7


set system root-authentication plain-text-password
New password: *********
Retype new password: *********

set interfaces em0 unit 0 description ***Connected-To-JR8***


set interfaces em0 unit 0 family inet address 172.16.10.130/30
set interfaces em1 unit 0 description ***Connected-To-r17-CAR3***
set interfaces em1 unit 0 family inet address 172.16.11.129/30
set interfaces em2 unit 0 description ***Connected-To-JR9***
set interfaces em2 unit 0 family inet address 172.16.10.137/30
set interfaces lo0 unit 0 description ***JR7-Loopback***
set interfaces lo0 unit 0 family inet address 172.16.15.7/32

OSPF:

set protocols ospf area 0.0.0.3 interface em0.0 interface-type p2p


set protocols ospf area 0.0.0.3 interface em2.0 interface-type p2p
set protocols ospf area 0.0.0.3 interface lo0.0 passive

iBGP:

set routing-options static route 172.16.11.128/27 discard


set routing-options router-id 172.16.15.7
set routing-options autonomous-system 17821

set protocols bgp group IPV4-iBGP-REG3 type internal


set protocols bgp group IPV4-iBGP-REG3 neighbor 172.16.15.8 description ***JR7-JR8***
set protocols bgp group IPV4-iBGP-REG3 neighbor 172.16.15.8 local-address 172.16.15.7
set protocols bgp group IPV4-iBGP-REG3 neighbor 172.16.15.8 export JR7-Prefix-OUT
set protocols bgp group IPV4-iBGP-REG3 neighbor 172.16.15.8 peer-as 17821
set protocols bgp group IPV4-iBGP-REG3 neighbor 172.16.15.9 description ***JR7-JR9***
set protocols bgp group IPV4-iBGP-REG3 neighbor 172.16.15.9 local-address 172.16.15.7

Prepared By Md. Belal Hossain


9 IPv4 Routing with Juniper

set protocols bgp group IPV4-iBGP-REG3 neighbor 172.16.15.9 export JR7-Prefix-OUT


set protocols bgp group IPV4-iBGP-REG3 neighbor 172.16.15.9 peer-as 17821

set policy-options policy-statement JR7-Prefix-OUT term 1 then accept


set policy-options policy-statement JR7-Prefix-OUT term 100 then reject

eBGP:

set protocols bgp group IPV4-eBGP-CUSTOMER-REG3-POP1 type external


set protocols bgp group IPV4-eBGP-CUSTOMER-REG3-POP1 neighbor 172.16.11.130 description ***r17-CAR3***
set protocols bgp group IPV4-eBGP-CUSTOMER-REG3-POP1 neighbor 172.16.11.130 local-address 172.16.11.129
set protocols bgp group IPV4-eBGP-CUSTOMER-REG3-POP1 neighbor 172.16.11.130 import r17-CAR3-Prefix-IN
set protocols bgp group IPV4-eBGP-CUSTOMER-REG3-POP1 neighbor 172.16.11.130 export default-only
set protocols bgp group IPV4-eBGP-CUSTOMER-REG3-POP1 neighbor 172.16.11.130 peer-as 65005

set policy-options policy-statement default-only term default-route from route-filter 0.0.0.0/0 exact
set policy-options policy-statement default-only term default-route then accept
set policy-options policy-statement default-only term reject-all-other-routes then reject
set policy-options policy-statement r17-CAR3-Prefix-IN term 1 from protocol bgp
set policy-options policy-statement r17-CAR3-Prefix-IN term 1 from route-filter 172.16.24.0/23 upto /24
set policy-options policy-statement r17-CAR3-Prefix-IN term 1 then accept
set policy-options policy-statement r17-CAR3-Prefix-IN term 100 then reject

set protocols bgp group IPV4-iBGP-REG3 export next-hop-self


set policy-options policy-statement next-hop-self term se-nh then next-hop self

In JR8:

set system host-name JR8


set system root-authentication plain-text-password
New password: *********
Retype new password: *********

set interfaces em0 unit 0 description ***Connected-To-JR7***


set interfaces em0 unit 0 family inet address 172.16.10.129/30
set interfaces em1 unit 0 description ***Connected-To-JR9***
set interfaces em1 unit 0 family inet address 172.16.10.133/30
set interfaces em2 unit 0 description ***Connected-To-SW2***
set interfaces em2 unit 0 family inet address 172.16.13.8/24
set interfaces em3 unit 0 description ***Connected-To-SW1***
set interfaces em3 unit 0 family inet address 172.16.12.8/24
set interfaces em4 unit 0 description ***Connected-To-PC-3***
set interfaces em4 unit 0 family inet address 172.16.4.1/24
set interfaces lo0 unit 0 description ***JR8-Loopback***
set interfaces lo0 unit 0 family inet address 172.16.15.8/32

OSPF:

set protocols ospf area 0.0.0.0 interface em2.0


set protocols ospf area 0.0.0.0 interface em3.0
set protocols ospf area 0.0.0.3 interface em0.0 interface-type p2p
set protocols ospf area 0.0.0.3 interface em1.0 interface-type p2p
set protocols ospf area 0.0.0.3 interface lo0.0 passive

iBGP:

Prepared By Md. Belal Hossain


10 IPv4 Routing with Juniper

set routing-options static route 172.16.4.0/24 discard


set routing-options static route 172.16.5.0/24 discard
set routing-options router-id 172.16.15.8
set routing-options autonomous-system 17821

set protocols bgp group IPV4-iBGP-REG3 type internal


set protocols bgp group IPV4-iBGP-REG3 neighbor 172.16.15.7 description ***JR8-JR7***
set protocols bgp group IPV4-iBGP-REG3 neighbor 172.16.15.7 local-address 172.16.15.8
set protocols bgp group IPV4-iBGP-REG3 neighbor 172.16.15.7 export JR8-Prefix-OUT
set protocols bgp group IPV4-iBGP-REG3 neighbor 172.16.15.7 peer-as 17821
set protocols bgp group IPV4-iBGP-REG3 neighbor 172.16.15.9 description ***JR8-JR7***
set protocols bgp group IPV4-iBGP-REG3 neighbor 172.16.15.9 local-address 172.16.15.8
set protocols bgp group IPV4-iBGP-REG3 neighbor 172.16.15.9 export JR8-Prefix-OUT
set protocols bgp group IPV4-iBGP-REG3 neighbor 172.16.15.9 peer-as 17821

set policy-options policy-statement JR8-Prefix-OUT term 1 then accept


set policy-options policy-statement JR8-Prefix-OUT term 100 then reject

set protocols bgp group IPV4-iBGP-TRCORE type internal


set protocols bgp group IPV4-iBGP-TRCORE neighbor 172.16.15.2 description ***JR8-JR2***
set protocols bgp group IPV4-iBGP-TRCORE neighbor 172.16.15.2 local-address 172.16.15.8
set protocols bgp group IPV4-iBGP-TRCORE neighbor 172.16.15.2 peer-as 17821
set protocols bgp group IPV4-iBGP-TRCORE neighbor 172.16.15.5 description ***JR8-JR5***
set protocols bgp group IPV4-iBGP-TRCORE neighbor 172.16.15.5 local-address 172.16.15.8
set protocols bgp group IPV4-iBGP-TRCORE neighbor 172.16.15.5 peer-as 17821
set protocols bgp group IPV4-iBGP-TRCORE neighbor 172.16.15.11 description ***JR8-JR11***
set protocols bgp group IPV4-iBGP-TRCORE neighbor 172.16.15.11 local-address 172.16.15.8
set protocols bgp group IPV4-iBGP-TRCORE neighbor 172.16.15.11 peer-as 17821

set protocols bgp group IPV4-iBGP-REG3 cluster 172.16.15.8

In JR9:

set system host-name JR9


set system root-authentication plain-text-password
New password: *********
Retype new password: *********

set interfaces em0 unit 0 description ***Connected-To-JR8***


set interfaces em0 unit 0 family inet address 172.16.10.134/30
set interfaces em1 unit 0 description ***Connected-To-r18-CBR3***
set interfaces em1 unit 0 family inet address 172.16.11.161/30
set interfaces em2 unit 0 description ***Connected-To-JR7***
set interfaces em2 unit 0 family inet address 172.16.10.138/30
set interfaces lo0 unit 0 description ***JR9-Loopback***
set interfaces lo0 unit 0 family inet address 172.16.15.9/32

OSPF:

set protocols ospf area 0.0.0.3 interface em0.0 interface-type p2p


set protocols ospf area 0.0.0.3 interface em2.0 interface-type p2p
set protocols ospf area 0.0.0.3 interface lo0.0 passive

iBGP:

Prepared By Md. Belal Hossain


11 IPv4 Routing with Juniper

set routing-options static route 172.16.11.160/27 discard


set routing-options router-id 172.16.15.9
set routing-options autonomous-system 17821

set protocols bgp group IPV4-iBGP-REG3 type internal


set protocols bgp group IPV4-iBGP-REG3 neighbor 172.16.15.8 description ***JR9-JR8***
set protocols bgp group IPV4-iBGP-REG3 neighbor 172.16.15.8 local-address 172.16.15.9
set protocols bgp group IPV4-iBGP-REG3 neighbor 172.16.15.8 export JR9-Prefix-OUT
set protocols bgp group IPV4-iBGP-REG3 neighbor 172.16.15.8 peer-as 17821
set protocols bgp group IPV4-iBGP-REG3 neighbor 172.16.15.7 description ***JR9-JR7***
set protocols bgp group IPV4-iBGP-REG3 neighbor 172.16.15.7 local-address 172.16.15.9
set protocols bgp group IPV4-iBGP-REG3 neighbor 172.16.15.7 export JR9-Prefix-OUT
set protocols bgp group IPV4-iBGP-REG3 neighbor 172.16.15.7 peer-as 17821

set policy-options policy-statement JR9-Prefix-OUT term 1 then accept


set policy-options policy-statement JR9-Prefix-OUT term 100 then reject

eBGP:

set protocols bgp group IPV4-eBGP-CUSTOMER-REG3-POP2 type external


set protocols bgp group IPV4-eBGP-CUSTOMER-REG3-POP2 neighbor 172.16.11.162 description ***r18-CBR3***
set protocols bgp group IPV4-eBGP-CUSTOMER-REG3-POP2 neighbor 172.16.11.162 local-address 172.16.11.161
set protocols bgp group IPV4-eBGP-CUSTOMER-REG3-POP2 neighbor 172.16.11.162 import r18-CBR3-Prefix-IN
set protocols bgp group IPV4-eBGP-CUSTOMER-REG3-POP2 neighbor 172.16.11.162 export default-only
set protocols bgp group IPV4-eBGP-CUSTOMER-REG3-POP2 neighbor 172.16.11.162 peer-as 65006

set policy-options policy-statement default-only term default-route from route-filter 0.0.0.0/0 exact
set policy-options policy-statement default-only term default-route then accept
set policy-options policy-statement default-only term reject-all-other-routes then reject
set policy-options policy-statement r18-CBR3-Prefix-IN term 1 from route-filter 172.16.26.0/23 upto /24
set policy-options policy-statement r18-CBR3-Prefix-IN term 1 then accept
set policy-options policy-statement r18-CBR3-Prefix-IN term 100 then reject

set protocols bgp group IPV4-iBGP-REG3 export next-hop-self


set policy-options policy-statement next-hop-self term se-nh then next-hop self

In JR10:

set system host-name JR10


set system root-authentication plain-text-password
New password: *********
Retype new password: *********

set interfaces em0 unit 0 description ***Connected-To-JR11***


set interfaces em0 unit 0 family inet address 172.16.10.194/30
set interfaces em1 unit 0 description ***Connected-To-r19-CAR4***
set interfaces em1 unit 0 family inet address 172.16.11.193/30
set interfaces em2 unit 0 description ***Connected-To-JR12***
set interfaces em2 unit 0 family inet address 172.16.10.201/30
set interfaces lo0 unit 0 description ***JR10-Loopback***
set interfaces lo0 unit 0 family inet address 172.16.15.10/32

OSPF:

set protocols ospf area 0.0.0.4 interface em0.0 interface-type p2p


set protocols ospf area 0.0.0.4 interface em2.0 interface-type p2p

Prepared By Md. Belal Hossain


12 IPv4 Routing with Juniper

set protocols ospf area 0.0.0.4 interface lo0.0 passive

iBGP:

set routing-options static route 172.16.11.192/27 discard


set routing-options router-id 172.16.15.10
set routing-options autonomous-system 17821

set protocols bgp group IPV4-iBGP-REG4 type internal


set protocols bgp group IPV4-iBGP-REG4 neighbor 172.16.15.11 description ***JR10-JR11***
set protocols bgp group IPV4-iBGP-REG4 neighbor 172.16.15.11 local-address 172.16.15.10
set protocols bgp group IPV4-iBGP-REG4 neighbor 172.16.15.11 export JR10-Prefix-OUT
set protocols bgp group IPV4-iBGP-REG4 neighbor 172.16.15.11 peer-as 17821
set protocols bgp group IPV4-iBGP-REG4 neighbor 172.16.15.12 description ***JR10-JR12***
set protocols bgp group IPV4-iBGP-REG4 neighbor 172.16.15.12 local-address 172.16.15.10
set protocols bgp group IPV4-iBGP-REG4 neighbor 172.16.15.12 export JR10-Prefix-OUT
set protocols bgp group IPV4-iBGP-REG4 neighbor 172.16.15.12 peer-as 17821
set policy-options policy-statement JR10-Prefix-OUT term 1 then accept
set policy-options policy-statement JR10-Prefix-OUT term 100 then reject

eBGP:

set protocols bgp group IPV4-eBGP-CUSTOMER-REG4-POP1 type external


set protocols bgp group IPV4-eBGP-CUSTOMER-REG4-POP1 neighbor 172.16.11.194 description ***r19-CAR4***
set protocols bgp group IPV4-eBGP-CUSTOMER-REG4-POP1 neighbor 172.16.11.194 local-address 172.16.11.193
set protocols bgp group IPV4-eBGP-CUSTOMER-REG4-POP1 neighbor 172.16.11.194 import r19-CAR4-Prefix-IN
set protocols bgp group IPV4-eBGP-CUSTOMER-REG4-POP1 neighbor 172.16.11.194 export default-only
set protocols bgp group IPV4-eBGP-CUSTOMER-REG4-POP1 neighbor 172.16.11.194 peer-as 65007

set policy-options policy-statement default-only term default-route from route-filter 0.0.0.0/0 exact
set policy-options policy-statement default-only term default-route then accept
set policy-options policy-statement default-only term reject-all-other-routes then reject
set policy-options policy-statement r19-CAR4-Prefix-IN term 1 from protocol bgp
set policy-options policy-statement r19-CAR4-Prefix-IN term 1 from route-filter 172.16.28.0/23 upto /24
set policy-options policy-statement r19-CAR4-Prefix-IN term 1 then accept
set policy-options policy-statement r19-CAR4-Prefix-IN term 100 then reject

set protocols bgp group IPV4-iBGP-REG4 export next-hop-self


set policy-options policy-statement next-hop-self term se-nh then next-hop self

In JR11:

set system host-name JR11


set system root-authentication plain-text-password
New password: *********
Retype new password: *********

set interfaces em0 unit 0 description ***Connected-to-JR10***


set interfaces em0 unit 0 family inet address 172.16.10.193/30
set interfaces em1 unit 0 description ***Connected-To-JR12***
set interfaces em1 unit 0 family inet address 172.16.10.197/30
set interfaces em2 unit 0 description ***Connected-To-SW1***
set interfaces em2 unit 0 family inet address 172.16.12.11/24
set interfaces em3 unit 0 description ***Connected-To-SW2***
set interfaces em3 unit 0 family inet address 172.16.13.11/24

Prepared By Md. Belal Hossain


13 IPv4 Routing with Juniper

set interfaces em4 unit 0 description ***Connected-To-PC-4***


set interfaces em4 unit 0 family inet address 172.16.6.1/24
set interfaces lo0 unit 0 description ***JR11-Loopback***
set interfaces lo0 unit 0 family inet address 172.16.15.11/32

OSPF:

set protocols ospf area 0.0.0.0 interface em2.0


set protocols ospf area 0.0.0.0 interface em3.0
set protocols ospf area 0.0.0.4 interface em0.0 interface-type p2p
set protocols ospf area 0.0.0.4 interface em1.0 interface-type p2p
set protocols ospf area 0.0.0.4 interface lo0.0 passive

iBGP:

set routing-options static route 172.16.6.0/24 discard


set routing-options static route 172.16.7.0/24 discard
set routing-options router-id 172.16.15.11
set routing-options autonomous-system 17821

set protocols bgp group IPV4-iBGP-REG4 type internal


set protocols bgp group IPV4-iBGP-REG4 cluster 172.16.15.11
set protocols bgp group IPV4-iBGP-REG4 neighbor 172.16.15.12 description ***JR11-JR12***
set protocols bgp group IPV4-iBGP-REG4 neighbor 172.16.15.12 local-address 172.16.15.11
set protocols bgp group IPV4-iBGP-REG4 neighbor 172.16.15.12 export JR11-Prefix-OUT
set protocols bgp group IPV4-iBGP-REG4 neighbor 172.16.15.12 peer-as 17821
set protocols bgp group IPV4-iBGP-REG4 neighbor 172.16.15.10 description ***JR11-JR10***
set protocols bgp group IPV4-iBGP-REG4 neighbor 172.16.15.10 local-address 172.16.15.11
set protocols bgp group IPV4-iBGP-REG4 neighbor 172.16.15.10 export JR11-Prefix-OUT
set protocols bgp group IPV4-iBGP-REG4 neighbor 172.16.15.10 peer-as 17821

set policy-options policy-statement JR11-Prefix-OUT term 1 then accept


set policy-options policy-statement JR11-Prefix-OUT term 100 then reject

set protocols bgp group IPV4-iBGP-TRCORE type internal


set protocols bgp group IPV4-iBGP-TRCORE neighbor 172.16.15.2 description ***JR11-JR2***
set protocols bgp group IPV4-iBGP-TRCORE neighbor 172.16.15.2 local-address 172.16.15.11
set protocols bgp group IPV4-iBGP-TRCORE neighbor 172.16.15.2 export REG4-Prefix-OUT
set protocols bgp group IPV4-iBGP-TRCORE neighbor 172.16.15.2 peer-as 17821
set protocols bgp group IPV4-iBGP-TRCORE neighbor 172.16.15.5 description ***JR11-JR5***
set protocols bgp group IPV4-iBGP-TRCORE neighbor 172.16.15.5 local-address 172.16.15.11
set protocols bgp group IPV4-iBGP-TRCORE neighbor 172.16.15.5 export REG4-Prefix-OUT
set protocols bgp group IPV4-iBGP-TRCORE neighbor 172.16.15.5 peer-as 17821
set protocols bgp group IPV4-iBGP-TRCORE neighbor 172.16.15.11 description ***JR11-JR8***
set protocols bgp group IPV4-iBGP-TRCORE neighbor 172.16.15.11 local-address 172.16.15.11
set protocols bgp group IPV4-iBGP-TRCORE neighbor 172.16.15.11 export REG4-Prefix-OUT
set protocols bgp group IPV4-iBGP-TRCORE neighbor 172.16.15.11 peer-as 17821

set policy-options policy-statement REG4-Prefix-OUT term 1 then accept


set policy-options policy-statement REG4-Prefix-OUT term 100 then reject

In JR12:

set system host-name JR12


set system root-authentication plain-text-password

Prepared By Md. Belal Hossain


14 IPv4 Routing with Juniper

New password: *********


Retype new password: *********

set interfaces em0 unit 0 description ***Connected-To-JR11***


set interfaces em0 unit 0 family inet address 172.16.10.198/30
set interfaces em1 unit 0 description ***Connected-To-r20-CBR4***
set interfaces em1 unit 0 family inet address 172.16.11.225/30
set interfaces em2 unit 0 description ***Connected-To-JR10***
set interfaces em2 unit 0 family inet address 172.16.10.202/30
set interfaces lo0 unit 0 description ***JR12-Loopback***
set interfaces lo0 unit 0 family inet address 172.16.15.12/32

OSPF:

set protocols ospf area 0.0.0.4 interface em2.0 interface-type p2p


set protocols ospf area 0.0.0.4 interface em0.0 interface-type p2p
set protocols ospf area 0.0.0.4 interface lo0.0 passive

iBGP:

set routing-options static route 172.16.11.224/27 discard


set routing-options router-id 172.16.15.12
set routing-options autonomous-system 17821

set protocols bgp group IPV4-iBGP-REG4 type internal


set protocols bgp group IPV4-iBGP-REG4 neighbor 172.16.15.11 description ***JR12-JR11***
set protocols bgp group IPV4-iBGP-REG4 neighbor 172.16.15.11 local-address 172.16.15.12
set protocols bgp group IPV4-iBGP-REG4 neighbor 172.16.15.11 export JR12-Prefix-OUT
set protocols bgp group IPV4-iBGP-REG4 neighbor 172.16.15.11 peer-as 17821
set protocols bgp group IPV4-iBGP-REG4 neighbor 172.16.15.10 description ***JR12-JR10***
set protocols bgp group IPV4-iBGP-REG4 neighbor 172.16.15.10 local-address 172.16.15.12
set protocols bgp group IPV4-iBGP-REG4 neighbor 172.16.15.10 export JR12-Prefix-OUT
set protocols bgp group IPV4-iBGP-REG4 neighbor 172.16.15.10 peer-as 17821
set policy-options policy-statement JR12-Prefix-OUT term 1 then accept
set policy-options policy-statement JR12-Prefix-OUT term 100 then reject

eBGP:

set protocols bgp group IPV4-eBGP-CUSTOMER-REG4-POP2 type external


set protocols bgp group IPV4-eBGP-CUSTOMER-REG4-POP2 neighbor 172.16.11.226 description ***r20-CBR4***
set protocols bgp group IPV4-eBGP-CUSTOMER-REG4-POP2 neighbor 172.16.11.226 local-address 172.16.11.225
set protocols bgp group IPV4-eBGP-CUSTOMER-REG4-POP2 neighbor 172.16.11.226 import r20-CBR4-Prefix-IN
set protocols bgp group IPV4-eBGP-CUSTOMER-REG4-POP2 neighbor 172.16.11.226 export default-only
set protocols bgp group IPV4-eBGP-CUSTOMER-REG4-POP2 neighbor 172.16.11.226 peer-as 65008

set policy-options policy-statement default-only term default-route from route-filter 0.0.0.0/0 exact
set policy-options policy-statement default-only term default-route then accept
set policy-options policy-statement default-only term reject-all-other-routes then reject
set policy-options policy-statement r20-CBR4-Prefix-IN term 1 from protocol bgp
set policy-options policy-statement r20-CBR4-Prefix-IN term 1 from route-filter 172.16.30.0/23 upto /24
set policy-options policy-statement r20-CBR4-Prefix-IN term 1 then accept
set policy-options policy-statement r20-CBR4-Prefix-IN term 100 then reject

set protocols bgp group IPV4-iBGP-REG4 export next-hop-self


set policy-options policy-statement next-hop-self term se-nh then next-hop self

Prepared By Md. Belal Hossain


15 IPv4 Routing with Juniper

eBGP:

In r13-CAR1:

set system host-name r13-CAR1


set interfaces em0 unit 0 description ***Connected-To-JR1***
set interfaces em0 unit 0 family inet address 172.16.11.2/30
set interfaces lo0 unit 0 description ***r13-CAR1-Loopback***
set interfaces lo0 unit 0 family inet address 172.16.16.1/24

set routing-options static route 172.16.16.0/24 discard


set routing-options static route 172.16.17.0/24 discard

set routing-options autonomous-system 65001


set protocols bgp group ISP1 type external
set protocols bgp group ISP1 neighbor 172.16.11.1 description ***JR1***
set protocols bgp group ISP1 neighbor 172.16.11.1 local-address 172.16.11.2
set protocols bgp group ISP1 neighbor 172.16.11.1 import ISP1-Prefix-IN
set protocols bgp group ISP1 neighbor 172.16.11.1 export ISP1-Prefix-OUT
set protocols bgp group ISP1 neighbor 172.16.11.1 peer-as 17821

set policy-options policy-statement ISP1-Prefix-IN term 1 from route-filter 0.0.0.0/0 exact


set policy-options policy-statement ISP1-Prefix-IN term 1 then accept
set policy-options policy-statement ISP1-Prefix-IN term 100 then reject
set policy-options policy-statement ISP1-Prefix-OUT term 1 from route-filter 172.16.16.0/23 upto /24
set policy-options policy-statement ISP1-Prefix-OUT term 1 then accept
set policy-options policy-statement ISP1-Prefix-OUT term 100 then reject

eBGP:

In r14-CBR1:

set system host-name r14-CBR1


set interfaces em0 unit 0 description ***Connected-To-r14-CBR1***
set interfaces em0 unit 0 family inet address 172.16.11.34/30
set interfaces lo0 unit 0 description ***r14-CBR1-Loopback***
set interfaces lo0 unit 0 family inet address 172.16.18.1/24

set routing-options static route 172.16.18.0/24 discard


set routing-options static route 172.16.19.0/24 discard

set routing-options autonomous-system 65002


set protocols bgp group ISP1 type external
set protocols bgp group ISP1 neighbor 172.16.11.33 description ***JR3***
set protocols bgp group ISP1 neighbor 172.16.11.33 local-address 172.16.11.34
set protocols bgp group ISP1 neighbor 172.16.11.33 import ISP1-Prefix-IN
set protocols bgp group ISP1 neighbor 172.16.11.33 export ISP1-Prefix-OUT
set protocols bgp group ISP1 neighbor 172.16.11.33 peer-as 17821

set policy-options policy-statement ISP1-Prefix-IN term 1 from route-filter 0.0.0.0/0 exact


set policy-options policy-statement ISP1-Prefix-IN term 1 then accept
set policy-options policy-statement ISP1-Prefix-IN term 100 then reject
set policy-options policy-statement ISP1-Prefix-OUT term 1 from route-filter 172.16.18.0/23 upto /24
set policy-options policy-statement ISP1-Prefix-OUT term 1 then accept

Prepared By Md. Belal Hossain


16 IPv4 Routing with Juniper

set policy-options policy-statement ISP1-Prefix-OUT term 100 then reject

eBGP:

In r15-CAR2:

set system host-name r15-CAR2


set interfaces em0 unit 0 description ***JR4***
set interfaces em0 unit 0 family inet address 172.16.11.66/30
set interfaces lo0 unit 0 description ***r15-CAR2-Loopback***
set interfaces lo0 unit 0 family inet address 172.16.20.1/24

set routing-options static route 172.16.20.0/24 discard


set routing-options static route 172.16.21.0/24 discard

set routing-options autonomous-system 65003


set protocols bgp group ISP1 type external
set protocols bgp group ISP1 neighbor 172.16.11.65 description ***JR4***
set protocols bgp group ISP1 neighbor 172.16.11.65 local-address 172.16.11.66
set protocols bgp group ISP1 neighbor 172.16.11.65 import ISP1-Prefix-IN
set protocols bgp group ISP1 neighbor 172.16.11.65 export ISP1-Prefix-OUT
set protocols bgp group ISP1 neighbor 172.16.11.65 peer-as 17821
set policy-options policy-statement ISP1-Prefix-IN term 1 from route-filter 0.0.0.0/0 exact
set policy-options policy-statement ISP1-Prefix-IN term 1 then accept
set policy-options policy-statement ISP1-Prefix-IN term 100 then reject
set policy-options policy-statement ISP1-Prefix-OUT term 1 from route-filter 172.16.20.0/23 upto /24
set policy-options policy-statement ISP1-Prefix-OUT term 1 then accept
set policy-options policy-statement ISP1-Prefix-OUT term 100 then reject

eBGP:

In r16-CBR2:

set system host-name r16-CBR2


set interfaces em0 unit 0 description ***JR6***
set interfaces em0 unit 0 family inet address 172.16.11.98/30
set interfaces lo0 unit 0 description ***r16-CBR2-Loopback***
set interfaces lo0 unit 0 family inet address 172.16.22.1/24

set routing-options static route 172.16.22.0/24 discard


set routing-options static route 172.16.23.0/24 discard

set routing-options autonomous-system 65004


set protocols bgp group ISP1 type external
set protocols bgp group ISP1 neighbor 172.16.11.97 description ***JR6***
set protocols bgp group ISP1 neighbor 172.16.11.97 local-address 172.16.11.98
set protocols bgp group ISP1 neighbor 172.16.11.97 import ISP1-Prefix-IN
set protocols bgp group ISP1 neighbor 172.16.11.97 export ISP1-Prefix-OUT
set protocols bgp group ISP1 neighbor 172.16.11.97 peer-as 17821

set policy-options policy-statement ISP1-Prefix-IN term 1 from route-filter 0.0.0.0/0 exact


set policy-options policy-statement ISP1-Prefix-IN term 1 then accept
set policy-options policy-statement ISP1-Prefix-IN term 100 then reject
set policy-options policy-statement ISP1-Prefix-OUT term 1 from route-filter 172.16.22.0/23 upto /24
set policy-options policy-statement ISP1-Prefix-OUT term 1 then accept

Prepared By Md. Belal Hossain


17 IPv4 Routing with Juniper

set policy-options policy-statement ISP1- Prefix-OUT term 100 then reject

eBGP:

In r17-CAR3:

set system host-name r17-CAR3


set interfaces em0 unit 0 description ***JR7***
set interfaces em0 unit 0 family inet address 172.16.11.130/30
set interfaces lo0 unit 0 description ***r17-CAR3-Loopback***
set interfaces lo0 unit 0 family inet address 172.16.24.1/24

set routing-options static route 172.16.24.0/24 discard


set routing-options static route 172.16.25.0/24 discard

set routing-options autonomous-system 65005


set protocols bgp group ISP1 type external
set protocols bgp group ISP1 neighbor 172.16.11.129 description ***JR7***
set protocols bgp group ISP1 neighbor 172.16.11.129 local-address 172.16.11.130
set protocols bgp group ISP1 neighbor 172.16.11.129 import ISP1-Prefix-IN
set protocols bgp group ISP1 neighbor 172.16.11.129 export ISP1-Prefix-OUT
set protocols bgp group ISP1 neighbor 172.16.11.129 peer-as 17821

set policy-options policy-statement ISP1-Prefix-IN term 1 from route-filter 0.0.0.0/0 exact


set policy-options policy-statement ISP1-Prefix-IN term 1 then accept
set policy-options policy-statement ISP1-Prefix-IN term 100 then reject
set policy-options policy-statement ISP1-Prefix-OUT term 1 from route-filter 172.16.24.0/23 upto /24
set policy-options policy-statement ISP1-Prefix-OUT term 1 then accept
set policy-options policy-statement ISP1-Prefix-OUT term 100 then reject

eBGP:

In r18-CBR3:

set system host-name r18-CBR3


set interfaces em0 unit 0 description ***JR9***
set interfaces em0 unit 0 family inet address 172.16.11.162/30
set interfaces lo0 unit 0 description ***r18-CBR3-Loopback***
set interfaces lo0 unit 0 family inet address 172.16.26.1/24

set routing-options static route 172.16.26.0/24 discard


set routing-options static route 172.16.27.0/24 discard

set routing-options autonomous-system 65006


set protocols bgp group ISP1 type external
set protocols bgp group ISP1 neighbor 172.16.11.161 description ***JR9***
set protocols bgp group ISP1 neighbor 172.16.11.161 local-address 172.16.11.162
set protocols bgp group ISP1 neighbor 172.16.11.161 import ISP1-Prefix-IN
set protocols bgp group ISP1 neighbor 172.16.11.161 export ISP1-Prefix-OUT
set protocols bgp group ISP1 neighbor 172.16.11.161 peer-as 17821

set policy-options policy-statement ISP1-Prefix-IN term 1 from route-filter 0.0.0.0/0 exact


set policy-options policy-statement ISP1-Prefix-IN term 1 then accept
set policy-options policy-statement ISP1-Prefix-IN term 100 then reject

Prepared By Md. Belal Hossain


18 IPv4 Routing with Juniper

set policy-options policy-statement ISP1-Prefix-OUT term 1 from route-filter 172.16.26.0/23 upto /24
set policy-options policy-statement ISP1-Prefix-OUT term 1 then accept
set policy-options policy-statement ISP1-Prefix-OUT term 100 then reject

eBGP:

In r19-CAR4:

set system host-name r19-CAR4


set interfaces em0 unit 0 description ***JR10***
set interfaces em0 unit 0 family inet address 172.16.11.194/30
set interfaces lo0 unit 0 description ***r19-CAR4-Loopback***
set interfaces lo0 unit 0 family inet address 172.16.28.1/24

set routing-options static route 172.16.28.0/24 discard


set routing-options static route 172.16.29.0/24 discard

set routing-options autonomous-system 65007


set protocols bgp group ISP1 type external
set protocols bgp group ISP1 neighbor 172.16.11.193 description ***JR10***
set protocols bgp group ISP1 neighbor 172.16.11.193 local-address 172.16.11.194
set protocols bgp group ISP1 neighbor 172.16.11.193 import ISP1-Prefix-IN
set protocols bgp group ISP1 neighbor 172.16.11.193 export ISP1-Prefix-OUT
set protocols bgp group ISP1 neighbor 172.16.11.193 peer-as 17821

set policy-options policy-statement ISP1-Prefix-IN term 1 from route-filter 0.0.0.0/0 exact


set policy-options policy-statement ISP1-Prefix-IN term 1 then accept
set policy-options policy-statement ISP1-Prefix-IN term 100 then reject
set policy-options policy-statement ISP1-Prefix-OUT term 1 from route-filter 172.16.28.0/23 upto /24
set policy-options policy-statement ISP1-Prefix-OUT term 1 then accept
set policy-options policy-statement ISP1-Prefix-OUT term 100 then reject

eBGP:

In r20-CBR4:

set system host-name r20-CBR4


set interfaces em0 unit 0 description ***JR12***
set interfaces em0 unit 0 family inet address 172.16.11.226/30
set interfaces lo0 unit 0 description ***r20-CBR4-Loopback***
set interfaces lo0 unit 0 family inet address 172.16.30.1/24

set routing-options static route 172.16.30.0/24 discard


set routing-options static route 172.16.31.0/24 discard

set routing-options autonomous-system 65008


set protocols bgp group ISP1 type external
set protocols bgp group ISP1 neighbor 172.16.11.225 description ***JR12***
set protocols bgp group ISP1 neighbor 172.16.11.225 local-address 172.16.11.226
set protocols bgp group ISP1 neighbor 172.16.11.225 import ISP1-Prefix-IN
set protocols bgp group ISP1 neighbor 172.16.11.225 export ISP1-Prefix-OUT
set protocols bgp group ISP1 neighbor 172.16.11.225 peer-as 17821

set policy-options policy-statement ISP1-Prefix-IN term 1 from route-filter 0.0.0.0/0 exact


set policy-options policy-statement ISP1-Prefix-IN term 1 then accept

Prepared By Md. Belal Hossain


19 IPv4 Routing with Juniper

set policy-options policy-statement ISP1-Prefix-IN term 100 then reject


set policy-options policy-statement ISP1-Prefix-OUT term 1 from route-filter 172.16.30.0/23 upto /24
set policy-options policy-statement ISP1-Prefix-OUT term 1 then accept
set policy-options policy-statement ISP1-Prefix-OUT term 100 then reject

Prepared By Md. Belal Hossain

You might also like