Community discussions

MikroTik App
 
jakkwb
Member Candidate
Member Candidate
Topic Author
Posts: 133
Joined: Tue Jun 26, 2007 8:31 am

Mikrotik DHCP lease time with Ubiquiti and wireless routers

Thu May 14, 2020 5:02 am

Hello all. Cannot get any help on this from Ubiquiti.

I use Mikrotiks at all my towers, using DHCP to hand the IP to the Ubiquiti radios. The radio is configured to then hand out an IP to the customers router.

My problem is this - the radio is reporting the lease to the customer router to be expired, and it does not renew. So, customer loses internet.

This does not happen with all routers, but several different models.

Does anyone have any suggestions to try?
 
User avatar
bpwl
Forum Guru
Forum Guru
Posts: 2993
Joined: Mon Apr 08, 2019 1:16 am

Re: Mikrotik DHCP lease time with Ubiquiti and wireless routers

Thu May 14, 2020 10:53 am

Hello all. Cannot get any help on this from Ubiquiti.

I use Mikrotiks at all my towers, using DHCP to hand the IP to the Ubiquiti radios. The radio is configured to then hand out an IP to the customers router.

My problem is this - the radio is reporting the lease to the customer router to be expired, and it does not renew. So, customer loses internet.

This does not happen with all routers, but several different models.

Does anyone have any suggestions to try?
What is the exact DHCP setup?
DHCP server on Mikrotik, DHCP client and relay on Ubiquiti, DHCP client on customers router?
DHCP server on Mikrotik, DHCP client on Ubiquiti with bridged connection, DHCP client on customers router?
Something still different?

Expected behaviour: Lease renewal is started by the client at 1/2 of lease time.
So this "the radio is reporting the lease to the customer router to be expired" is confusing for me.
 
jakkwb
Member Candidate
Member Candidate
Topic Author
Posts: 133
Joined: Tue Jun 26, 2007 8:31 am

Re: Mikrotik DHCP lease time with Ubiquiti and wireless routers

Thu May 14, 2020 6:03 pm

Yes DHCP server on Mikrotik. I have these IPs set to static after they are assigned to the devices.
Ubiquiti AP is bridged
Yes DHCP server on Ubiquiti radio to user. Renewal timer is set to 172800 seconds
Yes DHCP server on end users router - whatever the default timer setting is. Didn't check it.

I understand about the lease renewal, but the end users router apparently does not do it/get it. It shows expired instead of it being renewed. These are typically Linksys routers. Just a handful of clients. All setups are the same and the other 99% work fine with this setup.
 
User avatar
bpwl
Forum Guru
Forum Guru
Posts: 2993
Joined: Mon Apr 08, 2019 1:16 am

Re: Mikrotik DHCP lease time with Ubiquiti and wireless routers

Thu May 14, 2020 6:18 pm

Yes DHCP server on Mikrotik. I have these IPs set to static after they are assigned to the devices.
Ubiquiti AP is bridged
Yes DHCP server on Ubiquiti radio to user. Renewal timer is set to 172800 seconds
Yes DHCP server on end users router - whatever the default timer setting is. Didn't check it.

I understand about the lease renewal, but the end users router apparently does not do it/get it. It shows expired instead of it being renewed. These are typically Linksys routers. Just a handful of clients. All setups are the same and the other 99% work fine with this setup.
Carefull here!

"Dhcp server on Mikrotik, Ubiquiti bridged, DHCP server on Ubiquiti "...... would mean there are 2 DHCP servers on one bridged network. That will create confilcts!

DHCP server MKT - DHCP client UBI -UBI routing -DHCP server UBI radio - DHCP client user router on WAN interface - DHCP server user router LAN interface ..... is no problem

DHCP server MKT - DHCP client UBI -UBI bridge - DHCP client user router on WAN interface - DHCP server user router LAN interface .... is also no problem.
 
jakkwb
Member Candidate
Member Candidate
Topic Author
Posts: 133
Joined: Tue Jun 26, 2007 8:31 am

Re: Mikrotik DHCP lease time with Ubiquiti and wireless routers

Fri May 15, 2020 2:45 am

Here is my network:
Mikrotik Ether port for Ubnt AP 10.11.12.1
Mikrotik DHCP pool 10.11.12.3-30 to Ubnt radio at user
Ubnt AP - bridged 10.11.12.2
Ubnt SM at user - gets IP from Mikrotik 10.11.12.3-30
Ubnt SM at user - in routed mode using DHCP to hand IP to users router at 192.168.10.x
Users router also doing DHCP to end user devices usually at 192.168.1.x

Please explain to me what is wrong with this and how I could improve it.

Thank you.
 
User avatar
bpwl
Forum Guru
Forum Guru
Posts: 2993
Joined: Mon Apr 08, 2019 1:16 am

Re: Mikrotik DHCP lease time with Ubiquiti and wireless routers

Fri May 15, 2020 12:35 pm

Trying to understand your network setup.

So far I understand this (might be wrong understanding).

