09-01-2024 06:28 PM
Hello,
My laptop ip address is 10.100.50.31 under vlan 250, then i try to change my vlan to other vlan for testing purpose. When i back to vlan 250 i feel strange that my ip is changed and not use 10.100.50.31.
Checked there is no mac address change in my NIC. Anyone know why?
Here my dhcp server config
!
network 10.100.50.0 255.255.255.0
default-router 10.100.50.1
dns-server 10.200.1.1
lease 7
09-01-2024 08:54 PM
Show ip dhcp binding
Show ip dhcp pool server
Share these
MHM
09-01-2024 09:01 PM
09-01-2024 10:17 PM
09-01-2024 11:15 PM
sorry i not understand your reply.
Here my ip now 10.100.50.48
Then i switch to other vlan i got ip 10.100.1.27
Then i go back to vlan 250 and my ip changed from 10.100.50.48 to 10.100.50.50 now.
09-01-2024 11:25 PM
Now in binding you will see mac end with 03 and IP end with. 50
The old IP .48 the dhcp assume it use by host and dhcp pool will never use it until lease time end.
To make you vlan always use same IP you need to use static IP
https://sites.google.com/site/blahutajannet/cisco-tutorials/cisco-router-set-up-dhcp-static-mapping
MHM
09-01-2024 11:35 PM
Please cmiiw, as my experience when using windows as dhcp server the client will have same ip if the mac address also not changed.
So on the window dhcp database will map like below
Vlan 250 :: 00-15-5D-54-96-03 :: 10.100.50.48
Vlan 101 :: 00-15-5D-54-96-03 :: 10.100.1.27
So whenever the client go to any vlan, when the client connect to vlan 250 the ip always and should be 10.100.50.48 as long the lease not expired.
Or maybe in the cisco router the mac address is not stored per vlan, so when the client connect to vlan 101 then it will remove existing entry on vlan 250?
09-01-2024 11:39 PM
as my experience when using windows as dhcp server the client will have same ip if the mac address also not changed. <<- that I think not correct, when host ask IP from DHCP (server or local in router) it will get new IP unless you static IP
Or maybe in the cisco router the mac address is not stored per vlan, so when the client connect to vlan 101 then it will remove existing entry on vlan 250? <<- if you see binding table you can see the vlan appear so router store per vlan
MHM
09-01-2024 11:45 PM
So what purpose of dhcp lease time if every client request ip address to the dhcp server and dhcp server assign different ip? When the client connect to different vlan, this mean lease time still exist and not deleted until the leased time expired in the previous vlan. Am i right?
09-01-2024 11:53 PM
So what purpose of dhcp lease time if every client request ip address to the dhcp server and dhcp server assign different ip? lease time will make dhcp release the IP, without lease time the DHCP will for ever assume there is host use IP
and Yes there is con for this, if you remember your old previous issue about guest client and dhcp pool exhausted, this exhausted happened because guest connect ask IP then disconnect and re-connect ask IP this will exhaust the dhcp and dhcp dont have anymore IP to assign.
When the client connect to different vlan, this mean lease time still exist and not deleted until the leased time expired in the previous vlan. Am i right? Yes correct
09-01-2024 11:58 PM
yes i agree the dhcp will assign different ip if the dhcp pool is exhausted or we manually clear the binding. In my post now we can see the dhcp pool is not exhausted and when the client back to vlan 250 the client should have same ip since the lease time still not expired. I'm still not understand except my previous statement is true that dhcp on cisco router will not stored per vlan.
09-02-2024 12:01 AM
not exhausted <<- it will exhausted, you have 248 free IP to assign, make you vlan ask many IP and you end that dhcp pool dont have IP to assign, this case seen clearly with guest that why we suggest reduce lease time
MHM
09-02-2024 12:05 AM
yes it will exhausted but in my case now the pool is not exhausted, in my previous picture we can see the pool still have many free ip.
09-02-2024 12:10 AM
friend that why I make red color circle
NOW if the binding have 22 entry why leased is 44 ? there is 22 IP assign before to host and dhcp pool keep it and never re-assign it to other host (same mac or different mac) until the expire end
after expired end you will see leased equal binding
MHM
09-02-2024 12:16 AM
I try using my gadget,
When i connect to vlan 250 i got ip 10.100.50.51
Then i move to other vlan and i got ip 10.100.131.75. Now in the binding there are 2 entry with same mac address
Then i go back to vlan 250 and i still get same IP 10.100.50.51, but idk this is not happened with my laptop. My laptop always get different ip.
Sorry my friend when i capture of show ip dhcp binding you only see 22 due i not full capture the result, actually i have 44 binding. I'm sorry for that,
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide