Friday 22 February 2013

Juniper JNCIA-Junos - Routing Fundamentals

Starting with Juniper’s second PDF, we can make a new practice lab for the next 3 chapters. This lab is a bit more advanced than the previous one in order to test the OSPF routing protocol. You will need 3 Juniper routers, here are the connections:
  • JUNOS1, interface em0 <-> JUNOS2, interface em0
  • JUNOS1, interface em1 <-> JUNOS2, interface em1
  • JUNOS1, interface em4 <-> JUNOS3, interface em4
  • JUNOS2, interface em3 <-> JUNOS3, interface em3
Make sure the routers have a factory default configuration (use the load factory-default command if you need to). Then set the host-name, root password and IP addresses for each router, to save time you can copy and paste the following commands (don’t forget to commit):

JUNOS1

set system host-name JUNOS1
set interfaces em0 unit 0 family inet address 172.30.25.2/30
set interfaces em1 unit 0 family inet address 172.30.25.6/30
set interfaces em3 unit 0 family inet address 192.168.1.1/24
set interfaces em4 unit 0 family inet address 172.30.25.9/30
set interfaces lo0 unit 0 family inet address 10.1.1.1/24
set system root-authentication plain-text-password

JUNOS2

set system host-name JUNOS2
set interfaces em0 unit 0 family inet address 172.30.25.1/30
set interfaces em1 unit 0 family inet address 172.30.25.5/30
set interfaces em3 unit 0 family inet address 172.30.25.13/30
set interfaces lo0 unit 0 family inet address 10.2.2.2/24
set system root-authentication plain-text-password

JUNOS3

set system host-name JUNOS3
set interfaces lo0 unit 0 family inet address 10.3.3.3/24
set interfaces em3 unit 0 family inet address 172.30.25.14/30
set interfaces em4 unit 0 family inet address 172.30.25.10/30
set system root-authentication plain-text-password
If everything went fine, the topology for your new lab should be like in the following image. Please read chapter one of Juniper’s second PDF before continuing.

Exercise 1 – Static routing

On JUNOS1, configure a default static route (0.0.0.0/0) to next-hop 172.30.25.1.

Solution

Add a second default static route with a preference of 7 to next-hop 172.30.25.5 that should be used as a backup (floating static route) and commit.

Solution

Let’s check that everything is working as expected:
root@JUNOS1# run show route
inet.0: 5 destinations, 5 routes (5 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

0.0.0.0/0          *[Static/5] 00:01:54
> to 172.30.25.1 via em0.0
                    [Static/7] 00:00:13
> to 172.30.25.5 via em1.0
...
[edit]
root@JUNOS1# run ping 10.2.2.2
PING 10.2.2.2 (10.2.2.2): 56 data bytes
64 bytes from 10.2.2.2: icmp_seq=0 ttl=64 time=1.650 ms
64 bytes from 10.2.2.2: icmp_seq=1 ttl=64 time=1.272 ms
root@JUNOS2# run monitor traffic interface em0
...
19:33:03.526742 172.30.25.2 > 10.2.2.2: ICMP echo request, id 16648, seq 0, length 64
[edit]
root@JUNOS1# deactivate interfaces em0
[edit]
root@JUNOS1# commit
commit complete
[edit]
root@JUNOS1# run ping 10.2.2.2
PING 10.2.2.2 (10.2.2.2): 56 data bytes
64 bytes from 10.2.2.2: icmp_seq=0 ttl=64 time=3.247 ms
64 bytes from 10.2.2.2: icmp_seq=1 ttl=64 time=0.658 ms
[edit]
root@JUNOS2# run monitor traffic interface em1
...
19:35:30.376370 172.30.25.6 > 10.2.2.2: ICMP echo request, id 14090, seq 7, length 64

Exercise 2 – OSPF routing

Configure OSPF routing on all interfaces connecting routers and their loopbacks but no adjacency should be formed on interfaces connecting to the 172.30.25.0/30 subnet (172.30.25.1 and 172.30.25.2).

Solution

JUNOS1

set protocols ospf area 0.0.0.0 interface em0.0 passive
set protocols ospf area 0.0.0.0 interface em1.0
set protocols ospf area 0.0.0.0 interface lo0.0
set protocols ospf area 0.0.0.0 interface em3.0
set protocols ospf area 0.0.0.0 interface em4.0

JUNOS2

set protocols ospf area 0.0.0.0 interface em0.0 passive
set protocols ospf area 0.0.0.0 interface em1.0
set protocols ospf area 0.0.0.0 interface lo0.0
set protocols ospf area 0.0.0.0 interface em3.0

JUNOS3

set protocols ospf area 0.0.0.0 interface em3.0
set protocols ospf area 0.0.0.0 interface em4.0
set protocols ospf area 0.0.0.0 interface lo0.0
Let’s check that everything is working as expected:
[edit]
root@JUNOS1# run show ospf neighbor
Address          Interface              State     ID               Pri  Dead
172.30.25.5      em1.0                  Full      10.2.2.2         128    34
172.30.25.10     em4.0                  Full      10.3.3.3         128    32
[edit]
root@JUNOS2# run show ospf neighbor
Address          Interface              State     ID               Pri  Dead
172.30.25.6      em1.0                  Full      10.1.1.1         128    36
172.30.25.14     em3.0                  Full      10.3.3.3         128    38
[edit]
root@JUNOS3# run show ospf neighbor
Address          Interface              State     ID               Pri  Dead
172.30.25.13     em3.0                  Full      10.2.2.2         128    36
172.30.25.9      em4.0                  Full      10.1.1.1         128    35
root@JUNOS3# run show route protocol ospf
...
10.1.1.1/32        *[OSPF/10] 00:04:11, metric 1
...
10.2.2.2/32        *[OSPF/10] 00:04:11, metric 1
...
192.168.1.0/24     *[OSPF/10] 00:00:02, metric 2
> to 172.30.25.9 via em4.0
root@JUNOS3# run traceroute 192.168.1.1
traceroute to 192.168.1.1 (192.168.1.1), 30 hops max, 40 byte packets
1  192.168.1.1 (192.168.1.1)  1.611 ms  0.588 ms  1.362 ms
[edit]
root@JUNOS3# deactivate interfaces em4
[edit]
root@JUNOS3# commit
commit complete
[edit]
root@JUNOS3# run traceroute 192.168.1.1

traceroute to 192.168.1.1 (192.168.1.1), 30 hops max, 40 byte packets
1  172.30.25.13 (172.30.25.13)  2.316 ms  1.479 ms  0.882 ms
2  192.168.1.1 (192.168.1.1)  1.283 ms  1.300 ms  1.129 ms
Finally, don’t forget to reactivate interface em4 and commit:
[edit]
root@JUNOS3# activate interfaces em4

[edit]
root@JUNOS3# commit
commit complete

No comments:

Post a Comment