Community discussions

MikroTik App
 
Pygmalion
just joined
Topic Author
Posts: 8
Joined: Thu Sep 01, 2016 9:36 am

Binding IP and MAC

Thu Nov 19, 2020 7:31 pm

I have googled the Internet and got only instructions for old RouterOs versions.

I have recently bought a MikroTik router. I have installed the basic options with Quick Set.

Now I want to bind MAC addresses to static IPs, just as I had in previous two routers.

I tried to WebFig/ARP/Add New. However, nothing happens. The IP of the device is still the same, even if I reset the device.

What I am doing wrong?
 
User avatar
CZFan
Forum Guru
Forum Guru
Posts: 1882
Joined: Sun Oct 09, 2016 8:25 pm
Location: South Africa, Randburg
Contact:

Re: Binding IP and MAC

Thu Nov 19, 2020 8:17 pm

I have googled the Internet and got only instructions for old RouterOs versions.

I have recently bought a MikroTik router. I have installed the basic options with Quick Set.

Now I want to bind MAC addresses to static IPs, just as I had in previous two routers.

I tried to WebFig/ARP/Add New. However, nothing happens. The IP of the device is still the same, even if I reset the device.

What I am doing wrong?

You should do this in menu IP-->DHCP, not ARP
MTCNA, MTCTCE, MTCRE & MTCINE
 
Pygmalion
just joined
Topic Author
Posts: 8
Joined: Thu Sep 01, 2016 9:36 am

Re: Binding IP and MAC

Thu Nov 19, 2020 8:25 pm


You should do this in menu IP-->DHCP, not ARP

Can you be more specific? IP/DHCP Client, IP/DHCP Server, IP/DHCP Relay? What next?

I already tried IP/DHCP Server/DHCP/Add new, but there is no box for specifying MAC address.
 
Sob
Forum Guru
Forum Guru
Posts: 6260
Joined: Mon Apr 20, 2009 9:11 pm

Re: Binding IP and MAC

Thu Nov 19, 2020 8:44 pm

IP->DHCP Server->Leases

Easiest way is to let device get dynamic address and then select Make Static, so you won't have to type MAC address yourself. You can then change IP address if you want and device will get it next time.
People who quote full posts should be spanked with ethernet cable. Some exceptions for multi-topic threads may apply. Not intended as incentive for masochists.
 
Pygmalion
just joined
Topic Author
Posts: 8
Joined: Thu Sep 01, 2016 9:36 am

Re: Binding IP and MAC

Thu Nov 19, 2020 8:58 pm

IP->DHCP Server->Leases

Easiest way is to let device get dynamic address and then select Make Static, so you won't have to type MAC address yourself. You can then change IP address if you want and device will get it next time.

I tried that too. What happens that after a while I have two addresses for one MAC on the leases list, and the one that is working is the one I don't want!
 
mkx
Forum Guru
Forum Guru
Posts: 5018
Joined: Thu Mar 03, 2016 10:23 pm

Re: Binding IP and MAC

Thu Nov 19, 2020 9:17 pm

I tried that too. What happens that after a while I have two addresses for one MAC on the leases list, and the one that is working is the one I don't want!

You'll have to wait a bit longer, until original lease (which you don't want) expires. DHCP server can not push another address to the device, device has to go into re-new procedure during which server assigns new address.
How long do you have to wait? Until timer in column "Expires After" doesn't count down to 0. But that's the latest time. Most of devices start re-lease procedure at half-time.
BR,
Metod
 
Sob
Forum Guru
Forum Guru
Posts: 6260
Joined: Mon Apr 20, 2009 9:11 pm

Re: Binding IP and MAC

Thu Nov 19, 2020 9:34 pm

Are you by any chance doing something wrong with Client ID field? Like using it as comment or something? It would break things. That's the only explanation that I can currently think of, how you can get two entries for same MAC address.
People who quote full posts should be spanked with ethernet cable. Some exceptions for multi-topic threads may apply. Not intended as incentive for masochists.
 
