cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1302
Views
1
Helpful
17
Replies

Enabled DHCP in my router to get IP's but unable to get IP's.

thirumg3
Level 1
Level 1

PFA for your reference 

in SW

interface FastEthernet0/1

switchport trunk allowed vlan 1,10,20

switchport mode trunk

!

interface FastEthernet0/2

switchport access vlan 10

switchport mode trunk

!

interface FastEthernet0/3

switchport access vlan 20

switchport mode trunk

!

interface Vlan1

no ip address

shutdown

!

!

!

!

line con 0

!

line vty 0 4

login

line vty 5 15

ROUTER

p dhcp excluded-address 10.1.10.1 10.1.10.99

ip dhcp excluded-address 10.1.20.1 10.1.20.99

!

ip dhcp pool VLAN10

network 10.1.10.0 255.255.255.0

default-router 10.1.10.1

dns-server 10.1.10.1

ip dhcp pool VLAN20

network 10.1.20.0 255.255.255.0

default-router 10.1.20.1

dns-server 10.1.20.1

 

17 Replies 17

thirumg3
Level 1
Level 1

PFA for your reference

SW0:

interface FastEthernet0/1

switchport access vlan 10

switchport mode access

duplex full

speed 100

!

interface FastEthernet0/2

switchport access vlan 20

switchport mode trunk

duplex full

speed 100

!

interface FastEthernet0/3

switchport trunk allowed vlan 1,10,20

switchport mode access

!

interface Vlan1

ip address 172.1.0.5 255.255.255.224

!

banner motd ^C***********WARNING**************

 

 

THIS SWITCH GOING TO DOWN ON SATUDAY FOR SERVICE^C

!

!

!

access-list 1 permit host 172.1.0.2

line con 0

login local

!

line vty 0 4

access-class 1 in

login local

BRANCH:

Current configuration : 1822 bytes

!

version 15.1

no service timestamps log datetime msec

no service timestamps debug datetime msec

no service password-encryption

!

hostname Branch

!

!

!

enable secret 5 xxx

!

!

ip dhcp excluded-address 10.1.10.1 10.1.10.99

ip dhcp excluded-address 10.1.20.1 10.1.20.99

!

!

!

!

ip cef

no ipv6 cef

!

!

!

username xxx secret 5 xxx

!

!

license udi pid xxx sn xxx

!

!

!

!

!

!

!

!

!

ip ssh version 2

ip domain-name cisco.com

!

!

spanning-tree mode pvst

!

!

!

!

!

!

interface FastEthernet0/0

no ip address

duplex auto

speed auto

!

interface FastEthernet0/0.1

encapsulation dot1Q 1 native

ip address 10.1.1.1 255.255.255.0

!

interface FastEthernet0/0.10

encapsulation dot1Q 10

ip address 10.1.10.1 255.255.255.0

ip helper-address 172.1.0.62

!

interface FastEthernet0/0.20

encapsulation dot1Q 20

ip address 10.1.20.1 255.255.255.0

ip helper-address 172.1.0.62

!

interface FastEthernet0/0.30

no ip address

!

interface FastEthernet0/1

ip address 209.165.201.11 255.255.255.224

ip nat outside

duplex auto

speed auto

!

interface Vlan1

no ip address

shutdown

!

router rip

!

ip classless

ip route 172.1.0.32 255.255.255.224 172.1.0.33

ip route 0.0.0.0 0.0.0.0 172.1.0.32

ip route 172.1.0.32 255.255.255.252 172.1.0.66

ip route 0.0.0.0 0.0.0.0 209.165.201.12

!

ip flow-export version 9

!

!

access-list 1 permit host 172.1.0.2

!

banner login ^C****************warning**************

unathuraized to login this device only autherized person can login^C

!

!

!

!

line con 0

login local

!

line aux 0

!

line vty 0 4

access-class 1 in

login local

transport input ssh

transport output none

line vty 5

access-class 1 in

login local

transport input ssh

transport output none

line vty 6 15

access-class 1 in

login

!

!

ntp server 172.1.0.62

!

end

HQ:

hostname HQ

!

!

!

enable secret 5 xxx

!

!

ip dhcp excluded-address 172.1.0.1 172.1.0.66

!

ip dhcp pool WAN

network 172.1.0.0 255.255.255.224

default-router 172.1.0.66

