Community discussions

MikroTik App
 
predel
just joined
Topic Author
Posts: 6
Joined: Thu Jan 25, 2024 11:45 am

Dhcp server static_only

Wed Apr 17, 2024 11:57 am

Hi,
I set myself DHCP to static_only. Server on debian 11, requires a static IP address to be entered. DHCP has a lease set for 1 day. After 30 days in the logs (DHCP leases) I have a status of waiting, I have to switch it to dhcp and then re-enter the static IP address into the configuration. How can I solve this problem? The second problem is I have static_only set, is there somewhere I can check what IP address it is trying to get from the dhcp server. I can't always from the devices read their mac-address

Thank you for your help. Peter
 
User avatar
vingjfg
Member
Member
Posts: 316
Joined: Fri Oct 20, 2023 1:45 pm

Re: Dhcp server static_only

Wed Apr 17, 2024 12:07 pm

Hi!

Can you post the output of the following command?
/ip/dhcp-server/export
Also, consider running "ip link" on your Debian server, so I have the MAC address.
 
predel
just joined
Topic Author
Posts: 6
Joined: Thu Jan 25, 2024 11:45 am

Re: Dhcp server static_only

Thu Apr 18, 2024 9:57 am

add address=10.10.0.199 client-id=1:74:78:27:77:40:37  mac-address=74:78:27:77:40:37 server=dhcp1
add address=10.10.0.198 client-id=1:d8:50:e6:3f:ba:5f  mac-address=D8:50:E6:3F:BA:5F server=dhcp1
add address=10.10.0.191 client-id=1:0:31:92:c5:f2:a0  mac-address=00:31:92:C5:F2:A0 server=dhcp1
add address=10.10.0.115 client-id=1:f8:25:51:36:cd:6d comment=Drukarka mac-address=F8:25:51:36:CD:6D server=dhcp1
add address=10.10.0.190 client-id=1:64:6e:e0:4a:d0:a3 mac-address=64:6E:E0:4A:D0:A3 server=dhcp1
add address=10.10.0.183 client-id=1:84:e3:42:7d:eb:e5  mac-address=84:E3:42:7D:EB:E5 server=dhcp1
add address=10.10.0.181 client-id=1:8:1c:6e:b2:b3:a0 mac-address=08:1C:6E:B2:B3:A0 server=dhcp1
add address=10.10.0.180 client-id=1:16:54:db:3:1d:8e mac-address=16:54:DB:03:1D:8E server=dhcp1
add address=10.10.0.179 client-id=1:d8:fc:93:8a:d6:8f mac-address=D8:FC:93:8A:D6:8F server=dhcp1
add address=10.10.0.178 client-id=1:62:fe:6b:b3:2d:af mac-address=62:FE:6B:B3:2D:AF server=dhcp1
add address=10.10.0.176 client-id=1:0:31:92:c6:36:10 mac-address=00:31:92:C6:36:10 server=dhcp1
add address=10.10.0.175 client-id=1:40:fa:fe:89:10:f5 mac-address=40:FA:FE:89:10:F5 server=dhcp1
add address=10.10.0.174 client-id=1:1c:53:f9:b:26:6c mac-address=1C:53:F9:0B:26:6C server=dhcp1
add address=10.10.0.173 client-id=1:f4:c8:8a:7d:f1:bd mac-address=F4:C8:8A:7D:F1:BD server=dhcp1
add address=10.10.0.172 client-id=1:68:a8:6d:9:69:70 mac-address=68:A8:6D:09:69:70 server=dhcp1
add address=10.10.0.171 client-id=1:a8:4a:28:77:f6:80 mac-address=A8:4A:28:77:F6:80 server=dhcp1
add address=10.10.0.170 client-id=1:48:4b:aa:91:57:da mac-address=48:4B:AA:91:57:DA server=dhcp1
add address=10.10.0.182 client-id=1:50:e5:49:5c:9b:b1 mac-address=50:E5:49:5C:9B:B1 server=dhcp1
add address=10.10.0.113 client-id=1:1c:99:57:7c:f5:b mac-address=1C:99:57:7C:F5:0B server=dhcp1
add address=10.10.0.112 mac-address=B0:2A:43:36:43:B3 server=dhcp1
[b]add address=10.10.0.104 comment="Server Lenovo SRV01" mac-address=6C:4B:90:79:B6:68 server=dhcp1[/b]
add address=10.10.0.88 client-id=ff:0:4c:cf:36:0:1:0:1:2d:7c:9d:ad:52:54:0:4c:cf:36 mac-address=52:54:00:4C:CF:36 server=dhcp1
add address=10.10.0.87 client-id=1:30:83:d2:fc:31:a4 mac-address=30:83:D2:FC:31:A4 server=dhcp1
add address=10.10.0.85 client-id=1:0:f7:6f:a9:6a:33 mac-address=00:F7:6F:A9:6A:33 server=dhcp1
add address=10.10.0.98 client-id=1:6c:4b:90:79:b6:68 mac-address=6C:4B:90:79:B6:68 server=dhcp1
/ip dhcp-server network
add address=10.10.0.0/24 comment="DHCP LAN" dns-server=8.8.8.8,8.8.4.4 domain=maj.lan gateway=10.10.0.1 netmask=24 ntp-server=194.146.251.100,194.146.251.101
This is what it looks like at my place. What's in bold is my server on lan network.
This is what the network configuration looks like on Debian
source /etc/network/interfaces.d/*

# loopback network interface
auto lo
iface lo inet loopback

# Basic network interface
allow-hotplug enp0s31f6
iface enp0s31f6 inet static
	address 10.10.0.104/24
	gateway 10.10.0.1
	# dns-* options are implemented by the resolvconf package, if installed
	dns-nameservers 10.10.0.104
	dns-search maj.lan
 
User avatar
vingjfg
Member
Member
Posts: 316
Joined: Fri Oct 20, 2023 1:45 pm

Re: Dhcp server static_only

Thu Apr 18, 2024 9:06 pm

Your /ip/dhcp-server/export is missing a few items. And you didn't send the output of ip link on the Debian box.

Regarding finding what IP a MAC is assigned (or tries to get), you can look in the logs
/log/print where topics~".*dhcp.*"
 
predel
just joined
Topic Author
Posts: 6
Joined: Thu Jan 25, 2024 11:45 am

Re: Dhcp server static_only

Fri Apr 19, 2024 10:55 am

I thought it was better to show the network settings.
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00 brd 00:00:00:00:00
2: enp0s31f6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
    link/ether 6c:4b:90:79:b6:68 brd ff:ff:ff:ff:ff:ff:ff
3: ztrfyhwjg5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 2800 qdisc fq_codel state UNKNOWN mode DEFAULT group default qlen 1000
    link/ether 56:c1:e1:1c:eb:18 brd ff:ff:ff:ff:ff:ff:ff
4: docker0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default 
    link/ether 02:42:78:07:a4:e7 brd ff:ff:ff:ff:ff:ff
5: br-d66f981ea3b3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default 
    link/ether 02:42:56:8f:8a:2a brd ff:ff:ff:ff:ff:ff:ff
7: veth5db428b@if6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master docker0 state UP mode DEFAULT group default 
    link/ether 2a:b9:d0:74:1a:d9 brd ff:ff:ff:ff:ff:ff link-netnsid 6
9: vethe771f0c@if8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master docker0 state UP mode DEFAULT group default 
    link/ether 56:aa:ff:6e:c5:ac brd ff:ff:ff:ff:ff:ff link-netnsid 3
11: veth96d1d4f@if10: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-d66f981ea3b3 state UP mode DEFAULT group default 
    link/ether 6a:02:99:f0:99:ec brd ff:ff:ff:ff:ff:ff link-netnsid 1
13: vethc590143@if12: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master docker0 state UP mode DEFAULT group default 
    link/ether 9a:2f:ba:49:bc:45 brd ff:ff:ff:ff:ff:ff link-netnsid 0
15: veth37349ac@if14: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master docker0 state UP mode DEFAULT group default 
    link/ether 8e:7a:eb:29:80:00 brd ff:ff:ff:ff:ff:ff link-netnsid 2
17: veth9b5c0ff@if16: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master docker0 state UP mode DEFAULT group default 
    link/ether 9e:a1:52:36:83:c6 brd ff:ff:ff:ff:ff:ff link-netnsid 5
19: vethd33f131@if18: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master docker0 state UP mode DEFAULT group default 
    link/ether 46:61:95:ec:1e:02 brd ff:ff:ff:ff:ff:ff link-netnsid 4
From today as I switched the card on Debian to dhcp because it stopped working again
/log> print where topics~".*dhcp.*"
09:50:44 dhcp,info dhcp1 deassigned 10.10.0.104 from 6C:4B:90:79:B6:68
09:50:50 dhcp,info dhcp1 assigned 10.10.0.104 to 6C:4B:90:79:B6:68
 
User avatar
vingjfg
Member
Member
Posts: 316
Joined: Fri Oct 20, 2023 1:45 pm

Re: Dhcp server static_only

Fri Apr 19, 2024 11:33 am

So it is getting the right IP from the reservation in DHCP, so all good.

If you set the IP on the server to static, DHCP will never see any request from the server and will thus never say that it is assigned: it will stay as "waiting" in the DHCP server. If you set the server to get the IP from DHCP, it will show up in the DHCP server as "bound", but that means your server is using DHCP.

Note that it doesn't indicate any issues, simply that your statically configured server doesn't request IP via DHCP. Which is normal.

A possible way around that is to set the lease time to infinite, make 1 DHCP request from your server, then fix the IP address. That will keep it as "bound" in the leases, but with a static configuration on the server side.
 
predel
just joined
Topic Author
Posts: 6
Joined: Thu Jan 25, 2024 11:45 am

Re: Dhcp server static_only

Mon Apr 22, 2024 11:35 am

and is it possible somehow for one IP to set infinite lease time ?
 
predel
just joined
Topic Author
Posts: 6
Joined: Thu Jan 25, 2024 11:45 am

Re: Dhcp server static_only

Mon Apr 22, 2024 11:39 am

found it, thanks for your help

Who is online

Users browsing this forum: No registered users and 17 guests