DHCP server MKT - DHCP client UBI -UBI bridge - DHCP client user router on WAN interface - DHCP server user router LAN interface .... is also no problem.
------------------------------------------1-------------------------------------------------------------------------- router -------------------------------------2------------------------------------------------

---1--- MKT router (10.11.12.1)
---1--- MKT DHCP server for subnet at ether port (10.11.12.3-30)
---1---Ubnt AP (10.11.12.2)
---1---Ubnt SM at user WAN (10.11.12.3-30)
router
------2---Ubnt SM ether LAN (192.168.10.1)
------2---Ubnt SM DHCP server at ether (192.168.10.x-y)
------2---user router WAN (192.168.10.x)
router
---------3---user router LAN 192.168.1.1)
---------3---user devices (192.168.1.x)



Please explain to me what is wrong with this and how I could improve it. This seams fully OK.
Your problem is that "---1---Ubnt SM at user WAN (10.11.12.3-30)" does not renew its IP address at "---1--- MKT DHCP server for subnet at ether port (10.11.12.3-30)" ?

Then log of MKT could help. (Maybe you can maximize logging with extra DHCP/debug logging)
Klembord-2.jpg
You do not have the required permissions to view the files attached to this post.
 
2frogs
Forum Veteran
Forum Veteran
Posts: 713
Joined: Fri Dec 03, 2010 1:38 am

Re: Mikrotik DHCP lease time with Ubiquiti and wireless routers

Fri May 15, 2020 6:01 pm

@bpwl
This is a Ubiquiti issue. The clients routers are not getting DHCP from the Ubiquiti CPE.
I use Mikrotiks at all my towers, using DHCP to hand the IP to the Ubiquiti radios. The radio is configured to then hand out an IP to the customers router.

@jakkwb
You might try changing lease time to 86400s, some devices don't like long lease times and other don't like short. Bridging some of the offending clients Ubiquiti to use the Mikrotik DHCP and adding the extra logging bpwl suggested might help you identify the issue.
 
User avatar
bpwl
Forum Guru
Forum Guru
Posts: 2993
Joined: Mon Apr 08, 2019 1:16 am

Re: Mikrotik DHCP lease time with Ubiquiti and wireless routers

Fri May 15, 2020 6:53 pm

@bpwl
This is a Ubiquiti issue. The clients routers are not getting DHCP from the Ubiquiti CPE.
I use Mikrotiks at all my towers, using DHCP to hand the IP to the Ubiquiti radios. The radio is configured to then hand out an IP to the customers router.

Don't get it. Why do you call it Mikrotik DHCP? . Because "Mikrotik using DHCP to hand the IP to the Ubiquiti radios.". That's OK.

"The radio is configured to then hand out an IP to the customers route" ... how does the radio do that ? They have a DHCP server ? A DHCP relay ? Using the Mikrotik DHCP pool ?
 
jakkwb
Member Candidate
Member Candidate
Topic Author
Posts: 133
Joined: Tue Jun 26, 2007 8:31 am

Re: Mikrotik DHCP lease time with Ubiquiti and wireless routers

Fri May 15, 2020 7:15 pm

Yes, the Ubiquitis in router mode can do DHCP to hand out IPs with its own configured IP pool.
Last edited by jakkwb on Fri May 15, 2020 7:32 pm, edited 1 time in total.
 
mducharme
Trainer
Trainer
Posts: 1777
Joined: Tue Jul 19, 2016 6:45 pm
Location: Vancouver, BC, Canada

Re: Mikrotik DHCP lease time with Ubiquiti and wireless routers

Fri May 15, 2020 7:17 pm

I don't understand how this could be a MikroTik problem either - if the only problem is that the Ubiquiti radio is not giving DHCP leases to the clients on the LAN port, surely that is a Ubiquiti issue and not anything to do with MikroTik?
 
User avatar
bpwl
Forum Guru
Forum Guru
Posts: 2993
Joined: Mon Apr 08, 2019 1:16 am

Re: Mikrotik DHCP lease time with Ubiquiti and wireless routers

Fri May 15, 2020 7:27 pm

2 DHCP servers on one bridged network. That will create confilcts!
One DHCP server will send NACK to the client for an address leased by the other.. I also see only one IP address pool, so who owns the pool.?

https://serverfault.com/questions/36851 ... ne-network
Last edited by bpwl on Fri May 15, 2020 7:33 pm, edited 1 time in total.
 
mducharme
Trainer
Trainer
Posts: 1777
Joined: Tue Jul 19, 2016 6:45 pm
Location: Vancouver, BC, Canada

Re: Mikrotik DHCP lease time with Ubiquiti and wireless routers

Fri May 15, 2020 7:31 pm

