The practical guide to practical networking – Part 3 – Static routing

What are we doing today?

Hello everyone and welcome back to the practical guide to practical networking, it is fantastic to see a returning crowd! Today we are going to get crazy and try to communicate to another subnet using the most basic and manual form of routing, called static routes.

Tell us more about static routing!

The reason we will be going through static routing is that it is still used heavily today as it still very valuable, even though it is not dynamic and network changes need to be reconfigured manually. Let’s go through the reasons you would use a static route:

  • Static routing can be used to define an exit point, the reason you would do this is you don’t need a router to learn thousands of routes especially it is a spoke. So, we use static routing to say, if you don’t know where you are going, then go out this interface. This static route will often be referred to as a “default route.”
  • Static routing could be used in a very small network that only require one or two routes to be used and sometimes it is easier to setup then dynamic routing.
  • Static routing can be used as a backup for dynamic routing, or a fail-safe.
  • (ADVANCED USAGE) It can be used to help routes get from one routing protocol to another, often referred to as “routing redistribution.”

The pros and cons

Pros:

  • Static routing is really light on the CPU and because its
    manually configured, it does not produce traffic to other networks or routers.
  • Static routing cannot be interfered with which means you
    have full control over the traffic.
  • Static routing is super easy to configure on small networks,
    as you are soon to find out.

Cons:

  • As I keep mentioning, static routes are manually created, which means they are subject to human error.
  • Static routes are surprisingly static, which means they are not fault tolerant, they cannot learn a new path or way of doing things.
  • Static routes by default take preference over other routing protocol, so if you configure a routing path that would take longer than the dynamically learned route, then the data will be going on a journey.
  • The management overhead grows, every time you need to add a new network.

Getting started with static routing

This is going to be nice and easy as static routes are entered at the global configuration stage, so no menus to jump through. Static routes are written as “who you are looking for” to “where to find them” such as Ip route [network] [netmask] [next hop].

Lets look at an example:

ip route 192.168.0.0 255.255.255.0 172.16.10.1 

What this command is saying is if you are looking for the network 192.168.0.0/24 then go talk to the router behind 172.16.10.1, and this rule applies for any network on the router with the static route on it.

The full command looks like this:

Router1# configure terminal
Router1(config)# ip route 192.168.0.0 255.255.255.0 172.16.10.1
Router1(config)# end
Router1# write memory
IT networking static route example

Adding an IP address to an interface

Just like we added the IP address to the
loopback interface before this will be quite similar. Firstly, you will need to
find out what interface you are applying the IP address to and in this example
I say you will be connecting to 0/0. You now need to find out what type of
interface is it such as a ethernet, gigabit or fast ethernet and so on. To do
this you are going to have to end a discovery command.

Router1# show ip interface brief

Important things to note about the interface screen is that it can give you a quick indication of the health of the interface.

Link status = Administratively down / Protocol = Down

This means that the interface is in a shutdown state. This will be the default state for many interfaces not in use as it prevents someone from just plugging something in.

Link status = Down / Protocol = Down

Likely no cable connected

Link status = Up / Protocol = Down

Cable connected but a misconfiguration between devices

Link status = Up / Protocol = Up

Devices are connected and sending keep alives. This does not mean you have configured the right IP addresses, just that it is communicating at a layer 2 (MAC address) level.

Ok, now back to the interface, as can see in the above screen shot, this is an ethernet interface. Now that we know this information we can add the IP address details and turn on the interface.

Router1# configure terminal
Router1(config)# interface ethernet 0/0
Router1(config-if)# ip address 192.168.0.1 255.255.255.0
Router1(config-if)# no shutdown
Router1(config-if)# end
Router1# write memory

Time for practical Lab 2!

This practical is a 5 step practical.

Step 1. Create the basic configuration learnt in the last lesson on both devices

Step 2. Add the IP addresses to the loopback interface and the ethernet interface

Step 3. Add the static routing

Step 4. Ping from the loop back address of 1 router to the other and then the other way

            Command: Router1# ping 172.18.0.1

            (Important note: the first ping may at first fail as you can see in the below screen shot)

Step 5. Celebrate a job well done!!!

