cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
7123
Views
15
Helpful
18
Replies

Very slow DHCP (not STP related)

ToTT
Level 1
Level 1

Hello, I believe, I have problem with DHCP only in Cisco switch. Searching on net, mostly related to STP or PortFast, but this is not.

 

Basically, I have a router connected to a switch who has VLAN1 and VLAN2.

VLAN1 is in router 192.168.1.0 subnet, VLAN2 is 192.168.2.0 subnet.

 

VLAN1 DHCP is handled by router, VLAN2 DHCP is handled by switch. Connecting to VLAN1 is very fast, BUT connecting to VLAN2 very slow could take 60 seconds and perhaps more. In Windows is says detecting & limited. but after long seconds, it changed to connected and everything works okay. I have to use ipconfig /release and /renew to make it get IP faster.

 

I turned off Spanning Tree Protocol to make sure it is not because of the PortFast off or because of STP, but still slow. I also test by turning off DHCP in router and let the switch do DHCP for VLAN1, and it is slow, same as in VLAN2.

 

So, is my router faulty? Or is there a way to speed things up?

Thank you.

 

EDIT: used stopwatch, apparently it needs about 1min, 13sec to get connected. In second 66, in WIndows it turns to Ethernet & Limited, then after about 7 sec it recognized the network and said connected. And if I connected to VLAN1 via switch, DHCP by router, it takes only about 3-4 seconds to be connected.

18 Replies 18

Francesco Molino
VIP Alumni
VIP Alumni
Hi

Can you share your configs please and tell us on which port the router is connected to on the switch?

All devices you're using for test, are connected to the switch handing the dhcp or another?

Thanks
Francesco
PS: Please don't forget to rate and select as validated answer if this answered your question

I am sorry, but I do not know how to share my configs as I am using SG350 in GUI.

Could you tell me how to get config as text?

 

My config is simple, I just make VLAN2. Assign IP interface VLAN1 as 192.168.1.2, VLAN2 192.168.2.1.

Router is 192.168.1.1. Then make static route 0.0.0.0 0.0.0.0/192.168.1.1

DHCP VLAN1: 192.168.1.1 as gateway.

DHCP VLAN2: 192.168.2.1 as gateway.

That's it, I think.

 

"All devices you're using for test, are connected to the switch handing the dhcp or another?"

Yes, basically only DHCP handled by switch that is slow.

If I set the router to handle DHCP, I get fast connection. Also fast even if connected through switch.

Ok I'm sorry but I'm not familiar with sg350 and how to debug them.

A device connected to your switch which handles dhcp is slow.
Port of the pc is configured as access vlan 2 and with spanning-tree portfast? Can you share some screenshots of your dhcp vlan 2 config?

Thanks
Francesco
PS: Please don't forget to rate and select as validated answer if this answered your question

1.jpg

I believe, the configuration is just minimal and normal.

 

"A device connected to your switch which handles dhcp is slow."

I am not sure. I think, the switch is slow at handling DHCP. Because VLAN2 DHCP is handled by the switch.

 

"Port of the pc is configured as access vlan 2 and with spanning-tree portfast?"

No, I turned off STP, but still slow. 

Hello,

 

on a side note, make sure your switch runs the latest firmware release (release 2.5.0.92).

 

Are these Windows (10) clients ?

"make sure your switch runs the latest firmware release (release 2.5.0.92)."

Well, to tell you the truth, I am afraid to upgrade firmwares. 

Some new firmwares make some routers to behave even worse and unexpected, like being slow, lost feature, have bugs, etc.

And in TP-Links, we even cannot downgrade firmware. We can, but the customer care don't want to put it on the forum. Normally, they send message privately. Basically, upgrading may lead to even bigger disaster.

 

"Are these Windows (10) clients ?"

No. Windows 8.1, Windows 7, and Windows XP. All experiencing slowness.

In WIndows XP, I didn't wait too long tho, did release and renew after waiting about 8 seconds.

Hello


@ToTT wrote:

VLAN1 DHCP is handled by router, VLAN2 DHCP is handled by switch.

So, is my router faulty? Or is there a way to speed things up?


As dhcp requires L3 addressing associated to its scopes and as the router is already performing L3 function and dhcp, suggest remove the dhcp service off the switch and append the scope and L3 vlan 2 to the router.
Just have the switch only as a host switch (no ip routing) with ip address/subnetmask /default-gateway for mgt connectivity


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul

"suggest remove the dhcp service off the switch and append the scope and L3 vlan 2 to the router. Just have the switch only as a host switch (no ip routing) with ip address/subnetmask /default-gateway for mgt connectivity"

I surely need to learn how to set DHCP for VLAN2 in the DDWRT router. But, I dunno, I heard L3 switches are like really good at routing and stuff, so I wanna load some burden off the DDWRT router into the switch.

 

The DDWRT router temp is 80 deg Celcius doing nothing, using D-Link DIR868L. I might need to add some fan and do what you suggested if I found no other solution.

 

I will put your suggestion as helpful, as surely it would work just like VLAN1. But, it is not exactly what I want to do.

Thank you for the suggestion though.

 

Hello

Then move the routing and dhcp off the rtr and onto the switch , Enable ip routing, Create L3 interfaces for VLAN1 & 2 also the DHCP scopes for both these subnets.


Add a couple a static route on the rtr to point towards vlan 2 and on the switch add a default to point towards the rtr.

The assumption here is that the rtr will still perfrom any network translation for 192.168.1.024 and 192.168.2.0/24

SW

conf t
ip routing
ip route 0.0.0.0 0.0.0.0 vlan 1 192.168.1.1

