Feature Lab Friday #1 – Static Routes

In our first Feature Lab Friday, we’re going to take a look at a JNCIA-level topic: static routes. These are very simple to set up. We’ll cover basic static routes. During a later Feature Lab Friday segment, we will cover the resolve option as well as default routes.

To get started, start up two of your routers using the baseline configuration from this post. This should give you a single interface with an IP address that you can SSH to for remote access. Here’s an outline of the rest of this lab:

  1. Configure em1 on each router with a /30 subnet mask
  2. Verify Connectivity
    1. Ping from R1 to em1 on R2.
    2. Ping from R2 to em1 on R1.
  3. Create a static route on R1 to the subnet on R2’s em0 interface.
  4. Create a static route on R2 to the subnet on R1’s em0 interface.
  5. Verify Connectivity
    1. Ping from R1 to em0 on R2.
    2. Ping from R2 to em0 on R1.

Configure em1 on Each Router

We’re going to configure each router’s em1 interface with a /30 subnet mask (because this will be a point-to-point link and we don’t want to waste IP addresses). We’re going to use a simple 192.168.100.0/30 subnet for this configuration.

pkttlk@Junos-Olive-1> show configuration interfaces em1 
unit 0 {
    family inet {
        address 192.168.100.1/30;
    }
}

pkttlk@Junos-Olive-2> show configuration interfaces em1 
unit 0 {
    family inet {
        address 192.168.100.2/30;
    }
}

Above, you can see our configured IP addresses. R1 has an IP address of 192.168.100.1/30 and R2 has an IP address of 192.168.100.2/30. This offers a point-to-point, physically connected link located within the same subnet. Therefore, it should be possible to pass traffic between these two interfaces (but not to any other interfaces or to another router).

Set Commands

Now, here are the commands we used to turn our interfaces up (also called configuring the interfaces). I’m going to assume you’ve logged in as the user configured in this post and will display the user@host information now.

pkttlk@Junos-Olive-1> set interfaces em1 unit 0 family inet address 192.168.100.1/30
pkttlk@Junos-Olive-2> set interfaces em1 unit 0 family inet address 192.168.100.2/30

Verifying Connectivity

Now we need to be sure we can pass traffic between these devices. We’ll start from R1 and ping the IP address we configured on R2’s em1 interface (192.168.100.2). After we’ve verified that we can reach em1 on R2, we’ll ssh into R2 (which itself will verify connectivity as well as verifying our ssh service and user are set up correctly). Finally, we’ll ping R1’s em1 interface by pinging 192.168.100.1.

pkttlk@Junos-Olive-1> ping rapid 192.168.100.2
PING 192.168.100.2 (192.168.100.2): 56 data bytes
!!!!!
— 192.168.100.2 ping statistics —
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max/stddev = 0.443/0.624/1.065/0.230 ms

pkttlk@Junos-Olive-1> ssh 192.168.100.2
pkttlk@192.168.100.2’s password:
— JUNOS 9.6R1.13 built 2009-08-01 09:02:46 UTC
pkttlk@Junos-Olive-2> ping rapid 192.168.100.1
PING 192.168.100.1 (192.168.100.1): 56 data bytes
!!!!!
— 192.168.100.1 ping statistics —
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max/stddev = 0.397/0.862/2.007/0.584 ms

It should be pretty clear from here that we have connectivity, so our next step is going to be to actually configure our static routes from R1 to R2’s em0, and from R2 to R1’s em0.

Configuring Static Routes

pkttlk@Junos-Olive-1# show routing-options   
static {
    route 192.168.1.0/24 next-hop 192.168.100.2;
}

root@Junos-Olive-2# show routing-options 
static {
    route 192.168.0.0/24 next-hop 192.168.100.1;
}

This is pretty straightforward. This config says that under the edit routing-options static hierarchy, we’re going to have a static route to the 192.168.1.0/24 subnet, and that we’re going to reach that subnet through the next-hop address of 192.168.100.2, which if you remember is the IP address we configured on interface em1 on R2. The second section is the same, except in reverse: it shows the route to the 192.168.0.0/24 subnet (em0 on R1) through the next-hop of 192.168.100.1, which is em1 on R1.

Set Commands

Configuring these routes is just as easy as it looks, and we’ll do it with only one set command per router:

pkttlk@Junos-Olive-1# set routing-options static route 192.168.1.0/24 next-hop 192.168.100.2
pkttlk@Junos-Olive-2# set routing-options static route 192.168.0.0/24 next-hop 192.168.100.1

Verify Static Route Connectivity

We’re pretty much finished. Our last step is to verify connectivity, which I would say is even more important than entering commands to configure the router! What good is it if you don’t know you’ve accomplished your goal, after all? So here’s how we’re going to test test this. We’ll start on R1 and ping to 192.168.1.1. Once we’ve verified we can reach that host, we’ll ssh to R2 (via 192.168.100.2) and ping to 192.168.0.1. Once we know that this process is successful, we will know that we can pass traffic between the 192.168.0.0/24 and 192.168.1.0/24 subnets. So let’s do that now!

pkttlk@Junos-Olive-1> ping rapid 192.168.1.1
PING 192.168.1.1 (192.168.1.1): 56 data bytes
!!!!!
— 192.168.1.1 ping statistics —
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max/stddev = 0.443/0.624/1.065/0.230 ms

pkttlk@Junos-Olive-1> ssh 192.168.100.2
pkttlk@192.168.100.2’s password:
— JUNOS 9.6R1.13 built 2009-08-01 09:02:46 UTC
pkttlk@Junos-Olive-2> ping rapid 192.168.0.1
PING 192.168.0.1 (192.168.0.1): 56 data bytes
!!!!!
— 192.168.0.1 ping statistics —
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max/stddev = 0.397/0.862/2.007/0.584 ms

Conclusion

And that is it. Configuration complete and successful! Stay tuned for Part 2, which will cover default routes and add a third router to study resolve.

[edit]
Part 2 to come on Saturday. Stayed up studying instead of writing.
[/edit]

[edit 2]
Part 2 cancelled due to time. It is extensive enough to be featured by itself, so we will cover it at a later date.
[/edit]

Advertisements
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: