INTERNET TEACHING LAB: VLSM LAB
INSTRUCTOR VERSION
The Internet is running out of IP address space and your network addressing scheme with all /24 subnets is wasteful. Configure routers R1,R2,R3,R4, and R5 as shown above. Create a new IP addressing scheme for the network that efficiently utilizes class C network 192.168.100.0/24. Do not worry about router R6 or the R3-R6 serial link which can be numbered as shown in the diagram. You will need to use a technique called “variable length subnet masking” (VLSM) where you subdivide your network address space into subnetworks of different sizes. When you have finished this exercise, capture the output of the following commands to prove you completed the assignment.
- show running-config
- show ip interface brief
- show cdp neighbors
- show ip ospf neighbor
- show ip route
- show ip protocol
This lab explores VLSM, an important concept to understand for efficient addressing of IP networks. For this assignment, students should ignore the addressing on router R6 and the network link R3-R6.
On each router R1 through R5, create four loopback interfaces that will support the following number of hosts.
INTERFACE |
#
HOSTS |
loopback0 |
14 hosts |
loopback1 |
6 hosts |
loopback2 |
2 hosts |
loopback3 |
2 hosts |
Begin by looking at each network and deciding how many host addresses must be supported to figure out the size of each subnet. You must do this with maximum efficiency as there no extra addresses, only exactly enough to solve this problem. For each of the five routers, select the loopback subnets such that they can be summarized. If you do not understand the concept of summarization, read up on CIDR – Classless Internet Domain Routing. You will need to use the command “ip classless” on your router to make it ignore the classfull (i.e. Class A, B, C) network mask assumptions. Since we will be using all subnets including subnet zero, you will also need the command “ip subnet-zero” in your configuration.
This lab is constructed so that there is exactly enough addresses in a class C network to address each subnet with no extras. Loopback addresses on each router must be addressed such that they can be summarized into a single summary route in a later part of this assignment. To solve this problem, first list all the networks and what is the minimal size subnet that will fit as follows.
Here is an example addressing scheme.
And a sample diagram with the networks listed. See file vlsm.pdf or vlsm-teacher.pdf for a copy of this drawing more suitable for printing.
When using variable length subnet masks in your network, you will need an IP routing protocol that supports VLSM such as OSPF (Open Shortest Path First). Configure OSPF as your only routing protocol. All FDDI, Ethernet, FastEthernet, and Serial interfaces should be in area 0. Place the loopback addresses on each of the five routers in a separate area corresponding to the router identifier. For example, the loopback addresses on router 3 should be in area 3. You may wish to use the following commands to help debug your OSPF configuration:
- show ip ospf neighbor
- show ip ospf database
- show ip ospf database-summary
- show ip ospf interface
- show ip route
- show ip route ospf
- show ip protocol
In large networks like the Internet, the number of network routes that fit in the routing table becomes a limiting factor. In the mid 1980s with the exponential growth of the Internet, many predicted the collapse of the Internet backbone due to the growing size of the routing tables. This problem was helped by the creation of CIDR – Classless Internet Domain Routing, which summarizes network blocks without regard to the classfull network designations. As of this writing, there are approximately 90,000 routes on the Internet, a number that would be much higher without CIDR. Routing protocols like OSPF are very scalable when used with hierarchical network addressing schemes that support summarization. Your routers should be advertising their loopback addresses as individual routes, each creating its own routing table entry in the routing tables of the other routers. For each of the five routers, reconfigure OSPF to advertise a single summary route for all four loopback addresses instead of advertising them individually. Because each router is participating in more than one OSPF area, it is an autonomous system boundary router (ASBR). ASBRs can summarize the routes within their non-zero areas into the core area zero to reduce the number of routes the core area zero routers must keep in their tables. Verify everything is working by studying the output of the commands “show ip route”, “show ip protocol”, “show ip ospf neighbor”, “show ip ospf database database-summary”, ”show ip ospf interface”, etc. If you simply type “show ip ospf ?” you will see the various options available.
Assign new IP addresses for your PCs using the new IP address scheme. Note that not only your IP address, but also your gateway, broadcast address, netmask, and network addresses have changed. Verify everything is reachable by scanning the lab network from a UNIX PC using the NMAP utility. This utility can be found at www.insecure.org/nmap. Be sure to only scan within the lab network because probes outside the lab will cause firewalls and intrusion detection systems to complain and are presently treated by law enforcement as attempted unauthorized access.
NMAP should be able to find all the devices. My test network had only a single PCs, so there would normally be many more devices listed corresponding to the student PCs.
Linux# nmap -v -sS 192.168.100.0/24
Host (192.168.100.1) appears to be up ... good.
Host (192.168.100.17) appears to be up ... good.
Host (192.168.100.25) appears to be up ... good.
Host (192.168.100.29) appears to be up ... good.
Host (192.168.100.33) appears to be up ... good.
Host (192.168.100.49) appears to be up ... good.
Host (192.168.100.57) appears to be up ... good.
Host (192.168.100.61) appears to be up ... good.
Host (192.168.100.65) appears to be up ... good.
Host (192.168.100.81) appears to be up ... good.
Host (192.168.100.89) appears to be up ... good.
Host (192.168.100.93) appears to be up ... good.
Host (192.168.100.97) appears to be up ... good.
Host (192.168.100.113) appears to be up ... good.
Host (192.168.100.121) appears to be up ... good.
Host (192.168.100.125) appears to be up ... good.
Host (192.168.100.129) appears to be up ... good.
Host (192.168.100.145) appears to be up ... good.
Host (192.168.100.153) appears to be up ... good.
Host (192.168.100.157) appears to be up ... good.
Host (192.168.100.161) appears to be up ... good.
Host (192.168.100.162) appears to be up ... good.
Host (192.168.100.169) appears to be up ... good.
Host (192.168.100.177) appears to be up ... good.
Host (192.168.100.185) appears to be up ... good.
Host (192.168.100.193) appears to be up ... good.
Host (192.168.100.201) appears to be up ... good.
Host (192.168.100.209) appears to be up ... good.
Host (192.168.100.217) appears to be up ... good.
Host (192.168.100.225) appears to be up ... good.
Host (192.168.100.233) appears to be up ... good.
Host (192.168.100.234) appears to be up ... good.
Host (192.168.100.235) appears to be up ... good.
Host (192.168.100.236) appears to be up ... good.
Host (192.168.100.237) appears to be up ... good.
Host (192.168.100.241) appears to be up ... good.
Host (192.168.100.242) appears to be up ... good.
Host (192.168.100.245) appears to be up ... good.
Host (192.168.100.246) appears to be up ... good.
Host (192.168.100.249) appears to be up ... good.
Host (192.168.100.250) appears to be up ... good.
Host (192.168.100.253) appears to be up ... good.
Host (192.168.100.254) appears to be up ... good.
Configure your Linux system to use GateD by modifying file /etc/gated.conf. Configure your system to use the OSPF routing protocol on its ethernet port which should be in area zero. Use the command “netstat –rn” to display your routing table. You should see routes for all networks in area zero plus the summary routes for non-area zero networks. You should also see a default route sometimes listed as ‘0.0.0.0’. Be sure to remove any static default route on your system, as you should learn the default dynamically from OSPF.
Gated can be set up creating the file /etc/gated.conf and started with “gdc start”:
[root@s1 gated]# cat /etc/gated
rip no;
ospf yes {
backbone { interface eth0 ; } ;
};
[root@s1 gated]# gdc start
gated started, pid 948
[root@s1 gated]# netstat -rn
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
224.0.0.6 127.0.0.1 255.255.255.255 UGH 0 0 0 lo
224.0.0.5 127.0.0.1 255.255.255.255 UGH 0 0 0 lo
192.168.100.162 0.0.0.0 255.255.255.255 UH 0 0 0 eth0
127.0.0.1 127.0.0.1 255.255.255.255 UGH 0 0 0 lo
192.168.100.244 192.168.100.161 255.255.255.252 UG 0 0 0 eth0
192.168.100.240 192.168.100.161 255.255.255.252 UG 0 0 0 eth0
192.168.100.252 192.168.100.161 255.255.255.252 UG 0 0 0 eth0
192.168.100.248 192.168.100.161 255.255.255.252 UG 0 0 0 eth0
192.168.100.160 0.0.0.0 255.255.255.248 U 0 0 0 eth0
192.168.100.168 192.168.100.161 255.255.255.248 UG 0 0 0 eth0
192.168.100.176 192.168.100.161 255.255.255.248 UG 0 0 0 eth0
192.168.100.184 192.168.100.161 255.255.255.248 UG 0 0 0 eth0
192.168.100.192 192.168.100.161 255.255.255.248 UG 0 0 0 eth0
192.168.100.200 192.168.100.161 255.255.255.248 UG 0 0 0 eth0
192.168.100.208 192.168.100.161 255.255.255.248 UG 0 0 0 eth0
192.168.100.216 192.168.100.161 255.255.255.248 UG 0 0 0 eth0
192.168.100.224 192.168.100.161 255.255.255.248 UG 0 0 0 eth0
192.168.100.232 192.168.100.161 255.255.255.248 UG 0 0 0 eth0
192.168.100.0 192.168.100.161 255.255.255.224 UG 0 0 0 eth0
192.168.100.32 192.168.100.161 255.255.255.224 UG 0 0 0 eth0
192.168.100.64 192.168.100.161 255.255.255.224 UG 0 0 0 eth0
192.168.100.96 192.168.100.161 255.255.255.224 UG 0 0 0 eth0
192.168.100.128 192.168.100.161 255.255.255.224 UG 0 0 0 eth0
192.168.36.0 192.168.100.161 255.255.255.0 UG 0 0 0 eth0
127.0.0.0 - 255.0.0.0 ! - - - -
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 192.168.100.161 0.0.0.0 UG 0 0 0 eth0
[root@s1 gated]#
You can also dump GateD’s internal database with “gdc dump” which creates a text file by default on file /var/gated/gated_dump.