I'm testing a network and I use the vlan among 20 vlan but in this packet tracer I just use 10 Vlan on my network,

In this case, I use the DHCP server on my multilayer switch, not on my router.

so on the port on multilayer swith to switch layer 2 I use:

switchport trunk encapsulation dot1q
switchport mode trunk

for the DHCP server on multilayer switch I use:

ip dhcp pool vlan1

and the same for other vlan.

I have add the vlan and the IP address like on the picture

enter image description here

but when I config on the all switch layer 2,

on fa0/1 who connected to multilayerswitch I use:

switchport mode trunk

and port fa0/2-3 who connected to PC I use:

switchport mode access
switchport access vlan <VLANID>
! VLANID == VLAN for respective switch

But there's some thing weird,

On VLAN 1 and 2 it's almost connected and get the dhcp ip success but on the other PC I cannot get the DHCP IP it's remarks "dhcp failed. apipa is being used"

please help,

  • maybe u can attach .pkt please,
    – user16524
    Commented Jul 11, 2015 at 15:04
  • Did you configure VTP or add the VLANs to all the L2 switches? Run the following command on one of the L2 switches where it isn't working and edit it into the question: sh interface trunk
    – YLearn
    Commented Nov 9, 2015 at 23:36
  • Try packet tracers simulation mode.
    – IsAGuest
    Commented Feb 8, 2016 at 7:19
  • i faced the same issue with my lab, the problem it was the VLAN interfaces in the L3 switch, after that everything were working perfectly. thank you guys for your comments they were very useful.
    – user31128
    Commented Oct 9, 2016 at 13:19
  • I should check a few things:<br/> <br/> - if the access port are belongs to the desired vlan on L2 Switch<br/> - if the desired VLANs are present on L2 Switch<br/> - if the VLANs are allowed on trunk interface<br/> - if the SVI's are up on Multilayer Switch<br/> - and then fainally the DHCP pools<br/> <br/> let me know
    – new_py
    Commented Jan 9, 2017 at 0:42

3 Answers 3


Friend use configuration as below as you should have be sound basic knowledge

on router

Lab-R1> ena

Lab-R1# config t

Lab-R1(config)# ip dhcp pool myLAN

Lab-R1(dhcp-config)# network

Lab-R1(dhcp-config)# domain-name mydomain.lan

Lab-R1(dhcp-config)# default-router

Lab-R1(dhcp-config)# dns-server

Lab-R1(dhcp-config)# exit

Lab-R1(config)# ip dhcp excluded-address

at L2 sw

create vlan as 1 to 20 everyone have ip address with in same range as specified in router with each vlan have four ip address

int vlan 1
ip address

int vlan 2
ip address


int vlan 20 ip address

it's working


See i made a similar topology and uploaded to drive.

The ports connecting from to L3-sw to L2-sw and L2-sw to L3-sw both need to be trunked to carry all the vlans.

And the port connecting to pc should be access and assigned to the vlan you want.

Also create both the vlans on L3-sw along with the interfaces for those vlans.

If you want inter-vlan routing then also enable:

conf t 
ip routing

You should check a few things:

  • if the access port are belongs to the desired vlan on L2 Switch
  • if the desired VLANs are present on L2 Switch
  • if the VLANs are allowed on trunk interface
  • if the SVI's are up on Multilayer Switch
  • and then fainally the DHCP pools

If you have any other problem please attach the show running-config of the Multilayer Switch

Not the answer you're looking for? Browse other questions tagged or ask your own question.