Pygmalion
just joined
Topic Author
Posts: 8
Joined: Thu Sep 01, 2016 9:36 am

Re: Binding IP and MAC

Thu Nov 19, 2020 9:41 pm

I tried that too. What happens that after a while I have two addresses for one MAC on the leases list, and the one that is working is the one I don't want!

You'll have to wait a bit longer, until original lease (which you don't want) expires. DHCP server can not push another address to the device, device has to go into re-new procedure during which server assigns new address.
How long do you have to wait? Until timer in column "Expires After" doesn't count down to 0. But that's the latest time. Most of devices start re-lease procedure at half-time.
You are right about the second part. After timer gets to 5:00, device starts re-lease, but it gets the same WRONG IP address again!

Image
 
Pygmalion
just joined
Topic Author
Posts: 8
Joined: Thu Sep 01, 2016 9:36 am

Re: Binding IP and MAC

Thu Nov 19, 2020 9:55 pm

Are you by any chance doing something wrong with Client ID field? Like using it as comment or something? It would break things. That's the only explanation that I can currently think of, how you can get two entries for same MAC address.
Thanks, that helped.

So does this mean I may not change Client ID field?
 
Sob
Forum Guru
Forum Guru
Posts: 6260
Joined: Mon Apr 20, 2009 9:11 pm

Re: Binding IP and MAC

Thu Nov 19, 2020 10:27 pm

You can change it, it's why the field is there, the problem is that it's something different than you think. :) I'll admit that I don't know too much about it myself, for example where it's actively used. It's some identifier chosen by client and server can use it as another condition besides MAC address. And it's exactly what happened, you added something, client sent something else, condition didn't match, so client got another address.

If you just need to describe the entry, you can use comment, WebFig has it as separate field at the bottom, WinBox has it behind another button.

If you're looking for hostnames you can use on other devices, there's currently no good solution in RouterOS. It's possible to use lease script to add static DNS entries. But unless you have multiple local subnets, it's probably best to ignore it and let devices use mDNS (automatic hostnames under .local TLD).
People who quote full posts should be spanked with ethernet cable. Some exceptions for multi-topic threads may apply. Not intended as incentive for masochists.
 
Pygmalion
just joined
Topic Author
Posts: 8
Joined: Thu Sep 01, 2016 9:36 am

Re: Binding IP and MAC

Thu Nov 19, 2020 11:04 pm

You can change it, it's why the field is there, the problem is that it's something different than you think. :) I'll admit that I don't know too much about it myself, for example where it's actively used. It's some identifier chosen by client and server can use it as another condition besides MAC address. And it's exactly what happened, you added something, client sent something else, condition didn't match, so client got another address.

If you just need to describe the entry, you can use comment, WebFig has it as separate field at the bottom, WinBox has it behind another button.

If you're looking for hostnames you can use on other devices, there's currently no good solution in RouterOS. It's possible to use lease script to add static DNS entries. But unless you have multiple local subnets, it's probably best to ignore it and let devices use mDNS (automatic hostnames under .local TLD).

The comment is awkward. It creates another line with a comment instead of putting it in another column. Quite silly, actually.

I don't understand the last paragraph. I guess that is something I do not need.
 
Sob
Forum Guru
Forum Guru
Posts: 6260
Joined: Mon Apr 20, 2009 9:11 pm

Re: Binding IP and MAC

Thu Nov 19, 2020 11:42 pm

I don't see option for that in WebFig, but WinBox can show comments in another column on same line.

Last paragraph was about hostnames. You can connect to your RasPi from other devices (if you have some servers running on it, file shares, etc..) using "192.168.88.99", but not everyone wants to remember addresses, so perhaps you may want to use "RaspberryPi-WLAN" instead.
People who quote full posts should be spanked with ethernet cable. Some exceptions for multi-topic threads may apply. Not intended as incentive for masochists.

Who is online

Users browsing this forum: pubudeux and 114 guests