Community discussions

MikroTik App
 
tomasmato
newbie
Topic Author
Posts: 30
Joined: Thu May 19, 2022 3:23 pm

Problem with DHCP server on RB4011

Sat Dec 23, 2023 10:56 am

Hello everyone, I have an RB4011 within the network on which I run a DHCP server. Especially recently, what happens is that the client randomly gets lost and cannot find the IP address (which is statically assigned to it via DHCP). Clients are usually other Mikrotik devices. The client looks for an IP from DHCP Servef for hours. Only restarting one of the devices helps. The interesting thing is that I have another RB4011 in the network running DHCP Server and it has the same problem. I have versions 7.13 and 6.49.

Here is config of DHCP Server of one of my RB4011:
/ip dhcp-server
add address-pool=dhcp interface=bridge1 lease-time=10m name=dhcp1
/ip dhcp-server network
add address=10.20.1.0/24 dns-server=192.168.10.10,8.8.8.8 gateway=10.20.1.1 \
    netmask=24
I also have some hexS with a similar configuration and it works there without any problems.

Does anyone know what could be the problem and how to solve it?

Thank you very much in advance.
 
erlinden
Forum Guru
Forum Guru
Posts: 3017
Joined: Wed Jun 12, 2013 1:59 pm
Location: Netherlands

Re: Problem with DHCP server on RB4011

Sat Dec 23, 2023 1:51 pm

Comparing to my settings:

A leasetime of 10 minutes is very low, I increased it to 4hr.
I left netmask empty (it is already set in the address)

Perhaps with the above changes it will work better?
Otherwise you can set on debug logging on DHCP.
 
tomasmato
newbie
Topic Author
Posts: 30
Joined: Thu May 19, 2022 3:23 pm

Re: Problem with DHCP server on RB4011

Sun Dec 24, 2023 12:41 am

Comparing to my settings:

A leasetime of 10 minutes is very low, I increased it to 4hr.
I left netmask empty (it is already set in the address)

Perhaps with the above changes it will work better?
Otherwise you can set on debug logging on DHCP.
Thank you. I tried setting it up, so I'll see how it works...
It still seems strange to me that I only have this problem with RB4011 devices, but I don't have this problem with other types (hex, hexS, RB3011) - there are also DHCP servers with a lease time of 10 minutes... I was wondering if it could be some bug of RB4011?
 
tomasmato
newbie
Topic Author
Posts: 30
Joined: Thu May 19, 2022 3:23 pm

Re: Problem with DHCP server on RB4011

Sun Jan 07, 2024 5:42 pm

Hello, I let it run like this for some time (on both RB4011) and it still didn't help much... Couldn't it be a bug in the RB4011? I emphasize that the DHCP server works without problems on other devices in the same network (hex, hex S, RB3011, etc.), but for some reason it does not work well with the RB4011. Thanks in advance.
 
erlinden
Forum Guru
Forum Guru
Posts: 3017
Joined: Wed Jun 12, 2013 1:59 pm
Location: Netherlands

Re: Problem with DHCP server on RB4011

Sun Jan 07, 2024 5:48 pm

Don't think that it is RB4011 related. Can you share your complete config? Have you turned on additional logging?
/export file=anynameyoulike
Remove serial and any other private information.
 
tomasmato
newbie
Topic Author
Posts: 30
Joined: Thu May 19, 2022 3:23 pm

Re: Problem with DHCP server on RB4011

Sun Jan 14, 2024 1:33 pm

Hello,

sorry for the time delay, I am posting config below...
I removed all sensitive and private information and firewall settings (shouldn't affect it).

# 2024-01-14 12:14:04 by RouterOS 7.13
# model = RB4011iGS+
/interface bridge
add arp=proxy-arp name=bridge1 port-cost-mode=short
/interface list
add name=WAN
add name=LAN
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/ip pool
add name=dhcp ranges=10.20.1.2-10.20.1.251
/ip dhcp-server
add address-pool=dhcp interface=bridge1 lease-time=4h name=dhcp1
/port
set 0 name=serial0
set 1 name=serial1
/interface bridge port
add bridge=bridge1 interface="ether2" internal-path-cost=10 \
    path-cost=10
add bridge=bridge1 interface="ether3" \
    internal-path-cost=10 path-cost=10
add bridge=bridge1 interface="ether4" \
    internal-path-cost=10 path-cost=10
add bridge=bridge1 interface="ether5" \
    internal-path-cost=10 path-cost=10
add bridge=bridge1 interface=ether6 internal-path-cost=10 path-cost=10
add bridge=bridge1 interface=ether7 internal-path-cost=10 path-cost=10
add bridge=bridge1 interface=ether8 internal-path-cost=10 path-cost=10
add bridge=bridge1 interface=ether9 internal-path-cost=10 path-cost=10
add bridge=bridge1 interface=ether10 internal-path-cost=10 path-cost=10
/ip neighbor discovery-settings
set discover-interface-list=LAN
/interface list member
add interface=bridge1 list=LAN
add interface=ether1-privod list=WAN
add disabled=yes interface=vlan_bridge list=LAN
add disabled=yes interface=vlan_test list=LAN
/ip address
add address=10.20.1.1/24 interface=bridge1 network=10.20.1.0
add address=WAN IP comment="WAN" interface=ether1 \
    network=WAN network
/ip dhcp-server lease
add address=10.20.1.XX client-id=XXXXXXXXXX mac-address=\
    XX:XX:XX:XX:XX:XX server=dhcp1
# There are 30 static DHCP clients set up like this...
/ip dhcp-server network
add address=10.20.1.0/24 dns-server=192.168.10.10,8.8.8.8 gateway=10.20.1.1 \
    netmask=24
/ip dns
set allow-remote-requests=yes servers=192.168.10.10,8.8.8.8
/ip route
add disabled=no distance=1 dst-address=0.0.0.0/0 gateway=WAN Gateway pref-src=\
/tool mac-server
set allowed-interface-list=LAN
/tool mac-server mac-winbox
set allowed-interface-list=LAN
/tool romon
set enabled=yes

Thanks in advance.
 
Urajmal
just joined
Posts: 23
Joined: Thu Jul 26, 2018 6:23 pm

Re: Problem with DHCP server on RB4011

Sun Jan 14, 2024 2:39 pm

Does DHCP assign IPs if they are not staticaly set on RB4011?

What about if you set static IP on those remote Mikrotiks, and use the free range IP, instead of DHCP range?
 
tomasmato
newbie
Topic Author
Posts: 30
Joined: Thu May 19, 2022 3:23 pm

Re: Problem with DHCP server on RB4011

Sun Jan 14, 2024 2:44 pm

Yes, DHCP assigns IP addresses even if they are not set statically, but the problem is that when they are statically allocated - the client randomly loses them and does not take one until the restart.

As far as I know, yes, it is possible to set a static IP on the clients (and not use DHCP at all), but I decided to use DHCP in order to make it simple when I want to change the client's IP address...