!

!

!

ip cef

no ipv6 cef

!

!

!

username xxx secret 5 xxx

!

!

license udi pid xxx sn xxx

!

!

!

!

!

!

!

!

!

ip ssh version 2

ip domain-name cisco.com

!

!

spanning-tree mode pvst

!

!

!

!

!

!

interface FastEthernet0/0

ip address 209.165.201.12 255.255.255.224

ip access-group NO_WEB in

duplex auto

speed auto

!

interface FastEthernet0/1

ip address 172.1.0.33 255.255.255.224

duplex auto

speed auto

!

interface Vlan1

no ip address

shutdown

!

ip classless

ip route 0.0.0.0 0.0.0.0 172.1.0.1

ip route 0.0.0.0 0.0.0.0 172.1.0.65

ip route 172.1.0.0 255.255.255.252 172.1.0.1

ip route 172.1.0.0 255.255.255.224 172.1.0.65

ip route 172.1.0.0 255.255.255.224 172.1.0.67

ip route 10.1.10.0 255.255.255.0 209.165.201.11

ip route 10.1.20.0 255.255.255.0 209.165.201.11

!

ip flow-export version 9

!

!

ip access-list extended NO_WEB

deny tcp host 172.1.0.3 host 172.1.0.62 eq www

permit ip any any

!

!

!

!

!

line con 0

login local

!

line aux 0

!

line vty 0 4

access-class 1 in

login local

transport input telnet

transport output ssh

line vty 5

access-class 1 in

login local

transport input telnet

transport output ssh

line vty 6 15

login

transport input telnet

!

!

ntp authentication-key 1 md5 0822455D0A16 7

ntp authenticate

ntp server 172.1.0.62 key 1

!

end

DHCP SERVER:

thirumg3_0-1678700230450.png

 

balaji.bandi
Hall of Fame
Hall of Fame

You need to post the Router full config, - since we see basic config of switch, as trunk and allowed VLAN in the Trunk, but we have not see same config is applied on the router side ?

 

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

Router#sh runn

Building configuration...

 

Current configuration : 1161 bytes

!

version 15.1

no service timestamps log datetime msec

no service timestamps debug datetime msec

no service password-encryption

!

hostname Router

!

!

!

!

ip dhcp excluded-address 10.1.10.1 10.1.10.99

ip dhcp excluded-address 10.1.20.1 10.1.20.99

!

ip dhcp pool VLAN10

network 10.1.10.0 255.255.255.0

default-router 10.1.10.1

dns-server 10.1.10.1

ip dhcp pool VLAN20

network 10.1.20.0 255.255.255.0

default-router 10.1.20.1

dns-server 10.1.20.1

!

!

!

ip cef

no ipv6 cef

!

!

!

!

license udi pid CISCO2811/K9 sn xxx

!

!

!

!

!

!

!

!

!

!

!

spanning-tree mode pvst

!

!

!

!

!

!

interface FastEthernet0/0

no ip address

duplex auto

speed auto

!

interface FastEthernet0/0.1

encapsulation dot1Q 10

ip address 10.1.10.1 255.255.255.0

!

interface FastEthernet0/0.2

encapsulation dot1Q 20

ip address 10.1.20.1 255.255.255.0

!

interface FastEthernet0/0.3

encapsulation dot1Q 1 native

ip address 10.1.1.1 255.255.255.0

!

interface FastEthernet0/1

no ip address

duplex auto

speed auto

shutdown

!

interface Vlan1

no ip address

shutdown

!

ip classless

!

ip flow-export version 9

!

!

!

!

!

!

!

line con 0

!

line aux 0

!

line vty 0 4

login

!

!

!

end

 

Switch#sh runn

Building configuration...

 

Current configuration : 1242 bytes

!

version 15.0

no service timestamps log datetime msec

no service timestamps debug datetime msec

no service password-encryption

!

hostname Switch

!

!

!

!

!

!

spanning-tree mode pvst

spanning-tree extend system-id

!

interface FastEthernet0/1

switchport trunk allowed vlan 1,10,20

switchport mode trunk

!

interface FastEthernet0/2

switchport access vlan 10

switchport mode trunk

!

interface FastEthernet0/3

switchport access vlan 20

switchport mode trunk

!

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

no ip address

shutdown

!

!

!

!

line con 0

!

line vty 0 4

