Static Routing Exercise: Classroom Addressing Plan

Our entire address space is 202.144.139.0/24

202.144.139.0 = 11001010 10010000 10001011 00000000
Prefix /24      ++++++++++++++++++++++++++
Host part                                  xxxxxxxx

Total number of IPs = 2^8 = 256  (00000000 to 11111111)

Lowest IP:      11001010 10010000 10001011 00000000 = 202.144.139.0
Highest IP:     11001010 10010000 10001011 11111111 = 202.144.139.255

For this exercise, we will divide this up as follows:

+-------+-------+-------+-------+-------+-------+---------------+
|.0/29  |.8/29  |.16/29 |.24/29 |.32/29 |       |               |
|  0-7  |  8-15 | 16-23 | 24-31 | 32-39 |       |               |
+-------+-------+-------+-------+-------+-------+---------------+
                   separate subnet for each group
...
+---------------------------------------------------------------+
|.192/26                                                        |
|                      192      -      255                      |
+---------------------------------------------------------------+
                             backbone

TABLE ONE

202.144.139.192/26	Classroom backbone
------------------	------------------
202.144.139.193         Group one (PC1-3) border router
202.144.139.194         Group two (PC4-6) border router
202.144.139.195         Group three (PC7-9) border router
202.144.139.196         Group four (PC10-12) border router
202.144.139.197         Group five (PC13-15) border router

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

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

TABLE TWO

202.144.139.0/29	Group one
202.144.139.8/29	Group two
202.144.139.16/29	Group three
202.144.139.24/29	Group four
202.144.139.32/29	Group five

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

INSTRUCTIONS

Each group has one machine which will be the ROUTER, two machines which are CLIENTS, and a private ethernet network (hub) between them.





 CLIENT                 CLIENT                 ROUTER
+-------+              +-------+              +-------+ 202.144.139.___
| PC __ |              | PC __ |              | PC __ |----------> to backbone
+-------+              +-------+              +-------+ xl1
    | xl0                  | xl0                  | xl0
    | 202.144.139.___      | 202.144.139.___      | 202.144.139.___
    |                      |                      |
    |                   +-----+                   |
    +------------------ | hub | ------------------+
                        +-----+
  1. Remove your existing defaultroute:
    # route delete default
  2. Find your group's local network allocation from TABLE TWO. Allocate one IP address to the router and one each to the clients (remember you cannot use the network address or broadcast address). Write them in the diagram above.
  3. On both ROUTER and CLIENTS, remove your existing xl0 connection. Connect them to your group's hub instead. Configure your xl0 with your new IP address and netmask (see commands below). Make sure the three machines can ping each other. If they cannot, then debug the problem before continuing.
  4. On the ROUTER, configure xl1 with your new backbone address and netmask from TABLE ONE, and plug it into the backbone switch. Make sure you can ping all the other group's routers (202.144.139.193 to .197 inclusive). If you cannot, check that the other group's router is configured properly, and try "arp -d x.x.x.x" where x.x.x.x is the other router's IP address before pinging them again.
  5. On the ROUTER only, issue the command to enable IP forwarding:
    # sysctl net.inet.ip.forwarding=1
  6. On both the CLIENTS 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/rc.conf, because we don't want these changes to be permanent. The commands you will need are:

ifconfig                                            # show interfaces
ifconfig xl0 x.x.x.x/p                              # configure interface
ifconfig xl0 x.x.x.x netmask y.y.y.y                # (alternative form)

netstat -nr                                         # show routes (ignore ipv6)
route add x.x.x.x/p z.z.z.z                         # add a route to network x.x.x.x/p
                                                    #             via next-hop z.z.z.z
route add -net x.x.x.x -netmask y.y.y.y z.z.z.z     # (alternative form)
route delete x.x.x.x/p                              # delete a route
route delete default                                # delete defaultroute

ping x.x.x.x                           # send test packets (Ctrl-C to stop)
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 clients in other groups? Debug the problems.