2 DHCP servers on one bridged network. That will create confilcts!
One DHCP server will send NACK to the client for an address leased by the other.. I also see only one IP address pool, so who owns the pool.?
From reading above I don't think there are 2 DHCP servers on the same bridged network here. I believe he has a DHCP server on the MikroTik handing out IPs to the Ubiquiti subscriber unit WAN ports, with the Ubiquiti Access Points on static IPs in bridged mode. So everything is bridged from the MikroTik to the Ubiquiti SU's and the only DHCP server there is the MIkroTik. Then the Ubiquiti SU is configured as a router, and the Ubiquiti SUs each have a DHCP server on their LAN port, which is not the same broadcast domain as the WAN port because it is in router mode. The Ubiquiti Access Points have no DHCP servers on them.

At least I believe that is how it works, from reading his explanations above.
 
jakkwb
Member Candidate
Member Candidate
Topic Author
Posts: 133
Joined: Tue Jun 26, 2007 8:31 am

Re: Mikrotik DHCP lease time with Ubiquiti and wireless routers

Fri May 15, 2020 7:33 pm

Yes that is correct.
 
User avatar
bpwl
Forum Guru
Forum Guru
Posts: 2993
Joined: Mon Apr 08, 2019 1:16 am

Re: Mikrotik DHCP lease time with Ubiquiti and wireless routers

Fri May 15, 2020 7:39 pm

2 DHCP servers on one bridged network. That will create confilcts!
One DHCP server will send NACK to the client for an address leased by the other.. I also see only one IP address pool, so who owns the pool.?
From reading above I don't think there are 2 DHCP servers on the same bridged network here. I believe he has a DHCP server on the MikroTik handing out IPs to the Ubiquiti subscriber unit WAN ports, with the Ubiquiti Access Points on static IPs in bridged mode. So everything is bridged from the MikroTik to the Ubiquiti SU's and the only DHCP server there is the MIkroTik. Then the Ubiquiti SU is configured as a router, and the Ubiquiti SUs each have a DHCP server on their LAN port, which is not the same broadcast domain as the WAN port because it is in router mode. The Ubiquiti Access Points have no DHCP servers on them.

At least I believe that is how it works, from reading his explanations above.
Indeed , that's what it should be like, and how it should work. And all lease activity for that range would be visible in the Mikrotik.
So the Ubnt AP' is NOT handing out IP addresses itself and is not in routing mode. (The DHCP handshake is passed over its bridge).
 
jakkwb
Member Candidate
Member Candidate
Topic Author
Posts: 133
Joined: Tue Jun 26, 2007 8:31 am

Re: Mikrotik DHCP lease time with Ubiquiti and wireless routers

Fri May 15, 2020 7:42 pm

So the Ubnt radio is the problem, or the home router? Should I have the same or different renew times on everything, or does it even matter? Or should I just bridge the Ubnt user radio and let the Mikrotik hand the IP straight to the users router?
 
mducharme
Trainer
Trainer
Posts: 1777
Joined: Tue Jul 19, 2016 6:45 pm
Location: Vancouver, BC, Canada

Re: Mikrotik DHCP lease time with Ubiquiti and wireless routers

Fri May 15, 2020 7:53 pm

So the Ubnt radio is the problem, or the home router? Should I have the same or different renew times on everything, or does it even matter? Or should I just bridge the Ubnt user radio and let the Mikrotik hand the IP straight to the users router?
Lease times shouldn't really matter.

If the end user's Linksys router is not renewing its lease with the Ubiquiti subscriber unit LAN port DHCP server, there are a few possible causes:

1. The customer Linksys router is trying to renew its IP with the Ubiquiti SU and the SU is for some reason refusing to renew the lease. You would have to check the logs on the SU and wireshark on the packets to try to see what is happening.
2. The customer Linksys router is trying to renew its IP with the Ubiquiti SU, the SU offers the renewal but the customer router refuses the offered renewal. Here you would have to rely on whatever logging the linksys has, which may not be very helpful. You can also use wireshark although it may not tell you exactly why the customer router is refusing the offered renewal.
3. The customer Linksys router is not attempting to renew its IP at all. I've seen some very buggy DHCP client implementations where the client does not attempt to renew the lease until after the original lease has run out. I would hope that Linksys is not this bad but would not guarantee it. You would see this through wireshark, by seeing that the Linksys is not even making a request in the first place.

I think to solve this you may have to borrow one of the affected routers and set up an SU in a similar way but with a very short lease time, then do a packet capture with wireshark to try to see what is happening in between. Ubiquiti radios also have tcpdump on them which you can use to do this capture remotely if borrowing one of the affected Linksys devices is not possible.
 
User avatar
bpwl
Forum Guru
Forum Guru
Posts: 2993
Joined: Mon Apr 08, 2019 1:16 am

Re: Mikrotik DHCP lease time with Ubiquiti and wireless routers

Fri May 15, 2020 8:18 pm

The IP pool of the Mikrotik and the IP pool of the Ubiquiti SU should not overlap. (see previous link: having 2 DHCP servers ona network)
Pool Mikrotik= 10.11.12.3-30, Ubiquiti= 10.11.12.31-60 just for illustration.

Then it is easy to see which DHCP server did give out the lease as well, and there will never be doubles or conflicts.

Who is online

Users browsing this forum: akakua, Majestic-12 [Bot] and 135 guests