DHCP assigment static IP

Hello

currently I’m use my linux router with ISC DHCP server with below setting which is assign each user with an static IP .
in meanwhile in my test environment I use mikrotik routeros and I have configured as DHCP server as well and my plan is to change my router & dhcp server from linux box to mikrotik and migration all my users over 100 user with zero downtime. but till now i didn’t find the right configuration which make the dhcp same way of my linux box
I need to assign each client an special IP none generated from pool.

like below

# my mac laptop
host 8 {
  hardware ethernet 00:4f:62:16:6b:6e;
  fixed-address 192.168.1.9;
}

# room 9
host 9 {
  hardware ethernet 00:4f:62:1c:de:f4;
  fixed-address 192.168.1.10;
}

# laptop 10
host 10 {
  hardware ethernet 00:4f:62:0d:d4:b5;
  fixed-address 192.168.1.11;
}

# iphone 11
host 11 {
  hardware ethernet 0c:74:c2:2d:5f:56;
  fixed-address 192.168.1.12;

make static not the right way.

Thanks in advance.

Make static may not be the way to do 100 users, but if you do one case and export the configuration before and after, you can compare the exports and then write CLI commands based on that example. This can be a very useful technique since the documentation is often short on examples. Based on that kind of experiment, something like this should work for you too:

/ip dhcp-server lease
add address=192.168.1.104 mac-address=00:97:30:32:34:77 comment="foo-31"
add address=192.168.1.105 mac-address=00:2B:71:A3:82:46 comment="bar-07"
add address=192.168.1.106 mac-address=74:58:16:69:DF:D3 comment="baz-89"

Write those rules in a file, (e.g. “static_dhcp_leases.rsc”), upload it to the router, and execute it as a script.

See the manual on the wiki for more options: http://wiki.mikrotik.com/wiki/Manual:IP/DHCP_Server#Leases

thank you for your effort

it’s work , issue it was with client-id after export the configuration before and after, and compare the exports found the client-id look like mac-address but have one more field start with 1: and any field start with 00: or with 0c: will change it to 0: and c: like that
example

add address=192.168.1.19 client-id=1:c:74:c2:bf:1f:2c mac-address=0c:74:c2:bf:1f:2c comment=" iphone4" server=server1
add address=192.168.1.20 client-id=1:0:25:d0:b1:32:06 mac-address=00:25:d0:b1:32:06 comment=" Mobile E71" server=server1
add address=192.168.1.21 client-id=1:0:23:6c:84:f1:0b mac-address=00:23:6c:84:f1:0b comment=" MacBook" server=server1

You can use both, but only need to specify one, so using just the MAC address would probably simplify your life and reduce the chance of errors.

Using client-id is much more common when you’re assigning based on host name.

Can someone explain what the server-name should be in the add lease command? I assume it’s something internal int he router, but not sure if it’s something I create or something else?