You are on page 1of 3

Tutorial / Walk-through

In this culminating activity, you will configure VLANs, trunks, DHCP Easy
IP, DHCP relay agents, and configure a router as a DHCP client.
Our first steps, using the table above, is to create VLANs on S2 and
assign them to the appropriate interfaces/ports. We need to configure them
for trunking, non-trunk ports as Access Ports, and other as needed.
S2>en
S2#conf t
Enter configuration commands, one per line. End with CNTL/Z.
S2(config)#vlan 10
S2(config-vlan)#name Sales
S2(config-vlan)#vlan 20
S2(config-vlan)#name Production
S2(config-vlan)#vlan 30
S2(config-vlan)#name Marketing
S2(config-vlan)#vlan 40
S2(config-vlan)#name HR
S2(config-vlan)#exit
S2(config)#int range fa0/5-9
S2(config-if-range)#switchport access vlan 10
S2(config-if-range)#int range f0/10-14
S2(config-if-range)#switchport access vlan 20
S2(config-if-range)#int range f0/15-19
S2(config-if-range)#switchport access vlan 30
S2(config-if-range)#int range f0/20-24
S2(config-if-range)#switchport access vlan 40
S2(config-if-range)#ex
S2(config)#int range fa0/5-9
S2(config-if-range)#switchport mode access
S2(config-if-range)#ex
S2(config)#int range f0/10-14
S2(config-if-range)#switchport mode access
S2(config-if-range)#ex
S2(config)#int range f0/15-19
S2(config-if-range)#switchport mode access
S2(config-if-range)#ex
S2(config)#int range f0/20-24
S2(config-if-range)#switchport mode access
S2(config-if-range)#ex
S2(config)#int range fa0/1-4
S2(config-if-range)#switchport mode trunk
S2(config-if-range)#ex
S2(config)#int range fa0/1-4
S2(config-if-range)#switchport mode trunk
S2(config-if-range)#int range fa0/5-24, g0/1-2
S2(config-if-range)#switchport mode access

So, as of current, we've established:


- VLANs on S2 with the appropriate name.
- S2 ports for trunking.
- S2's non-trunk ports on S2 as access-ports.

To further configure VLANs, we're going to be editing our router.


Why? Well, we need to configure R1 to route between our VLANs, as well as creating a DHCP
server for the VLANs attached to S2.

R1>en
R1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#int g0/0.10
R1(config-subif)#encapsulation dot1Q 10
R1(config-subif)#ip add 172.31.10.1 255.255.255.224
R1(config-subif)#int g0/0.20
R1(config-subif)#encapsulation dot1Q 20
R1(config-subif)#ip add 172.31.20.1 255.255.255.240
R1(config-subif)#int g0/0.30
R1(config-subif)#encapsulation dot1Q 30
R1(config-subif)#ip add 172.31.30.1 255.255.255.128
R1(config-subif)#int g0/0.40
R1(config-subif)#encapsulation dot1Q 40
R1(config-subif)#ip add 172.31.40.1 255.255.255.192
R1(config-subif)#ex
R1(config)#int g0/0
R1(config-if)#no sh
R1(config)#int g0/1
R1(config-if)#ip add dhcp
R1(config-if)#no sh

So this essentially configured our VLANs and otherwise needed information

to make this network function. The next instructions were to configure the devices so that the
DNS server would work.
Note that G0/1 is going to obtain an address via DHCP-- which is fine--

but many missed this, which caused the network to not work. We have to configure R1 to act as
a DHCP server for VLANs attached to S2, to which we must assign a name for each VLAN and
the respective addresses, as well as providing the Default Gateway address, as well as
preventing the first 10 addresses from being assigned.

So what we're going to do is start off with the blocking of the 10 assigned addresses, so enter
the following:
R1(config-if)#ex
R1(config)#ip dhcp pool VLAN_10
R1(config)#ip dhcp excluded-address 172.31.10.1 172.31.10.10
*NOTE: There was an error here (the middle code snippet line was not there previously), it has
been fixed. Credits to Michael Manlulu (see comments).
*NOTE: There was also an error in this segment. The middle line (ip dhcp pool VLAN_10) was
previously 'VLAN_20', but was incorrect. It is now 'VLAN_10'. Thank you, Pat K (see
comments)!

Now, we can go ahead and create our DHCP pools, since the addressing ranges have been
blocked properly, as well as creating the proper addressing pools for the DHCP part.

R1(dhcp-config)#network 172.31.10.0 255.255.255.224


R1(dhcp-config)#default-router 172.31.10.1
R1(dhcp-config)#dns-server 209.165.201.14
R1(dhcp-config)#ip dhcp excluded-address 172.31.20.1 172.31.20.10

So, in red is the network addressing pool we had assigned.


The blue is essentially how we assign default gateways in DHCP.
The orange is how we tell what IP that houses the DNS service.
The purple is how we exclude addresses in DHCP.
Also, when you enter the purple command, it will auto-boot you from that

configuration, which is fine, because now, we need to repeat this process

for the remainder of the VLANs.


R1(config)#ip dhcp pool VLAN_20
R1(dhcp-config)#network 172.31.20.0 255.255.255.240
R1(dhcp-config)#default-router 172.31.20.1
R1(dhcp-config)#dns-server 209.165.201.14
R1(dhcp-config)#ip dhcp excluded-address 172.31.30.1 172.31.30.10

Do you sort of see how the repition is here? Specifically, the excluded-

address command: You exclude the range of the next VLAN over to

(obviously) prevent any connection issues-- an IP that belongs to VLAN 20

won't work on VLAN 10, and so forth.

R1(config)#ip dhcp pool VLAN_30


R1(dhcp-config)#network 172.31.30.0 255.255.255.128
R1(dhcp-config)#default-router 172.31.30.1
R1(dhcp-config)#dns-server 209.165.201.14
R1(dhcp-config)#ip dhcp excluded-address 172.31.40.1 172.31.40.10

R1(config)#ip dhcp pool VLAN_40


R1(dhcp-config)#network 172.31.40.0 255.255.255.192
R1(dhcp-config)#default-router 172.31.40.1
R1(dhcp-config)#dns-server 209.165.201.14

Note that on VLAN 40 we don't nessessarily need an exclusion command as

nothing else exists (we don't have any further VLAN configurations,

therefore we don't need to narrow the range).

Many people have issues with the scoring (either at 80 or 84). You may need to do/check
the following:

1. Change all PCs to DHCP in the IP Addressing field.

2. Configure the following on Switch 1 (S1).


S1>en
S1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
S1(config)#vlan 10
S1(config-vlan)#name VLAN_10
S1(config-vlan)#ex
S1(config)#vlan 20
S1(config-vlan)#name VLAN_20
S1(config-vlan)#ex
S1(config)#vlan 30
S1(config-vlan)#name VLAN_30
S1(config-vlan)#ex
S1(config)#vlan 40
S1(config-vlan)#name VLAN_40

S1(config-vlan)#ex

You might also like