Tags

,

Junos_sw_logo

Now time for some iBGP with Cisco and Juniper

IBGP Cisco Lab Topology

Ok, again we need to reset the lab to the rescue config on J1, J2 and J3, and load the base on R4.

 

Now that you have done that, we can configure OSPF area 0 on J1, J2, and J3.  We will advertise the loopbacks into OSPF as well.

 

J1:

jfry@J1> edit   

Entering configuration mode

 

[edit]

jfry@J1# edit protocols ospf area 0

 

[edit protocols ospf area 0.0.0.0]

jfry@J1# set interface ge-0/0/0

 

[edit protocols ospf area 0.0.0.0]

jfry@J1# set interface fe-0/0/2 

 

 

[edit protocols ospf area 0.0.0.0]

jfry@J1# set interface lo0 passive

 

[edit protocols ospf area 0.0.0.0]

jfry@J1# commit and-quit

Now J2:

jfry@J2> edit

Entering configuration mode

 

[edit]

jfry@J2# edit protocols ospf area 0

 

[edit protocols ospf area 0.0.0.0]

jfry@J2# set interface ge-0/0/0  

 

[edit protocols ospf area 0.0.0.0]

jfry@J2# set interface ge-0/0/1

 

[edit protocols ospf area 0.0.0.0]

jfry@J2# set interface lo0 passive

 

[edit protocols ospf area 0.0.0.0]

jfry@J2# commit and-quit

 

and J3:

[edit]

jfry@J3# edit protocols ospf area 0

 

[edit protocols ospf area 0.0.0.0]

jfry@J3# set interface fe-0/0/1

 

[edit protocols ospf area 0.0.0.0]

jfry@J3# set interface fe-0/0/2

 

[edit protocols ospf area 0.0.0.0]

jfry@J3# set interface lo0 passive

 

[edit protocols ospf area 0.0.0.0]

jfry@J3# commit and-quit

 

 

 

Ok, time to check the route table on J1 to make sure all is looking good:

jfry@J1> show route | match OSPF

2.2.2.2/32         *[OSPF/10] 00:02:18, metric 1

3.3.3.3/32         *[OSPF/10] 00:02:40, metric 1

192.168.23.0/24    *[OSPF/10] 00:02:02, metric 2

224.0.0.5/32       *[OSPF/10] 00:03:32, metric 1

 

jfry@J1>

 

Good, we have the right OSPF routes.

 

Now to configure BGP between J1 and R4:

R4:

R4#conf t

Enter configuration commands, one per line.  End with CNTL/Z.

R4(config)#router bgp 14

R4(config-router)#no au

R4(config-router)#net 4.4.4.4 mask 255.255.255.255

R4(config-router)#nei 192.168.14.1 remote-as 14     

R4(config-router)#^Z

R4#

 

and now J1:

[edit]

jfry@J1# set routing-options autonomous-system 14 

 

[edit]

jfry@J1# edit protocols bgp group ibgp

 

[edit protocols bgp group ibgp]

jfry@J1# set type internal

 

[edit protocols bgp group ibgp]

jfry@J1# set peer-as 14  

 

[edit protocols bgp group ibgp]

jfry@J1# set neighbor 192.168.14.4

 

[edit protocols bgp group ibgp]

jfry@J1# commit and-quit

 

Now we can check J1 for a route in BGP to R4’s loopback:

jfry@J1> show route | match BGP

4.4.4.4/32         *[BGP/170] 00:00:33, MED 0, localpref 100

 

jfry@J1>

 

Excellent! Now we should be able to PING from R1 to R4 loopback:

jfry@J1> ping 4.4.4.4 rapid

PING 4.4.4.4 (4.4.4.4): 56 data bytes

!!!!!

— 4.4.4.4 ping statistics —

5 packets transmitted, 5 packets received, 0% packet loss

round-trip min/avg/max/stddev = 4.063/10.586/20.208/7.804 ms

 

 

Good, now we need to redistribute on J1 between OSPF and BGP to get full reachability.

First up we need to configure a policy to allow OSPF into BGP

[edit]

jfry@J1# set policy-options policy-statement OSPF-to-BGP term 1 from protocol ospf area 0                           

 

[edit]

jfry@J1# set policy-options policy-statement OSPF-to-BGP term 1 then accept                      

 

And our directly attached interfaces:

[edit]

jfry@J1# set policy-options policy-statement OSPF-to-BGP term 2 from protocol direct             

 

[edit]

jfry@J1# set policy-options policy-statement OSPF-to-BGP term 2 then accept                      

 

Now we can export that statement to BGP:

[edit]

jfry@J1# set protocols bgp export OSPF-to-BGP

 

[edit]

jfry@J1# commit

commit complete

 

Ok, that should get us a full routing table on R4.  Let’s check:

R4#sh ip route

Codes: C – connected, S – static, R – RIP, M – mobile, B – BGP

       D – EIGRP, EX – EIGRP external, O – OSPF, IA – OSPF inter area

       N1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2

       E1 – OSPF external type 1, E2 – OSPF external type 2

       i – IS-IS, su – IS-IS summary, L1 – IS-IS level-1, L2 – IS-IS level-2

       ia – IS-IS inter area, * – candidate default, U – per-user static route

       o – ODR, P – periodic downloaded static route

 

Gateway of last resort is not set

 

B    192.168.12.0/24 [200/0] via 192.168.14.1, 00:07:33

     1.0.0.0/32 is subnetted, 1 subnets

B       1.1.1.1 [200/0] via 192.168.14.1, 00:07:33

B    192.168.13.0/24 [200/0] via 192.168.14.1, 00:07:33

     2.0.0.0/32 is subnetted, 1 subnets

B       2.2.2.2 [200/1] via 192.168.12.2, 00:07:33

C    192.168.14.0/24 is directly connected, Ethernet0

     3.0.0.0/32 is subnetted, 1 subnets

B       3.3.3.3 [200/1] via 192.168.13.3, 00:07:33

     4.0.0.0/32 is subnetted, 1 subnets

C       4.4.4.4 is directly connected, Loopback0

B    192.168.23.0/24 [200/2] via 192.168.13.3, 00:07:34

R4#

 

Now let’s get the BGP routes into OSPF:

Configure our policy to allow routes learned from BGP

[edit]

jfry@J1# set policy-options policy-statement BGP-to-OSPF term 1 from protocol bgp   

 

[edit]

jfry@J1# set policy-options policy-statement BGP-to-OSPF term 1 then accept         

 

And then export those routes to OSPF:

[edit]

jfry@J1# set protocols ospf export BGP-to-OSPF

 

[edit]

jfry@J1# commit

 

And now we can look at J2:

jfry@J2> show route | match OSPF

1.1.1.1/32         *[OSPF/10] 00:40:51, metric 1

3.3.3.3/32         *[OSPF/10] 00:40:36, metric 1

4.4.4.4/32         *[OSPF/150] 00:02:09, metric 0, tag 0

192.168.13.0/24    *[OSPF/10] 00:40:36, metric 2

224.0.0.5/32       *[OSPF/10] 00:41:42, metric 1

 

jfry@J2>

 

Great!

Now let’s see if J2 can ping R4 loopback:

jfry@J2> ping 4.4.4.4 source 2.2.2.2 rapid

PING 4.4.4.4 (4.4.4.4): 56 data bytes

!!!!!

— 4.4.4.4 ping statistics —

5 packets transmitted, 5 packets received, 0% packet loss

round-trip min/avg/max/stddev = 3.883/4.075/4.305/0.145 ms

 

There you go, we have connectivity!