DHCP server setup

Hi all!

This is my setup. I have ether1 and ether2. ether1 has dhcp-client set up and is connected to the cable modem (this works and I am connected to the internet).

ether2 I want to connect to a switch which again which again is connected to two computers. I’d like a DHCP server set up on ether2 so that the computers behind have a local ip and are also connected to the internet.

The problem is that ether2 is not giving out ip’s to the computers connected. I have followed these instructions:
http://www.mikrotik.com/testdocs/ros/2.9/ip/dhcp.php (point 1-3), so basically:
/ip pool add name=dhcp-pool ranges=172.16.0.10-172.16.0.20
/ip dhcp-server network add address=172.16.0.0/12 gateway=172.16.0.1
/ip dhcp-server add interface=ether2 address-pool=dhcp-pool

Have I forgot something? Do I have to manually specify that ether2 should have ip: 172.16.0.1?

If I get this to work, how will ether2 understand that it needs to go to ether1 to access the internet? Do I need to bridge ether1 and ether2?

Thank you for you help :slight_smile:

/ip dhcp-server add interface=ether1 address-pool=dhcp-pool

interface should be ether2

Sorry about that. My bad. This is fixed now. (this was a misprint when I posted. I did not do this on my router).

So to clarify: Problem is still there and I still need help :slight_smile:

are you blocking dhcp ports in firewall? 67-68

did you put in the dns servers in dhcp setup?

post

ip dhcp-server network print
ip pool print

You probably need a src-nat (masquerade) rule for this to happen.

I finally got the setup up and running. For people who work with this every day, I guess it’s pretty obvious: I needed to add a static IP to ether1:
/ip address add address=172.16.0.1 interface=ether2 netmask=255.255.0.0

After this I got an ip address from the dhcp-server set up on ether2.

So now I need to get ether2 to understand that ether1 is “the way to the internet”.

hilton recommended that I use src-nat (masquerade) (which I do not know what is), so I tried the bridge alternative instead. This “kinda” work: the computer connected to ether2 could now browse the internet, however its ip address was now given from my dsl provider (dhcp-server seemed to have been dropped…).

So I guess this is why hilton recommends src-nat (masquerade)…could someone give me a brief explanation of what this is? Is this a correct tutorial for my setup?

http://wiki.mikrotik.com/wiki/How_to_link_Public_addresses_to_Local_ones

Thank you all!

you can read fro this web http://mikrotik.unimedcenter.org/mikrotik-hotspot