Static Routing Exercise: Classroom Addressing Plan

Our entire address space is 192.188.58.64/26

192.188.58.64 = 11000000 10111100 00111010 01000000
Prefix /26      +++++++++++++++++++++++++++++
Host part                                    xxxxxx

Total number of IPs = 2^6 = 64  (000000 - 111111)

Lowest IP:      11000000 10111100 00111010 01000000 = 192.188.58.64
Highest IP:     11000000 10111100 00111010 01111111 = 192.188.58.127

We have previously subdivided it like this:
  192.188.58.64/26  split into 192.188.58.64/27
                               192.188.58.96/27

+-------------------------------+-------------------------------+
| 64             -           95 | 96            -           127 |
+-------------------------------+-------------------------------+
         for classroom                  for instructors

Note that
  192.188.58.64  = network address
  192.188.58.95  = broadcast address
  192.188.58.xx  = host address (65-94)
  /27 = netmask 255.255.255.224

For this exercise, we will divide this up even more.

+---------------+---+---+---+---+---+---+---+---+---+---+---+---+
| 64    -    79 |80 |84 |88 |92 |96 |100|104|108|112|116|120|124|
|               |83 |87 |91 |95 |99 |103|107|111|115|119|123|127|
+---------------+---+---+---+---+---+---+---+---+---+---+---+---+
     backbone          separate subnet for each desk

TABLE ONE

192.188.58.64/28	Classroom backbone
----------------	------------------
192.188.58.65		router
192.188.58.66		PC15 eth0
192.188.58.67		PC29 eth0
192.188.58.68		PC5 eth0
192.188.58.69		PC23 eth0
192.188.58.70		PC9 eth0
192.188.58.71		PC7 eth0
192.188.58.72		PC13 eth0
192.188.58.73		PC17 eth0
192.188.58.74		PC3 eth0
192.188.58.75		PC27 eth0
192.188.58.76		PC21 eth0
192.188.58.77		PC11 eth0
192.188.58.78		PC25 eth0

Q. What is the netmask for a /28 network? ______________________

(PC19 is not used in this exercise; unplug eth0 and join another group)

There are separate /30 networks for the *private* links between machines
on each desktop

TABLE TWO

192.188.58.80/30	PC3 (eth1), PC4 (eth0)
192.188.58.84/30	PC5, PC6
192.188.58.88/30	PC7, PC8
192.188.58.92/30	PC9, PC10
192.188.58.96/30	PC11, PC12
192.188.58.100/30	PC13, PC14
192.188.58.104/30	PC15, PC16
192.188.58.108/30	PC17, PC18
192.188.58.112/30	PC21, PC22
192.188.58.116/30	PC23, PC24
192.188.58.120/30	PC25, PC26
192.188.58.124/30	For instructor use
192.168.0.0/30		PC27, PC28    (these are private IPs because we
192.168.0.4/30		PC29, PC30     do not have enough real IPs)

Q. What is the netmask for a /30 network? ______________________

INSTRUCTIONS

Each desk has one machine which will be the ROUTER, another machine which is a CLIENT, and a private ethernet link (crossover cable) between the two.

     +-------+              +-------+ 192.188.58.___
     | PC __ |              | PC __ |------------------> to backbone
     +-------+              +-------+ eth0
         | eth0                 | eth1
         | ___.___.___.___      | ___.___.___.___
         |                      |
         +----------------------+
              crossover cable
  1. Find your private link network allocation from TABLE TWO. Allocate one IP address to the router and one to the client (remember you cannot use the network address or broadcast address). Write them in the diagram above.
  2. On the CLIENT, remove your existing eth0 connection. Connect a crossover cable from your eth0 to the router's eth1. Configure your eth0 with your new IP address and netmask.
  3. On the ROUTER, configure your eth1 with your new IP address and netmask. Make sure that you can ping the client, and vice versa, through the crossover cable.
  4. On the ROUTER, configure eth0 with your new backbone address and netmask from TABLE ONE. Make sure you can ping all the other desk's routers (192.168.58.66 to .78 inclusive). If you cannot, check that the other router is configured properly, and try "/sbin/arp -d x.x.x.x" where x.x.x.x is the other router's IP address.
  5. On the router, issue the command to enable IP forwarding:
    echo 1 >/proc/sys/net/ipv4/ip_forward
  6. On both the CLIENT and the ROUTER, add routes to be able to reach the rest of the classroom. Eventually you should be able to ping all addresses.

Don't change /etc/sysconfig/ifcfg-eth0, because we don't want these changes to be permanent. The commands you will need are:

/sbin/ifconfig                                            # show interfaces
/sbin/ifconfig eth0 x.x.x.x netmask y.y.y.y               # configure interface
/sbin/route -n                                            # show routes
/sbin/route add -net x.x.x.x netmask y.y.y.y gw z.z.z.z   # add a route
/sbin/route del -net x.x.x.x netmask y.y.y.y              # delete a route
/sbin/route del default                                   # delete defaultroute

ping x.x.x.x                           # send test packets
/usr/sbin/traceroute -n x.x.x.x        # show route to destination

Remember that the next hop gateway (z.z.z.z) must be an address on one of the networks which you are DIRECTLY connected to.

Can you ping other routers on the backbone? Can you ping other workstations? Debug the problems.