Community discussions

 
49er
Member
Member
Topic Author
Posts: 401
Joined: Tue Sep 27, 2011 7:55 am

DHCP server with static leases

Fri Mar 08, 2013 2:34 pm

Hi,

I use my mikrotik as an DHCP server.
This is working fine.
Now I want only static-IP's, so a static lease.
I found this:
/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"

This wil work but now second thing.
I have two gateways in my network.
Can I allso add the gateway address to a static lease?
For example I want that foo-31 use 192.168.1.254 as default gateway and got this from the DHCP server
and that bar-07 use 192.168.1.1 ad default gateway and get this from the DHCP server.
 
Ivoshiee
Member
Member
Posts: 471
Joined: Sat May 06, 2006 4:11 pm

Re: DHCP server with static leases

Fri Mar 08, 2013 5:22 pm

The gateway assignment is done under "/ip dhcp-server network". Just add /32 mask "networks" for your single hosts and assign different gateways for each of them. Also, you may have a general /24 netmask entry for that whole network as well, nothing will get broken - the single defined exceptions will take priority.

Who is online

Users browsing this forum: No registered users and 30 guests