login

line vty 5 15

login

!

!

!

!

end

 

Check have you created vlan 10, 20 ?

from switch post below output :

show vlan

show interface status

Router :

show ip interface brief

show ip route

show ip dhcp server statistics
show ip dhcp pool
show ip sockets

-

below reference guide :

https://www.computernetworkingnotes.com/ccna-study-guide/configure-dhcp-server-for-multiple-vlans-on-the-switch.html

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

*show vlan:*

Switch>en

Switch#sh vlan


VLAN Name Status Ports

---- -------------------------------- ---------
-------------------------------

1 default active Fa0/4, Fa0/5, Fa0/6, Fa0/7

Fa0/8, Fa0/9, Fa0/10, Fa0/11

Fa0/12, Fa0/13, Fa0/14, Fa0/15

Fa0/16, Fa0/17, Fa0/18, Fa0/19

Fa0/20, Fa0/21, Fa0/22, Fa0/23

Fa0/24, Gig0/1, Gig0/2

10 VLAN0010 active

20 VLAN0020 active

1002 fddi-default active

1003 token-ring-default active

1004 fddinet-default active

1005 trnet-default active


VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2

---- ----- ---------- ----- ------ ------ -------- ---- -------- ------
------

1 enet 100001 1500 - - - - - 0 0

10 enet 100010 1500 - - - - - 0 0

20 enet 100020 1500 - - - - - 0 0

1002 fddi 101002 1500 - - - - - 0 0

1003 tr 101003 1500 - - - - - 0 0

1004 fdnet 101004 1500 - - - ieee - 0 0

1005 trnet 101005 1500 - - - ibm - 0 0


VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2

---- ----- ---------- ----- ------ ------ -------- ---- -------- ------
------


Remote SPAN VLANs

------------------------------------------------------------------------------


Primary Secondary Type Ports

------- --------- -----------------
------------------------------------------


*show interface status:*

Switch#show int status

Port Name Status Vlan Duplex Speed Type

Fa0/1 connected trunk auto auto 10/100BaseTX

Fa0/2 connected trunk auto auto 10/100BaseTX

Fa0/3 connected trunk auto auto 10/100BaseTX

Fa0/4 notconnect 1 auto auto 10/100BaseTX

Fa0/5 notconnect 1 auto auto 10/100BaseTX

Fa0/6 notconnect 1 auto auto 10/100BaseTX

Fa0/7 notconnect 1 auto auto 10/100BaseTX

Fa0/8 notconnect 1 auto auto 10/100BaseTX

Fa0/9 notconnect 1 auto auto 10/100BaseTX

Fa0/10 notconnect 1 auto auto 10/100BaseTX

Fa0/11 notconnect 1 auto auto 10/100BaseTX

Fa0/12 notconnect 1 auto auto 10/100BaseTX

Fa0/13 notconnect 1 auto auto 10/100BaseTX

Fa0/14 notconnect 1 auto auto 10/100BaseTX

Fa0/15 notconnect 1 auto auto 10/100BaseTX

Fa0/16 notconnect 1 auto auto 10/100BaseTX

Fa0/17 notconnect 1 auto auto 10/100BaseTX

Fa0/18 notconnect 1 auto auto 10/100BaseTX

Fa0/19 notconnect 1 auto auto 10/100BaseTX

Fa0/20 notconnect 1 auto auto 10/100BaseTX

Fa0/21 notconnect 1 auto auto 10/100BaseTX

Fa0/22 notconnect 1 auto auto 10/100BaseTX

Fa0/23 notconnect 1 auto auto 10/100BaseTX

Fa0/24 notconnect 1 auto auto 10/100BaseTX

Gig0/1 notconnect 1 auto auto 10/100BaseTX

Gig0/2 notconnect 1 auto auto 10/100BaseTX


*Router

*show ip interface brief:*

Router#sh ip interface brief

Interface IP-Address OK? Method Status Protocol

FastEthernet0/0 unassigned YES unset up up

FastEthernet0/0.1 10.1.10.1 YES manual up up

FastEthernet0/0.2 10.1.20.1 YES manual up up

FastEthernet0/0.3 10.1.1.1 YES manual up up

FastEthernet0/1 unassigned YES unset administratively down down

Vlan1 unassigned YES unset administratively down down


*show ip route:*

Gateway of last resort is not set

