1

Here I am not able to obtain ip automatically using DHCP. My Topology of my DHCP Problem

Here is configuration of swtich0 which is having DHCP Server.

Switch#sh run
Building configuration...

Current configuration : 1237 bytes
!
version 12.2
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Switch
!
!
ip dhcp excluded-address 192.168.0.1 192.168.0.4
!
ip dhcp pool accounts
network 192.168.0.0 255.255.255.0
default-router 192.168.0.1
!
!
spanning-tree mode pvst
    !
interface FastEthernet0/1
switchport mode trunk
!
interface FastEthernet0/2
switchport mode trunk
!
interface F astEthernet0/3
!
interface FastEthernet0/4
!
interface FastEthernet0/5
!
interface FastEthernet0/6
!
interface FastEthernet0/7
!   
interface FastEthernet0/8
!
interface FastEthernet0/9
!
interface FastEthernet0/10
!
interface FastEthernet0/11
!
interface FastEthernet0/12
!
interface FastEthernet0/13
!
interface FastEthernet0/14
!
interface FastEthernet0/15
!
interface FastEthernet0/16
!
interface FastEthernet0/17
!
interface FastEthernet0/18
!
interface FastEthernet0/19
!
interface FastEthernet0/20
!
interface FastEthernet0/21
!
interface FastEthernet0/22
!
interface FastEthernet0/23
!
interface FastEthernet0/24
!
interface GigabitEthernet0/1
!
interface GigabitEthernet0/2
!
interface Vlan1
ip address 172.16.0.2 255.255.255.0
!
!
!
!
line con 0
!
line vty 0 4
login   
line vty 5 15
login
!
!
!
end 

Here the Configuration of Switch2

Building configuration...

Current configuration : 1131 bytes
    !
    version 12.2
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Switch
!
!
!
!
!
spanning-tree mode pvst
!
interface FastEthernet0/1
!
interface FastEthernet0/2
 switchport mode trunk
!
interface FastEthernet0/3
!
interface FastEthernet0/4
!
interface FastEthernet0/5
!
interface FastEthernet0/6
!
interface FastEthernet0/7
!
interface FastEthernet0/8
!
interface FastEthernet0/9
!
interface FastEthernet0/10
!
interface FastEthernet0/11
!   
interface FastEthernet0/12
!   
interface FastEthernet0/13
!
interface FastEthernet0/14
!
interface FastEthernet0/15
!
interface FastEthernet0/16
!   
interface FastEthernet0/17
!
interface FastEthernet0/18
interface FastEthernet0/19
!
interface F astEthernet0/20
!
interface FastEthernet0/21
!
interface FastEthernet0/22
!
interface FastEthernet0/23
!
interface F astEthernet0/24
 switchport access vlan 10
 switchport mode access
!
interface GigabitEthernet0/1
!
interface GigabitEthernet0/2
!
interface Vlan1
 ip address 172.16.0.3 255.255.255.0
!
!
!
!
line con 0
!
line vty 0 4
 login
line vty 5 15
 login
!
!
!
end

Please help me thanks :).

1

You are putting the PC in VLAN 10, but you don't have VLAN 10 defined in global configuration on your switches. Something like:

Vlan 10
 name PC_VLAN
!
1
  • solved with interface vlan 10 ip address 192.168.0.2 255.255.255.0 – chackers May 10 '17 at 3:58
3

Excluding default gateway is not required on DHCP Configuration

ip dhcp excluded-address 192.168.0.1 192.168.0.4

delete above command from DHCP Configuration .

Beacuse default -gateway status is already mentioned in DHCP Configuration

ip dhcp pool accounts

network 192.168.0.0 255.255.255.0

default-router 192.168.0.1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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