So, I have the following network configuration in Packet Tracer.
The router is configured with DHCP. The ports on the switches are configured with access mode - for those that belong to the PCs. The unused ports are shut down. The ports between the switches and the ports between the switch and the router are configured as trunk ports. All the PCs that are connected to the S1 that is directly connected to the R1 get the IP addresses from the router. However, the PCs that are connected to the S2 and S3 don't - instead they get the message "DHCP request failed, APIPA being used". What could be the problem?
Here is the link for the configurations - https://1drv.ms/u/s!AiRtffZ-QpFphY8iof_YGdcuua3KXw
The configurations for R1:
ip dhcp pool Head
network 10.10.10.0 255.255.255.0
default-router 10.10.10.1
ip dhcp pool R&D
network 10.10.20.0 255.255.255.0
default-router 10.10.20.1
ip dhcp pool M&S
network 10.10.30.0 255.255.255.0
default-router 10.10.30.1
ip dhcp pool Lab
network 10.10.40.0 255.255.255.0
default-router 10.10.40.1
ip dhcp pool WS
network 10.10.50.0 255.255.255.0
default-router 10.10.50.1
no ip cef
no ipv6 cef
spanning-tree mode pvst
interface FastEthernet0/0
no ip address
ip nat inside
duplex auto
speed auto
!
interface FastEthernet0/0.1
encapsulation dot1Q 1 native
ip address 10.10.1.1 255.255.255.0
!
interface FastEthernet0/0.10
encapsulation dot1Q 10
ip address 10.10.10.1 255.255.255.0
!
interface FastEthernet0/0.20
encapsulation dot1Q 20
ip address 10.10.20.1 255.255.255.0
!
interface FastEthernet0/0.30
encapsulation dot1Q 30
ip address 10.10.30.1 255.255.255.0
!
interface FastEthernet0/0.40
encapsulation dot1Q 40
ip address 10.10.40.1 255.255.255.0
!
interface FastEthernet0/0.50
encapsulation dot1Q 50
ip address 10.10.50.1 255.255.255.0
!
interface FastEthernet0/0.99
encapsulation dot1Q 99
ip address 10.10.99.1 255.255.255.0
!
interface FastEthernet0/1
ip address 85.143.163.237 255.255.255.0
ip nat outside
duplex auto
speed auto
interface Vlan1
no ip address
shutdown
ip nat inside source list 1 interface FastEthernet0/1 overload
ip classless
ip flow-export version 9
access-list 1 permit 10.10.0.0 0.0.255.255
line con 0
line aux 0
line vty 0 4
login
The configuration for S1:
spanning-tree mode pvst
!
interface FastEthernet0/1
switchport mode trunk
!
interface FastEthernet0/2
switchport mode trunk
!
interface FastEthernet0/3
shutdown
!
interface FastEthernet0/4
switchport mode trunk
!
interface FastEthernet0/5
shutdown
!
interface FastEthernet0/6
shutdown
!
interface FastEthernet0/7
shutdown
!
interface FastEthernet0/8
shutdown
!
interface FastEthernet0/9
shutdown
!
interface FastEthernet0/10
switchport access vlan 20
switchport mode access
spanning-tree portfast
!
interface FastEthernet0/11
switchport access vlan 20
switchport mode access
spanning-tree portfast
!
interface FastEthernet0/12
switchport access vlan 20
switchport mode access
spanning-tree portfast
!
interface FastEthernet0/13
switchport access vlan 20
switchport mode access
spanning-tree portfast
!
interface FastEthernet0/14
switchport access vlan 20
switchport mode access
spanning-tree portfast
!
interface FastEthernet0/15
switchport access vlan 10
switchport mode access
spanning-tree portfast
!
interface FastEthernet0/16
switchport access vlan 10
switchport mode access
spanning-tree portfast
!
interface FastEthernet0/17
switchport access vlan 30
switchport mode access
spanning-tree portfast
!
interface FastEthernet0/18
switchport access vlan 30
switchport mode access
spanning-tree portfast
!
interface FastEthernet0/19
switchport access vlan 30
switchport mode access
spanning-tree portfast
!
interface FastEthernet0/20
switchport access vlan 30
switchport mode access
spanning-tree portfast
!
interface FastEthernet0/21
switchport access vlan 20
switchport mode access
spanning-tree portfast
!
interface FastEthernet0/22
switchport access vlan 20
switchport mode access
spanning-tree portfast
!
interface FastEthernet0/23
switchport access vlan 30
switchport mode access
spanning-tree portfast
!
interface FastEthernet0/24
shutdown
!
interface Vlan1
no ip address
shutdown
!
interface Vlan99
ip address 10.10.99.10 255.255.255.0
!
ip default-gateway 10.10.99.1
line con 0
!
line vty 0 4
login
line vty 5 15
login
!
The configurations for S2:
spanning-tree mode pvst
!
interface FastEthernet0/1
shutdown
!
interface FastEthernet0/2
switchport mode trunk
!
interface FastEthernet0/3
switchport mode trunk
!
interface FastEthernet0/4
shutdown
!
interface FastEthernet0/5
shutdown
!
interface FastEthernet0/6
shutdown
!
interface FastEthernet0/7
shutdown
!
interface FastEthernet0/8
shutdown
!
interface FastEthernet0/9
shutdown
!
interface FastEthernet0/10
switchport access vlan 40
switchport mode access
spanning-tree portfast
!
interface FastEthernet0/11
switchport access vlan 40
switchport mode access
spanning-tree portfast
!
interface FastEthernet0/12
switchport access vlan 40
switchport mode access
spanning-tree portfast
!
interface FastEthernet0/13
switchport access vlan 40
switchport mode access
spanning-tree portfast
!
interface FastEthernet0/14
switchport access vlan 40
switchport mode access
spanning-tree portfast
!
interface FastEthernet0/15
switchport access vlan 40
switchport mode access
spanning-tree portfast
!
interface FastEthernet0/16
shutdown
!
interface FastEthernet0/17
shutdown
!
interface FastEthernet0/18
shutdown
!
interface FastEthernet0/19
shutdown
!
interface FastEthernet0/20
shutdown
!
interface FastEthernet0/21
shutdown
!
interface FastEthernet0/22
shutdown
!
interface FastEthernet0/23
shutdown
!
interface FastEthernet0/24
shutdown
!
interface Vlan1
no ip address
shutdown
!
interface Vlan99
ip address 10.10.99.20 255.255.255.0
!
ip default-gateway 10.10.99.1
line con 0
!
line vty 0 4
login
line vty 5 15
login
!
The configurations for S3:
spanning-tree mode pvst
!
interface FastEthernet0/1
shutdown
!
interface FastEthernet0/2
shutdown
!
interface FastEthernet0/3
!
interface FastEthernet0/4
!
interface FastEthernet0/5
shutdown
!
interface FastEthernet0/6
shutdown
!
interface FastEthernet0/7
shutdown
!
interface FastEthernet0/8
shutdown
!
interface FastEthernet0/9
shutdown
!
interface FastEthernet0/10
switchport access vlan 50
switchport mode access
spanning-tree portfast
!
interface FastEthernet0/11
switchport access vlan 50
switchport mode access
spanning-tree portfast
!
interface FastEthernet0/12
shutdown
!
interface FastEthernet0/13
shutdown
!
interface FastEthernet0/14
shutdown
!
interface FastEthernet0/15
shutdown
!
interface FastEthernet0/16
shutdown
!
interface FastEthernet0/17
shutdown
!
interface FastEthernet0/18
shutdown
!
interface FastEthernet0/19
shutdown
!
interface FastEthernet0/20
shutdown
!
interface FastEthernet0/21
shutdown
!
interface FastEthernet0/22
shutdown
!
interface FastEthernet0/23
shutdown
!
interface FastEthernet0/24
shutdown
!
interface Vlan1
no ip address
shutdown
!
interface Vlan99
ip address 10.10.99.30 255.255.255.0
!
ip default-gateway 10.10.99.1
line con 0
!
line vty 0 4
login
line vty 5 15
login
!
description
command on the interfaces to describe where the interface connects. It's not labeled on the drawing, and we are left to guess. For instance, S1 has trunks onF0/1
,F0/2
, andF0/4
, but which connects to S2, and on which S2 interface does it connect? It's a good idea to use theshow cdp neighbor
command to double-check that what you label matches the actual connection. You should also create the VLANs on each switch, and set S1 as the root switch for the VLANs