10.0.0.0/8 is variably subnetted, 6 subnets, 2 masks

C 10.1.1.0/24 is directly connected, FastEthernet0/0.3

L 10.1.1.1/32 is directly connected, FastEthernet0/0.3

C 10.1.10.0/24 is directly connected, FastEthernet0/0.1

L 10.1.10.1/32 is directly connected, FastEthernet0/0.1

C 10.1.20.0/24 is directly connected, FastEthernet0/0.2

L 10.1.20.1/32 is directly connected, FastEthernet0/0.2


*show ip dhcp pool:*

Router#show ip dhcp pool


Pool VLAN10 :

Utilization mark (high/low) : 100 / 0

Subnet size (first/next) : 0 / 0

Total addresses : 254

Leased addresses : 0

Excluded addresses : 2

Pending event : none


1 subnet is currently in the pool

Current index IP address range Leased/Excluded/Total

10.1.10.1 10.1.10.1 - 10.1.10.254 0 / 2 / 254


Pool VLAN20 :

Utilization mark (high/low) : 100 / 0

Subnet size (first/next) : 0 / 0

Total addresses : 254

Leased addresses : 0

Excluded addresses : 2

Pending event : none


1 subnet is currently in the pool

Current index IP address range Leased/Excluded/Total

10.1.20.1 10.1.20.1 - 10.1.20.254 0 / 2 / 254


*show ip dhcp server statistics & show ip sockets

*Try to get this information but am getting error.*

Router#show ip sockets

^

% Invalid input detected at '^' marker.

Router#show ip dhcp server satistics

^% Invalid input detected at '^' marker.



M02@rt37
VIP
VIP

Hello @thirumg3 

On your router:

R1(config)#service dhcp

Best regards
.ı|ı.ı|ı. If This Helps, Please Rate .ı|ı.ı|ı.

thirumg3
Level 1
Level 1

facing the same issue and getting APIPA.

Router>en

Router#config t

Enter configuration commands, one per line. End with CNTL/Z.

Router(config)#service DHCP

Router(config)#exit

Router#

%SYS-5-CONFIG_I: Configured from console by console

 

Router#wr

Building configuration...

[OK]

Router#sh runn

Building configuration...

 

Current configuration : 1161 bytes

!

version 15.1

no service timestamps log datetime msec

no service timestamps debug datetime msec

no service password-encryption

!

hostname Router

!

!

!

!

ip dhcp excluded-address 10.1.10.1 10.1.10.99

ip dhcp excluded-address 10.1.20.1 10.1.20.99

!

ip dhcp pool VLAN10

network 10.1.10.0 255.255.255.0

default-router 10.1.10.1

dns-server 10.1.10.1

ip dhcp pool VLAN20

network 10.1.20.0 255.255.255.0

default-router 10.1.20.1

dns-server 10.1.20.1

!

!

!

ip cef

no ipv6 cef

!

!

!

!

license udi pid xxx sn xxx

!

!

!

!

!

!

!

!

!

!

!

spanning-tree mode pvst

!

!

!

!

!

!

interface FastEthernet0/0

no ip address

duplex auto

speed auto

!

interface FastEthernet0/0.1

encapsulation dot1Q 10

ip address 10.1.10.1 255.255.255.0

!

interface FastEthernet0/0.2

encapsulation dot1Q 20

ip address 10.1.20.1 255.255.255.0

!

interface FastEthernet0/0.3

encapsulation dot1Q 1 native

ip address 10.1.1.1 255.255.255.0

!

interface FastEthernet0/1

no ip address

duplex auto

speed auto

shutdown

!

interface Vlan1

no ip address

shutdown

!

ip classless

!

ip flow-export version 9

!

!

!

!

!

!

!

line con 0

!

line aux 0

!

line vty 0 4

login

!

!

!

end

ok @thirumg3 

do the vlan 10 and 20 are created on the switch ?

sh vlan brief

Best regards
.ı|ı.ı|ı. If This Helps, Please Rate .ı|ı.ı|ı.

Switch>en

Switch#sh vlan


VLAN Name Status Ports

---- -------------------------------- ---------
-------------------------------

1 default active Fa0/4, Fa0/5, Fa0/6, Fa0/7

Fa0/8, Fa0/9, Fa0/10, Fa0/11

