The purpose of this lab is to learn to configure a Cisco Switch/Router to run a DHCP server, serving addresses to hosts on a VLAN.
For this lab you'll need three computers, all booted into Linux on the USB flash drives, a Cisco SB300 switch and its serial cables, and a couple of ethernet cables.
In the last lab we did with the Cisco routers, we added to hosts to VLAN 10 on ports 1 and 2 on the Cisco switch/router.
Go to that lab (if needed) to follow the instructions to get your two computers connected again to each other via the switch. Note that you do NOT have to have your computers connected via VLAN 10 as we did in the previous lab. Instead, you can use VLAN 1, which all ports belong to by default.
You might use the command
is333# show running-config
to see if VLAN 10 is still defined on the switch (it shouldn't be because the last step in that previous lab was to set the switch/router back to "factory default"). If you find that VLAN 10 is still defined and that ports 1 and 2 are still defined to be on that VLAN then you can do one of two things:
1. You can set the switch/router back to factory default (using the last step in that previous lab).
2. You can plug your hosts into two other ports, which will then put them on VLAN 1.
NOTE: you are not going to assign IP addresses to these hosts yet. So, even if you plug them into the switch and you see the little green lights go all flashy-flashy on the ports of the switch, you will not be able to do anything with the hosts yet (like ping other machines).
The hosts should now be plugged into the Cisco switch/router. Use ip addr show
on each one to see if the hosts have IP addresses. They might have them -- leftover from when they were plugged into the orange network.
If the hosts have IP addresses, you can delete them this way;
ip addr del <the current IP>/24 dev <the dev name>
In order for the switch to run a DHCP server, it has to have an IP interface on the VLAN that the hosts are on. So, we need to set that up. Use these commands:
is333# config t
is333(config)# int vlan 1
is333(config-int)# ip address 10.0.0.1 /24
is333(config-int)# end
*** Q1: Describe in English what these commands just did. ***
To set up a DHCP pool of addresses, do this on the server:
is333# config t
is333(config)# ip dhcp pool network <NAME>
is333(config-dhcp)#
Next, I'm leaving it up to you to figure out how to set the addresses in the pool, how to set the DNS server to give to new hosts, and how to set the default router to give to new hosts. In the Cisco interface, you can always type ?
after a command to get options for that command and/or you can type <tab>
to get possible completions of commands. Use these tools to figure out how to set these values:
Range of addresses: 10.0.0.2
through 10.0.0.80
with subnet mask /24
DNS server: 8.8.8.8
Default router: 10.0.0.1
After you figure this out, finish setting the values by doing:
is333(config-dhcp)# end
Confirm you've done it right with show running-config
*** Q2: What commands did you use to configure a DHCP address pool? ***
To enable the DHCP server, do this:
is333# config t
is333(config)# ip dhcp server
is333(config)# exit
You can check if your setup looks correct by running show running-config
.
You also should see your hosts get IP addresses. You may have to unplug the hosts from the switch and then plug them back in again.
On your hosts, confirm that they have IP addresses, the correct route, and have their DNS server set correctly. You can confirm all of this easily by going to the pull down information box from the network status icon in the upper right corner of the screen.
Try pinging across the switch between the two hosts.
*** Q3: What addresses did the machines get? ***
*** Q4: What routes are on the hosts? (Describe the route table entries for one host.) ***
Unplug your hosts from the little private network, and plug them back into the orange network. Make sure they get proper addresses on the orange network.
Reset the switch to factory default: see the last step here for how to do that.
Put your stuff away.