Discovering computer networks: hands on in the Open Networking Lab
Discovering computer networks: hands on in the Open Networking Lab

Start this free course now. Just create an account and sign in. Enrol and complete the course for a free statement of participation or digital badge if available.

Free course

Discovering computer networks: hands on in the Open Networking Lab

14.4 Putting in the final static routes to make it all work

In this next section you are going to fix the network by putting in the final missing routes manually.

Watch the video below, which is about a minute long.

Routing with static routes

Download this video clip.Video player: 78_title_tbc.mp4
Skip transcript

Transcript

Let’s think about what the router is doing when the ping is being sent to 192.168.2.2. The router will look in its routing table for a match to the 192.168.2.0 network. No matching route exists, and there is no default route, so the packet will be dropped.

We can easily fix this by adding the command ip route 192.168.2.0 255.255.255.0 10.10.10.1 into Router2.

This will put a route in the routing table for the 192.168.2.0 network, again pointing it towards Router1

If we now look at the routing table of Router2, we can see that there is an entry for the 192.168.2.0 network in there now.

Let’s try the ping again and see if it works. This time we can see that it is successful and our network is complete.

End transcript
 
Interactive feature not available in single page view (see it in standard view).

We have now configured the two routers in our small network so that traffic can pass among all the host devices connected to them. To do this we have added static routing information to the routing table on each router, using the ip route command. This tells the router which interface to use to forward packets addressed to a particular network address. This information has to be entered manually by the network administrator, so this method is only useful for simple networks that rarely change.

Activity 4 Try it out

20 minutes

Open PT Anywhere [Tip: hold Ctrl and click a link to open it in a new tab. (Hide tip)] in a new tab or window so you can read these instructions.

In this activity you are going to configure static routes on each of the routers to enable the PCs connected to one router to access the PCs connected to the other router.

  1. Configure PC1 with IP address 192.168.1.2, subnet mask 255.255.255.0 and gateway 192.168.1.1.
  2. Configure PC2 with IP address 192.168.2.2, subnet mask 255.255.255.0 and gateway 192.168.2.1.
  3. Configure PC4 with IP address 172.16.2.2, subnet mask 255.255.255.0 and gateway 172.16.2.1.
  4. Configure PC3 with IP address 172.16.1.2, subnet mask 255.255.255.0 and gateway 172.16.1.1.
  5. On the routers (Router 1 and Router 2) enter the commands in the table below.
DeviceCommands to enter
Router 1

enable

configure terminal (abbreviate this to conf t)

interface gi0/0

ip address 192.168.1.1 255.255.255.0

no shutdown

 

interface gi0/1

ip address 192.168.2.1 255.255.255.0

no shutdown

 

interface gi0/2

ip address 10.10.10.1 255.255.255.0

no shutdown

Router 2

enable

configure terminal (abbreviate this to conf t)

interface gi0/0

ip address 172.16.1.1 255.255.255.0

no shutdown

 

interface gi0/1

ip address 172.16.2.1 255.255.255.0

no shutdown

 

interface gi0/2

ip address 10.10.10.2 255.255.255.0

no shutdown

  1. Verify that PC1 can ping PC2 (ping 192.168.2.2) and PC3 can ping PC4 (ping 172.16.2.2).
  2. Check to see if PC1 can ping PC3 (ping 172.16.1.2) – this should fail.
  3. On the routers (Router 1 and Router 2) enter the commands from the table below.
DeviceCommands to enter
Router 1

ip route 172.16.1.0 255.255.255.0 10.10.10.2

ip route 172.16.2.0 255.255.255.0 10.10.10.2

Router 2

ip route 192.168.1.0 255.255.255.0 10.10.10.1

ip route 192.168.2.0 255.255.255.0 10.10.10.1

  1. Check to see whether PC1 can now ping PC3 (ping 172.16.1.2) and PC4 (ping 172.16.2.2).

You have now configured static routes so that Router 1 can get to the two networks on Router 2 and vice versa. (Note: if you were to build this network from scratch in PT Anywhere then you would need to place a switch in the link between Router 1 and Router 2. You would also need to have switches in the links between each PC and router. This is because PT Anywhere does not provide the crossover cables for direct links.)

OPNL_1

Take your learning further

Making the decision to study can be a big step, which is why you'll want a trusted University. The Open University has 50 years’ experience delivering flexible learning and 170,000 students are studying with us right now. Take a look at all Open University courses.

If you are new to university level study, find out more about the types of qualifications we offer, including our entry level Access courses and Certificates.

Not ready for University study then browse over 900 free courses on OpenLearn and sign up to our newsletter to hear about new free courses as they are released.

Every year, thousands of students decide to study with The Open University. With over 120 qualifications, we’ve got the right course for you.

Request an Open University prospectus