This article provides the configuration eBGP(External BGP) and iBGP(Internal BGP) on EX series switches
Topology:
Switch A-(ge-0/0/0)--------(ge-0/0/0) Switch B-(ge-0/0/1)----------(ge-0/0/1)-Switch C-(ge-0/0/2)------------(ge-0/0/2)-Switch D iBGP & OSPF eBGP OSPF Setup: Switch A : Lo0 - 100.1.1.1 Ge-0/0/0 – 110.1.1.1/24 Switch B: Lo0 – 150.1.1.1 Ge-0/0/0 – 110.1.1.2/24 Ge-0/0/1 – 120.1.1.1/24 Switch C: Lo0 – 200.1.1.1 Ge-0/0/1-120.1.1.2/24 Ge-0/0/2 – 130.1.1.1/24 Switch D: Lo0 – 210.1.1.1 Ge-0/0/2 – 130.1.1.2/24
The following is the configuration on all the four switches:
Switch 1: {master:0}[edit ] user@switch# show policy-options policy-statement ospf { term t1 { from protocol [ direct local ]; then accept; } } {master:0}[edit ] user@switch# show protocols ospf export ospf; area 0.0.0.0 { interface ge-0/0/0.0; } {master:0}[edit ] user@switch# show routing-options autonomous-system 1000; {master:0}[edit ] user@switch# show protocols bgp local-as 1000; group iBGP { type internal; local-address 100.1.1.1; neighbor 150.1.1.1 { peer-as 1000; } } Switch 2: {master:0}[edit ] user@switch# show policy-options policy-statement bgp { term t1 { from protocol bgp; then { next-hop self; accept; } } } policy-statement bgp1 { term t2 { from { route-filter 120.1.1.0/24 exact; route-filter 150.1.1.1/32 exact; } then reject; } term t1 { from protocol [ ospf direct local ]; then { tag add 100; accept; } } } policy-statement ospf { term t1 { from protocol [ local direct static ]; then accept; } } {master:0}[edit ] user@switch# show protocols bgp local-as 1000; group eBGP { type external; local-address 150.1.1.1; export bgp1; neighbor 200.1.1.1 { multihop { ttl 2; } peer-as 2000; } } group iBGP { type internal; local-address 150.1.1.1; export bgp; neighbor 100.1.1.1 { peer-as 1000; } } {master:0}[edit ] user@switch# show routing-options static { route 200.1.1.1/32 next-hop 120.1.1.2; } autonomous-system 1000; Switch 3: {master:0}[edit ] user@switch# show policy-options policy-statement bgp { term t2 { from { route-filter 120.1.1.0/24 exact; route-filter 200.1.1.1/32 exact; } then reject; } term t1 { from protocol [ ospf direct local ]; then accept; } } policy-statement ospf { term t1 { from protocol [ direct local bgp static ]; then { tag2 add 1000; accept; } } } {master:0}[edit ] user@switch# show protocols bgp local-as 2000; group eBGP { type external; local-address 200.1.1.1; export bgp; neighbor 150.1.1.1 { multihop { ttl 2; } peer-as 1000; } } {master:0}[edit ] user@switch# show routing-options static { route 150.1.1.1/32 next-hop 120.1.1.1; } autonomous-system 2000; Switch 4: {master:0}[edit ] user@switch# show policy-options policy-statement ospf { term t1 { from protocol [ ospf direct local ]; then accept; } } {master:0}[edit ] user@switch# show protocols ospf export ospf; area 0.0.0.0 { interface ge-0/0/2.0; } {master:0}[edit ] user@switch# show routing-options autonomous-system 2000;