vlan 2
exit

int vlan 1
ip address 192.168.1.254 255.255.255.0

int vlan 2
ip address 192.168.2.254 255.255.255.0

ip dhcp pool lan
network 192.168.1.0 255.255.255.0
network 192.168.2.0 255.255.255.0 secondary
override default-router 192.168.2.254
default-router 192.168.1.254
lease 0 8

Int x/x
desxcription Link to router in vlan 1
switchport host
no shut

RTR
int x/x
desxcription Link to sw in vlan 1
ip address 192.168.1.1 255.255.255.0

ip route 192.168.2.0 255.255.255.0 192.168.1.254
ip route 0.0.0.0 0.0.0.0 (wan interface) X.X.X.X (nexthop ip)

 


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul

Yes, I did what you said in the config, except few things:

1. I was using GUI (surely not a problem)

2. IP interfaces are different (not a problem either)

3, Switchport host. I am not sure, but in GUI it says switchport on all ports are layer 2. Regarding layer 3 switching in SG350, I believe, I only need to check on IPv4 Routing option. So, I think not a problem.

4. ip route 192.168.2.0 255.255.255.0 192.168.1.254

I don't do this because I put in static routing this: 0.0.0.0 0.0.0.0 192.168.1.1 (router IP) metric:1

5. ip route 0.0.0.0 0.0.0.0 (wan interface) X.X.X.X (nexthop ip)

I don't understand this, but instead using WAN interface, I am using router IP as the next hop (above).

 

The config that I did via GUI works okay, VLAN2 got internet. The problem is just that DHCP is so slow to connect on VLAN2. I would like turn off router DHCP and let switch do the DHCP, but the problem of slow DHCP connecting is still there.

 

Btw, your config is very useful, I would put your post as helpful.

Thanks. 

 

EDIT: I tried to use your config:

ip route 192.168.2.0 255.255.255.0 192.168.1.254

It stops the internet. I have to route the router IP to 0.0.0.0 0.0.0.0

Now I remember why it took me days to make VLAN2 has internet. I have read many on the internet about routing VLAN2 subnet to the router IP, but it doesn't work for me. I have to route 0.0.0.0 to the router IP instead.

Hello


@ToTT wrote:

4. ip route 192.168.2.0 255.255.255.0 192.168.1.254

I don't do this because I put in static routing this: 0.0.0.0 0.0.0.0 192.168.1.1 (router IP) metric:1


The default route on the switch is fine but the router needs to beaware of vlan 2 which resides on the switch so you need a static route on the rtr to point back towards to the this subnet that resides on the switch

Remove dhcp server from ther rtr.

 

switch
ip route 0.0.0.0 0.0.0.0 192.168.1.1

rtr
ip route 192.168.2.0 255.255.255.0 192.168.1.254


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul

"The default route on the switch is fine"

--- I tried to route VLAN2 subnet to the router IP, but it stops the VLAN2 internet. Maybe I have broken switch?

 

"the router needs to beaware of vlan 2 which resides on the switch so you need a static route on the rtr to point back towards to the this subnet that resides on the switch"

--- Yes, I forgot to tell you that I already done it also. 

 

"ip route 192.168.2.0 255.255.255.0 192.168.1.254"

--- Instead using 192.168.1.254, I use 192.168.1.2 which is the interface IP of VLAN2. I have no idea whatsoever what the difference is, but using 192.168.1.2 works for me. I believe, I tried to route it to my router like your config, but it didn't work.

 

I believe, the configs, that I did, are not the culprit of slow DHCP by the switch as what I did were only essential things for VLAN2 to get internet. 

Are there any other settings that can effecting DHCP other than STP?

 

I would love to remove DHCP from my router, but the slow DHCP problem by the switch is still there.

Oh, if it helps, a wireless Access Point connected to the switch VLAN2 doesn't have slow problem giving IPs to its clients connected to the WIFI.

Take a PCAP in the link between your switch and the router before DHCP process starts and see if you observe anything abnormal.

Please do not hesitate to click the STAR button if you are satisfied with my answer.

Great advice, I am learning more using your suggested PCAP.

 

Okay, I was able to get this info:

No. Time Source Destination Protocol Length Info

1 0.000000 HewlettP_3f:5b:f9 Broadcast ARP 42 Who has 192.168.1.1? Tell 192.168.1.117
2 0.023961 0.0.0.0 255.255.255.255 DHCP 342 DHCP Request - Transaction ID 0x8f75c547
3 0.182672 Cisco_c4:f7:da Broadcast ARP 60 ARP Announcement for 192.168.2.1

 

It seems my computer keeps asking for 192.168.1.1 eventhough it should be in 192.168.2.0 subnet.

The Cisco suggested the correct one, I guess? It says 192.168.2.1

 

After few while my computer asked the correct one:

No. Time Source Destination Protocol Length Info
123 68.780899 192.168.2.1 255.255.255.255 DHCP 331 DHCP Offer - Transaction ID 0xfb120fca
124 68.781643 0.0.0.0 255.255.255.255 DHCP 343 DHCP Request - Transaction ID 0xfb120fca
125 68.783120 192.168.2.1 255.255.255.255 DHCP 331 DHCP ACK - Transaction ID 0xfb120fca
126 68.811581 HewlettP_3f:5b:f9 Broadcast ARP 42 Who has 192.168.2.1? Tell 192.168.2.100
 

I don't understand how DHCP works, but it seems 192.168.2.1 (switch) offered DHCP in 192.168.2.0 rather late. After the DHCP offer by the switch, my computer began to ask "Who has 192.168.2.1?"

Review Cisco Networking products for a $25 gift card