Lab configuration

My configuration to compare yours against

WYWM-Lab2-R1

Building
configuration...
Current
configuration : 1410 bytes
!
version
12.4
service
timestamps debug datetime msec
service
timestamps log datetime msec
service
password-encryption
!
hostname
WYWM-Lab2-R1
!
boot-start-marker
boot-end-marker
!
!
no
aaa new-model
memory-size
iomem 15
no
ip icmp rate-limit unreachable
ip
cef
!
!
!
!
no
ip domain lookup
ip
domain name wywm.local
!
multilink
bundle-name authenticated
!
!
!
!
!
username
Fred privilege 15 secret 5 $1$9kEF$e36dSfTdJT6vOlHWGMmsR1
archive
 log config
  hidekeys
!
!
!
!
ip
tcp synwait-time 5
!
!
!
interface
Loopback100
 ip address 172.16.0.1 255.255.255.255
!
interface
Ethernet0/0
 ip address 192.168.0.1 255.255.255.0
 half-duplex
!
interface
Serial0/0
 no ip address
 shutdown
!
interface
Serial0/1
 no ip address
 shutdown
!
interface
Ethernet1/0
 no ip address
 shutdown
 half-duplex
!
interface
Ethernet1/1
 no ip address
 shutdown
 half-duplex
!
interface
Ethernet1/2
 no ip address
 shutdown
 half-duplex
!
interface
Ethernet1/3
 no ip address
 shutdown
 half-duplex
!
ip
forward-protocol nd
ip
route 172.18.0.1 255.255.255.255 192.168.0.2
ip
route 192.168.0.0 255.255.255.0 172.16.10.1
!
!
no
ip http server
no
ip http secure-server
!
no
cdp log mismatch duplex
!
!
!
!
control-plane
!         
!
!
line
con 0
 exec-timeout 0 0
 privilege level 15
 logging synchronous
 login local
line
aux 0
 exec-timeout 0 0
 privilege level 15
 logging synchronous
line
vty 0 4
 login local
 transport input ssh
!
!
end

WYWM-Lab2-R2
Building configuration...
Current
configuration : 1366 bytes
!
version
12.4
service
timestamps debug datetime msec
service
timestamps log datetime msec
no
service password-encryption
!
hostname
WYWM-Lab2-R2
!
boot-start-marker
boot-end-marker
!
!
no
aaa new-model
memory-size
iomem 15
no
ip icmp rate-limit unreachable
ip
cef
!
!
!
!
no
ip domain lookup
ip
domain name wywm.local
!
multilink
bundle-name authenticated
!
!
!
!
!
username
Fred privilege 15 secret 5 $1$O/an$3MkMXr2r7d.cLKhlgEowO1
archive
 log config
  hidekeys
!
!
!
!
ip
tcp synwait-time 5
!
!
!
interface
Loopback100
 ip address 172.18.0.1 255.255.255.255
!
interface
Ethernet0/0
 ip address 192.168.0.2 255.255.255.0
 half-duplex
!
interface
Serial0/0
 no ip address
 shutdown
!
interface
Serial0/1
 no ip address
 shutdown
!
interface
Ethernet1/0
 no ip address
 shutdown
 half-duplex
!
interface
Ethernet1/1
 no ip address
 shutdown
 half-duplex
!
interface
Ethernet1/2
 no ip address
 shutdown
 half-duplex
!
interface
Ethernet1/3
 no ip address
 shutdown
 half-duplex
!
ip
forward-protocol nd
ip
route 172.16.0.1 255.255.255.255 192.168.0.1
!
!
no
ip http server
no
ip http secure-server
!
no
cdp log mismatch duplex
!
!
!
!
control-plane
!
!         
!
line
con 0
 exec-timeout 0 0
 privilege level 15
 logging synchronous
 login local
line
aux 0
 exec-timeout 0 0
 privilege level 15
 logging synchronous
line
vty 0 4
 login local
 transport input ssh
!
!
end

Help out a mate

Help a friend kickstart their career through thought leading digital career content. Everything from Data Analytics through to Cyber Security. 

Share on facebook
Share on linkedin
Share on twitter
Share on reddit