Fa0/12, Fa0/13, Fa0/14, Fa0/15

Fa0/16, Fa0/17, Fa0/18, Fa0/19

Fa0/20, Fa0/21, Fa0/22, Fa0/23

Fa0/24, Gig0/1, Gig0/2

10 VLAN0010 active

20 VLAN0020 active

1002 fddi-default active

1003 token-ring-default active

1004 fddinet-default active

1005 trnet-default active


VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2

---- ----- ---------- ----- ------ ------ -------- ---- -------- ------
------

1 enet 100001 1500 - - - - - 0 0

10 enet 100010 1500 - - - - - 0 0

20 enet 100020 1500 - - - - - 0 0

1002 fddi 101002 1500 - - - - - 0 0

1003 tr 101003 1500 - - - - - 0 0

1004 fdnet 101004 1500 - - - ieee - 0 0

1005 trnet 101005 1500 - - - ibm - 0 0


VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2

---- ----- ---------- ----- ------ ------ -------- ---- -------- ------
------


Remote SPAN VLANs

------------------------------------------------------------------------------


Primary Secondary Type Ports

------- --------- -----------------
------------------------------------------

show ip dhcp server statistics <<- share this 

thirumg3
Level 1
Level 1

Branch#sh ip dhcp server statistics

^

% Invalid input detected at '^' marker.

M02@rt37
VIP
VIP

Hello @thirumg3 

Thanks for the config.

On SW please only config [switchport mode access] and [switchport access vlan 10] on interface FastEthernet0/2 - do [no switchport  mode trunk].

Same thing on interface FastEthernet0/3 ; config [switchport mode access] and [switchport access vlan 20]  - do [no switchport  mode trunk].

Also you cas add [spanning-tree portfast] command on Fa0/2 and Fa0/3.

Your FastEthernet0/1 seem to be your trunk link towards the router. Config is ok !

Also on the Router interface face to face with the Switch, the config ROAS is ok!

interface Fa0/0

description --To_SW

no shut

!

interface Fa0/0.10

description --Vl10

encapsulation dot1q 10

ip add 10.1.10.1 255.255.255.0

no shut

interface Fa0/0.20

description --Vl20

encapsulation dot1q 20

ip add 10.1.20.1 255.255.255.0

no shut

 

Please do [show ip int brief] on router and give us the output.

 

 

 

 

 

Best regards
.ı|ı.ı|ı. If This Helps, Please Rate .ı|ı.ı|ı.

Switch#config t

Enter configuration commands, one per line. End with CNTL/Z.

Switch(config)#int f0/2

Switch(config-if)#switchmode access vlan 10

^

% Invalid input detected at '^' marker.

 

Switch(config-if)#switch mode access vlan 10

^

% Invalid input detected at '^' marker.

 

Switch(config-if)#switch mode access

Switch(config-if)#switch access vlan 10

Switch(config-if)#no switch mode trunk

Command rejected: An interface must be configured to the Access or Trunk modes to be configured to NoNegotiate.

Switch(config-if)#no switchport mode trunk

Command rejected: An interface must be configured to the Access or Trunk modes to be configured to NoNegotiate.

Switch(config-if)#exit

Switch(config)#int f0/2

Switch(config-if)#no switchport mode trunk

Command rejected: An interface must be configured to the Access or Trunk modes to be configured to NoNegotiate.

Switch(config-if)#

Switch(config-if)#exit

Switch(config)#int f0/2

Switch(config-if)#spanning-tree portfast

%Warning: portfast should only be enabled on ports connected to a single

host. Connecting hubs, concentrators, switches, bridges, etc... to this

interface when portfast is enabled, can cause temporary bridging loops.

Use with CAUTION

 

%Portfast has been configured on FastEthernet0/2 but will only

have effect when the interface is in a non-trunking mode.

Branch#sh ip int brief

Interface IP-Address OK? Method Status Protocol

FastEthernet0/0 unassigned YES manual up up

FastEthernet0/0.1 10.1.1.1 YES manual up up

FastEthernet0/0.10 10.1.10.1 YES manual up up

FastEthernet0/0.20 10.1.20.1 YES manual up up

FastEthernet0/0.30 unassigned YES unset up up

FastEthernet0/1 209.165.201.11 YES manual up up

Vlan1 unassigned YES unset administratively down down

Review Cisco Networking for a $25 gift card