Time for some multi-protocol labs!
Ok, we have done RIP and we have done OSPF. Now time to put them together!
For this lab the Juniper devices will be in OSPF Area 0 and the Cisco device will be in RIP. J1 will sit in both RIP and OSPF and handle the redistribution between the protocols.
First up, we need to restore R4 config to our base and remove fe-0/0/7 from Area 1 on J1.
R4:
R4#configure replace flash:base.txt
And J1:
[edit]
jfry@J1# delete protocols ospf area 1 nssa
[edit]
jfry@J1# delete protocols ospf area 1 interface fe-0/0/7
[edit]
jfry@J1# commit and-quit
Ok, that is done. Time to configure RIP on R4 and J1.
R4:
R4#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R4(config)#router rip
R4(config-router)#ver 2
R4(config-router)#no au
R4(config-router)#net 192.168.14.0
R4(config-router)#net 4.0.0.0
R4(config-router)#^Z
R4#
Ok, now can configure J1 for RIP to R4, also we will advertise our Loopback to R4.
Ok, since we know we need to advertise our loopback to R4, we should create a prefix list to permit that route
[edit]
jfry@J1# set policy-options prefix-list loopback 1.1.1.1/32
Ok, time to create our policy statements. We will use terms here since we will be adding more to these later on in this lab.
[edit]
jfry@J1# edit policy-options policy-statement FromR4 term 1
[edit policy-options policy-statement FromR4 term 1]
jfry@J1# set from protocol rip
[edit policy-options policy-statement FromR4 term 1]
jfry@J1# set then accept
[edit policy-options policy-statement FromR4 term 1]
jfry@J1# up
[edit policy-options policy-statement FromR4]
jfry@J1# up
[edit policy-options]
jfry@J1# edit policy-statement ToR4
[edit policy-options policy-statement ToR4]
jfry@J1# set term 1 from protocol direct
[edit policy-options policy-statement ToR4]
jfry@J1# set term 1 from prefix-list loopback
[edit policy-options policy-statement ToR4]
jfry@J1# set term 1 then accept
[edit policy-options policy-statement ToR4]
jfry@J1# up
Ok, time to check our policy-options section to see what we have so far and make sure it all looks right.
[edit policy-options]
jfry@J1# show
prefix-list loopback {
1.1.1.1/32;
}
policy-statement FromR4 {
term 1 {
from protocol rip;
then accept;
}
}
policy-statement ToR4 {
term 1 {
from {
protocol direct;
prefix-list loopback;
}
then accept;
}
}
[edit policy-options]
jfry@J1# top
Now to configure RIP:
[edit]
jfry@J1# set protocols rip group Fryguy neighbor fe-0/0/7.0
And our export/import groups:
[edit]
jfry@J1# set protocols rip group Fryguy export ToR4
[edit]
jfry@J1# set protocols rip group Fryguy import FromR4
Ok, time to look over all the changes before we commit them:
[edit]
jfry@J1# show | compare
[edit]
+ protocols {
+ rip {
+ group Fryguy {
+ export ToR4;
+ import FromR4;
+ neighbor fe-0/0/7.0;
+ }
+ }
+ }
+ policy-options {
+ prefix-list loopback {
+ 1.1.1.1/32;
+ }
+ policy-statement FromR4 {
+ term 1 {
+ from protocol rip;
+ then accept;
+ }
+ }
+ policy-statement ToR4 {
+ term 1 {
+ from {
+ protocol direct;
+ prefix-list loopback;
+ }
+ then accept;
+ }
+ }
+ }
[edit]
jfry@J1# commit and-quit
commit complete
Exiting configuration mode
Ok, now let’s take a look at the routing table on R4:
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
1.0.0.0/32 is subnetted, 1 subnets
R 1.1.1.1 [120/1] via 192.168.14.1, 00:00:03, Ethernet0
C 192.168.14.0/24 is directly connected, Ethernet0
4.0.0.0/32 is subnetted, 1 subnets
C 4.4.4.4 is directly connected, Loopback0
R4#
Perfect, we have a route to J1 Loopback.
Let’s see what J1 shows for routes for RIP
jfry@J1> show route protocol rip
inet.0: 9 destinations, 9 routes (9 active, 0 holddown, 0 hidden)
+ = Active Route, – = Last Active, * = Both
4.4.4.4/32 *[RIP/100] 01:39:28, metric 2, tag 0
> to 192.168.14.4 via fe-0/0/7.0
224.0.0.9/32 *[RIP/100] 00:45:27, metric 1
MultiRecv
jfry@J1>
Perfect, we have a route to R4 loopback.
Time to PING!
jfry@J1> ping 4.4.4.4 source 1.1.1.1 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.119/4.536/4.882/0.268 ms
jfry@J1>
Excellent, we have RIP connectivity. Time for OSPF!
First up, we can quickly configure J2 and J3 for OSPF area 0
J2:
Instead of using a single line, I will actually edit the protocols area. It accomplishes the same things, just uses less repetitive commands
jfry@J2> edit
Entering configuration mode
[edit]
jfry@J2# edit protocols ospf area 0
As you can see, the top edit line actually changes to the context you are editing.
[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 ge-0/0/0
[edit protocols ospf area 0.0.0.0]
jfry@J2# commit and-quit
commit complete
Exiting configuration mode
…and J3:
jfry@J3> edit
Entering configuration mode
[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# commit and-quit
commit complete
Exiting configuration mode
Now we can do 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 fe-0/0/2
[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# commit and-quit
Ok, we should have OSPF connectivity between J1, J2, and J3 now
jfry@J1> show route protocol ospf
inet.0: 13 destinations, 13 routes (13 active, 0 holddown, 0 hidden)
+ = Active Route, – = Last Active, * = Both
2.2.2.2/32 *[OSPF/10] 00:00:17, metric 1
> to 192.168.12.2 via ge-0/0/0.0
3.3.3.3/32 *[OSPF/10] 00:00:17, metric 1
> to 192.168.13.3 via fe-0/0/2.0
192.168.23.0/24 *[OSPF/10] 00:00:17, metric 2
> to 192.168.12.2 via ge-0/0/0.0
to 192.168.13.3 via fe-0/0/2.0
224.0.0.5/32 *[OSPF/10] 00:00:27, metric 1
MultiRecv
jfry@J1>
Good.
Now we can look at the routing table on R1, R4, and R2:
R4:
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
1.0.0.0/32 is subnetted, 1 subnets
R 1.1.1.1 [120/1] via 192.168.14.1, 00:00:13, Ethernet0
C 192.168.14.0/24 is directly connected, Ethernet0
4.0.0.0/32 is subnetted, 1 subnets
C 4.4.4.4 is directly connected, Loopback0
R4#
J1:
jfry@J1> show route
inet.0: 13 destinations, 13 routes (13 active, 0 holddown, 0 hidden)
+ = Active Route, – = Last Active, * = Both
1.1.1.1/32 *[Direct/0] 05:13:21
> via lo0.0
2.2.2.2/32 *[OSPF/10] 00:00:34, metric 1
> to 192.168.12.2 via ge-0/0/0.0
3.3.3.3/32 *[OSPF/10] 00:00:34, metric 1
> to 192.168.13.3 via fe-0/0/2.0
4.4.4.4/32 *[RIP/100] 01:48:50, metric 2, tag 0
> to 192.168.14.4 via fe-0/0/7.0
192.168.12.0/24 *[Direct/0] 05:12:17
> via ge-0/0/0.0
192.168.12.1/32 *[Local/0] 05:12:43
Local via ge-0/0/0.0
192.168.13.0/24 *[Direct/0] 05:12:38
> via fe-0/0/2.0
192.168.13.1/32 *[Local/0] 05:12:42
Local via fe-0/0/2.0
192.168.14.0/24 *[Direct/0] 05:12:38
> via fe-0/0/7.0
192.168.14.1/32 *[Local/0] 05:12:42
Local via fe-0/0/7.0
192.168.23.0/24 *[OSPF/10] 00:00:34, metric 2
> to 192.168.12.2 via ge-0/0/0.0
to 192.168.13.3 via fe-0/0/2.0
224.0.0.5/32 *[OSPF/10] 00:00:44, metric 1
MultiRecv
224.0.0.9/32 *[RIP/100] 00:00:44, metric 1
MultiRecv
jfry@J1>
and J2:
jfry@J2> show route
inet.0: 8 destinations, 8 routes (8 active, 0 holddown, 0 hidden)
+ = Active Route, – = Last Active, * = Both
2.2.2.2/32 *[Direct/0] 05:14:11
> via lo0.0
3.3.3.3/32 *[OSPF/10] 05:12:21, metric 1
> to 192.168.23.3 via ge-0/0/1.0
192.168.12.0/24 *[Direct/0] 05:13:11
> via ge-0/0/0.0
192.168.12.2/32 *[Local/0] 05:13:16
Local via ge-0/0/0.0
192.168.13.0/24 *[OSPF/10] 00:01:27, metric 2
> to 192.168.12.1 via ge-0/0/0.0
to 192.168.23.3 via ge-0/0/1.0
192.168.23.0/24 *[Direct/0] 05:13:11
> via ge-0/0/1.0
192.168.23.2/32 *[Local/0] 05:13:16
Local via ge-0/0/1.0
224.0.0.5/32 *[OSPF/10] 05:14:13, metric 1
MultiRecv
jfry@J2>
There, as you can see R4 only has a route to J1 loopback; J1 has a route to everyone’s loopback, and J2 only had a route to J1 and J3 loopback.
Now we can configure J1 to redistribute (aka import/export) the routes as we see fit.
To do this we need to edit our RIP import/export statement and create an import statement for OSPF.
First up, lets create a policy statement called ToOSPF that will accept anything from the RIP protocol.
jfry@J1> edit
Entering configuration mode
[edit]
jfry@J1# set policy-options policy-statement ToOSPF term 1 from protocol rip
[edit]
jfry@J1# set policy-options policy-statement ToOSPF term 1 then accept
Ok, now we can edit our policy-statement ToR4 and add term 2 to accept routes from OSPF area 0
[edit]
jfry@J1# set policy-options policy-statement ToR4 term 2 from protocol ospf area 0.0.0.0
[edit]
jfry@J1# set policy-options policy-statement ToR4 term 2 then accept
Now we need to apply our export statement to send the routes to OSPF
[edit]
jfry@J1# set protocols ospf export ToOSPF
We do not need to edit RIP import/export since we just added a second term to the existing policy!
Quick look at what we are doing:
[edit]
jfry@J1# show | compare
[edit protocols ospf]
+ export ToOSPF;
[edit policy-options]
+ policy-statement ToOSPF {
+ term 1 {
+ from protocol rip;
+ then accept;
+ }
+ }
[edit policy-options policy-statement ToR4]
term 1 { … }
+ term 2 {
+ from {
+ protocol ospf;
+ area 0.0.0.0;
+ }
+ then accept;
+ }
And run a quick check:
[edit]
jfry@J1# commit check
configuration check succeeds
And Commit the changes!
[edit]
jfry@J1# commit and-quit
Now we can check the routes on R4 and J3:
R4:
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
1.0.0.0/32 is subnetted, 1 subnets
R 1.1.1.1 [120/1] via 192.168.14.1, 00:00:14, Ethernet0
2.0.0.0/32 is subnetted, 1 subnets
R 2.2.2.2 [120/1] via 192.168.14.1, 00:00:14, Ethernet0
C 192.168.14.0/24 is directly connected, Ethernet0
3.0.0.0/32 is subnetted, 1 subnets
R 3.3.3.3 [120/1] via 192.168.14.1, 00:00:14, Ethernet0
4.0.0.0/32 is subnetted, 1 subnets
C 4.4.4.4 is directly connected, Loopback0
R 192.168.23.0/24 [120/1] via 192.168.14.1, 00:00:14, Ethernet0
R4#
J3:
jfry@J3> show route
inet.0: 9 destinations, 9 routes (9 active, 0 holddown, 0 hidden)
+ = Active Route, – = Last Active, * = Both
2.2.2.2/32 *[OSPF/10] 06:18:01, metric 1
> to 192.168.23.2 via fe-0/0/1.0
3.3.3.3/32 *[Direct/0] 06:21:07
> via lo0.0
4.4.4.4/32 *[OSPF/150] 00:01:39, metric 2, tag 0
> to 192.168.13.1 via fe-0/0/2.0
192.168.12.0/24 *[OSPF/10] 00:21:05, metric 2
to 192.168.23.2 via fe-0/0/1.0
> to 192.168.13.1 via fe-0/0/2.0
192.168.13.0/24 *[Direct/0] 06:19:15
> via fe-0/0/2.0
192.168.13.3/32 *[Local/0] 06:20:41
Local via fe-0/0/2.0
192.168.23.0/24 *[Direct/0] 06:18:54
> via fe-0/0/1.0
192.168.23.3/32 *[Local/0] 06:20:41
Local via fe-0/0/1.0
224.0.0.5/32 *[OSPF/10] 06:21:08, metric 1
MultiRecv
jfry@J3>
And now we can test PING from R3 loopback to R4 loopback:
jfry@J3> ping 4.4.4.4 source 3.3.3.3 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.411/8.504/27.947/9.724 ms
jfry@J3>
There you have it, OSPF <-> RIP route redistribution!