Tag Archives: ip address

Configure Mikrotik DHCP to assign ip address to only authorized client(s) {2nd Method}

To achieve the same goal, you can also consult this post and decide yourself that which method suit you better!

mikrotik

Scenario:

Mikrotik is working as dhcp, dns, and default gateway for local network.

Read more of this post

Configure Mikrotik DHCP to assign ip address to only authorized client(s)

Scenario:

Mikrotik is working as dhcp, dns, and default gateway for local network.

Extra Requirement:

Mikrotik only assign ip address(es) to authorized client(s) in our local network!

Here are the steps to achieve this requirement:

Connect to the Mikrotik router using it’s ip address through web browser:

Click on the button, select the ip address of Mikrotik, enter username and password, then click Connect:

IP —>DHCP Server

From the Leases tab, select the client(s), which are authorized to take ip address from Mikrotik router (in future) and then click Make Static:

Move to the DHCP tab and double-click on the DHCP Server and select the static-only from Address Pool drop down menu:

After that, only authorized client(s) will get ip address from Mikrotik. If you want that new client get an ip address from Mikrotik, then you can select the dhcp_pool1 from Address Pool drop down menu. After that Mikrotik will assign an ip address to new client, make this ip address to static (as described above) and select static-only again in order to disallow ip address assignment to unknown client(s).

Hope this will help you!

Please Remember me in your prayers!

How to Install the DHCP Server on Ubuntu 12.04LTS

Ubuntu as DHCP Server:

To install dhcp server, enter the following command at a terminal prompt:

sudo apt-get install isc-dhcp-server

If there is more than one network card(s) in your Ubuntu server, then you have to select the network card on which your server will be listen for dhcp request. (By default, it listens on eth0).

You can change this by editing  /etc/default/isc-dhcp-server file:

sudo nano /etc/default/isc-dhcp-server

Change “eth0” to the interface on which you want that your server will listen for dhcp request (In my case, it is eth1):

It’s always a good practice to make a backup copy of /etc/dhcp/dhcpd.conf file:

sudo cp /etc/dhcp/dhcpd.conf /etc/dhcp/dhcpd.conf.bak 

Now we will change the default configuration by editing /etc/dhcp/dhcpd.conf, I normally delete everything inside the file and manually add the configuration that suits my needs 🙂

sudo nano /etc/dhcp/dhcpd.conf

Here is my dhcpd.conf file, you need to change it according to your needs:

ddns-update-style none;
default-lease-time 600;
max-lease-time 7200;
authoritative;
log-facility local7;
option subnet-mask 255.255.255.0;
option broadcast-address 10.10.1.255;
option routers 10.10.1.1;
option domain-name-servers 10.10.1.1;
option domain-name "ubuntu.internal";
subnet 10.10.1.0 netmask 255.255.255.0 {
range 10.10.1.50 10.10.1.200;
}

Restart dhcp service using the following command:

sudo service isc-dhcp-server restart 

Configure Windows as DHCP Client:

Just follow these steps, in order to configure your Windows machine as DHCP client (In my case, it’s Windows 7):

To check the IP Address on Windows 7:

To Check the DHCP Leases on Ubuntu Server:
sudo tail /var/lib/dhcp/dhcpd.leases

Hope this will help you!

Please Remember me in your prayers!