Community discussions

MikroTik App
 
numan
newbie
Topic Author
Posts: 31
Joined: Mon Aug 11, 2014 11:44 am

DHCP Static Leases

Sun Aug 17, 2014 4:42 pm

Hello All,

I need help on setup a DHCP sever in Mikrotik with Pool IP and Nating, whenever any laptop connect to my network via wire, it get DHCP from my Router, but not allow to surf Internet, Until I allow or authenticate him.
 
brossler
just joined
Posts: 19
Joined: Tue Apr 15, 2014 10:42 pm
Location: Czech Republic

Re: DHCP Static Leases

Mon Aug 18, 2014 10:45 pm

Hello,

in order to set up DHCP server, you need to set up few things:

Add address of router to desired interface:
/ip address add interface=lan address=192.168.1.1/24
Create address pool:
/ip pool add name=lan addresses=192.168.1.128-192.168.1.254
Create a network in DHCP settings (this is set of parameters distributed to clients with IP address):
/ip dhcp-server network add address=192.168.1.0/24 gateway=192.168.1.1 dns-server=8.8.8.8 netmask=24
Create DHCP server
/ip dhcp-server add name=lan interface=lan address-pool=lan
Now, you can go to DHCP leases and click onto every record that is valid and make it static by clicking Make Static button. It will make sure that the PC will always get the same IP, unless you remove static entry or change IP address in that entry.

Before you create filter rule, it is important to set up list of valid useres. Otherwise, you could block yourself out (e. g. 192.168.1.25 is your PC):
/ip firewall address-list add address=192.168.1.25 list=user
Once you setted all users to address list, you can create firewall filter rule that will block new devices (IP addresses that are not listed in address-list user):
/ip firewall filter add chain=forward action=drop src-address-list!=user in-interface=lan
/ip firewall filter add chain=input action=drop src-address-list!=user in-interface=lan
When new PC is connected, it can not access internet nor router. In order to authenticate it, you simply go to DHCP leases and make its IP static, than add its IP to address list.

PS: If you block yourself due to wrong filter rule, you can still access it via MAC address. If you would like to disable this "backdoor", you can go to tools>mac-server and disable interfaces in telnet and winbox tabs. I recomend to do this on your WAN interface and all publicly accessible networks for security reasons.

I hope this was helpful to you.
 
User avatar
allansud
just joined
Posts: 14
Joined: Mon Jun 09, 2014 10:57 pm

Re: DHCP Static Leases

Tue Aug 19, 2014 3:53 pm

Hi there,

I have a problem very similar, when I reset my mikrotik RB750 and erase the config and start to config everything from 0 my dhcp server always is RED and not set ips to the clients!!!! My version is v6.18. Can someone help me in this matter?

Thanks!
 
brossler
just joined
Posts: 19
Joined: Tue Apr 15, 2014 10:42 pm
Location: Czech Republic

Re: DHCP Static Leases

Wed Aug 20, 2014 10:26 pm

Hello,
You are likely forgeting something. Dont worry, it happened to me all the time when I was beginer. Check if you set up these things:
  • Is IP address set for interface, where DHCP server is running? (/ip address)
    Is address pool created? (/ip pool)
    Is address pool set for DHCP server? (/ip dhcp-server set 0 address-pool=name of the pool)
    Is network set up in DHCP Networks (/ip dhcp-server network)
If all of those points are set and yet, it is not working, post export of settings and I will try to help you.
Also, you could try clicking "DHCP Setup" button and it will walk you through all the settings by asking you what interface, address range etc. you want your DHCP server run on.
 
User avatar
allansud
just joined
Posts: 14
Joined: Mon Jun 09, 2014 10:57 pm

Re: DHCP Static Leases

Wed Aug 20, 2014 10:58 pm

Hello,
You are likely forgeting something. Dont worry, it happened to me all the time when I was beginer. Check if you set up these things:
  • Is IP address set for interface, where DHCP server is running? (/ip address)
    Is address pool created? (/ip pool)
    Is address pool set for DHCP server? (/ip dhcp-server set 0 address-pool=name of the pool)
    Is network set up in DHCP Networks (/ip dhcp-server network)
If all of those points are set and yet, it is not working, post export of settings and I will try to help you.
Also, you could try clicking "DHCP Setup" button and it will walk you through all the settings by asking you what interface, address range etc. you want your DHCP server run on.
Hi Brossler,

I solve this problem! I was putting the wrong interface in ip->address!! But your tips help me a lot...
 
numan
newbie
Topic Author
Posts: 31
Joined: Mon Aug 11, 2014 11:44 am

Re: DHCP Static Leases

Sat Aug 23, 2014 1:14 pm

Infact, I solved the problem without creating firewall rules, just simply in LAN Interface I select no reply, aft wards whenever new user connecting to my network I can see the IP taking from my Pool, then making it static the IP of PC, and adding it in ARP, Now the user will have access to internet, without adding nobody can surf internet and even if the put manually the IP.

Thanks to Mikro for such a good facilities and thanks for all good advises.

Who is online

Users browsing this forum: Rendy and 53 guests