Community discussions

MikroTik App
 
mikrotiker2916
just joined
Topic Author
Posts: 10
Joined: Sat Jun 25, 2016 2:55 pm

dhcp server does not work on an interface

Tue Aug 30, 2016 3:40 pm

Hi, I created a dhcp server with the IP ranges and when I connected my PC to the interface where I defined the dhcp server, it does not hand out any IP addresses. Static assignment is recognized and works fine with access to both the subnet and the internet. I am thinking that my definition of the dhcp server is correct. Please help if you can spot the error in this config I have attached. Thank you.

tiker

------------------------------------------------------------------------------------------------------

#
/interface ethernet
set [ find default-name=ether4 ] name=LAN
set [ find default-name=ether1 ] name=WAN
set [ find default-name=ether2 ] master-port=LAN
set [ find default-name=ether3 ] master-port=LAN
/ip pool
add name=dhcp-pool ranges=192.168.10.50-192.168.10.100
/ip dhcp-server
add address-pool=dhcp-pool interface=LAN name=dhcp1
/ip address
add address=192.168.0.150/24 interface=WAN network=192.168.0.0
add address=192.168.10.1/24 interface=LAN network=192.168.10.0
/ip dhcp-server network
add address=192.168.10.0/24 dns-server=8.8.8.8 gateway=192.168.10.1
/ip firewall nat
add action=masquerade chain=srcnat comment="Masquerade Public Traffic" out-interface=WAN src-address=192.168.10.0/24
/ip route
add distance=1 gateway=192.168.0.1
/lcd interface pages
set 0 interfaces=sfp1,WAN
/system clock
set time-zone-name=America/Chicago
 
darkprocess
Member Candidate
Member Candidate
Posts: 249
Joined: Fri Mar 20, 2015 1:16 pm

Re: dhcp server does not work on an interface

Tue Aug 30, 2016 4:46 pm

Create a bridge. Put lan interface on it. Assign the dhcp server to the bridge interface

Envoyé de mon SM-G925F en utilisant Tapatalk
 
User avatar
pukkita
Trainer
Trainer
Posts: 3051
Joined: Wed Dec 04, 2013 11:09 am
Location: Spain

Re: dhcp server does not work on an interface

Tue Aug 30, 2016 4:50 pm

Everything looks right, try setting ether2 as LAN and master port for ether3-4 and see if makes a difference.

What's the routerboard model? ROS version? Firmware version?
 
mikrotiker2916
just joined
Topic Author
Posts: 10
Joined: Sat Jun 25, 2016 2:55 pm

Re: dhcp server does not work on an interface

Wed Aug 31, 2016 12:12 am

Thanks Pukkita and darkprocess.

Pukkita, This is a RB201Uais without the wireless. Firmware is 6.35.4 stable. You are right, this is a simple config. I will try making ether2 as the LAN and try it out.
Darkprocess, I did not want to create a bridge because I wanted to use the switch chip instead of the cpu doing the work. I read somewhere that setting it up on the physical interface gave me wirespeed.

A little confused on what could be going wrong here.

Thanks
tiker
 
User avatar
BartoszP
Forum Guru
Forum Guru
Posts: 2880
Joined: Mon Jun 16, 2014 1:13 pm
Location: Poland

Re: dhcp server does not work on an interface

Wed Aug 31, 2016 7:19 am

Start from resseting router to empty configuration and then apply your one.

Who is online

Users browsing this forum: MauriceW and 48 guests