Community discussions

MikroTik App
 
alberto464
just joined
Topic Author
Posts: 13
Joined: Tue Jun 14, 2022 10:19 pm

Invalid DHCP server

Tue Jun 14, 2022 10:30 pm

Hi, I'm trying to set up a DHCP server with IP 192.168.88.XX but when I create it via the setup wizard it tells me it's invalid. Where am I doing wrong?

I need the DHCP server to connect those devices without static IP, which often change in the network.

# jun/14/2022 21:23:57 by RouterOS 7.3
/interface lte
set [ find ] allow-roaming=no band="" name=lte1
/interface ethernet
set [ find default-name=ether1 ] arp=proxy-arp
/interface wireless
set [ find default-name=wlan1 ] ssid=MikroTik
/interface lte apn
set [ find default=yes ] apn=APN authentication=pap ip-type=ipv4 name=LTE use-network-apn=no user=USERNAME
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/ip address
add address=192.168.88.1/24 interface=ether1 network=192.168.88.0
add address=82.134.200.140/24 interface=ether1 network=82.134.200.0
/ip dns
set servers=8.8.8.8
/ip firewall nat
add action=masquerade chain=srcnat comment="" \
    out-interface=lte1 src-address=192.168.88.0/24
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 12001
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Invalid DHCP server

Tue Jun 14, 2022 10:36 pm

You do not specify what model is it, and you have deleted default config.
Simply reset to default the device and all act as intended/wanted.
 
alberto464
just joined
Topic Author
Posts: 13
Joined: Tue Jun 14, 2022 10:19 pm

Re: Invalid DHCP server

Tue Jun 14, 2022 10:40 pm

You do not specify what model is it, and you have deleted default config.
Simply reset to default the device and all act as intended/wanted.
The model is: RBwAPR-2nD

Yes I have deleted the default configuration because I like to experiment and learn, for that now I am trying to implement DHCP by hand, I would like to understand where I am wrong
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 12001
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Invalid DHCP server

Tue Jun 14, 2022 10:42 pm

The first error that is made, is delete the default config = delete all firewall rules.

At least, export the config like you do with /export and see how is configured the device,
and save for reference....

You can learn more from export than ask only some question on forum...


And about quick setup: if you read the forum, do not work, and if for some reason work, do not use again that a second time...
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 12001
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Invalid DHCP server

Tue Jun 14, 2022 10:49 pm

/ip pool
add name=dhcp-pool ranges=192.168.88.101-192.168.88.199

/ip dhcp-server
add address-pool=dhcp-pool disabled=no lease-time=1w name=dhcp interface=ether1

/ip dhcp-server network
add address=192.168.88.0/24 dns-server=1.1.1.1,8.8.8.8 gateway=192.168.88.1 netmask=24 ntp-server=193.204.114.232,193.204.114.233
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 12001
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Invalid DHCP server

Tue Jun 14, 2022 10:51 pm

Poi ci sono altri errori di configurazione, ma questa è un'altra storia...

Se non l'hai già fatto:
/interface lte firmware-upgrade lte1 upgrade=yes

e poi:
/sys clock set time-zone-autodetect=no time-zone-name=Europe/Rome
/sys ntp client set enabled=yes primary-ntp=193.204.114.232 secondary-ntp=193.204.114.233
 
alberto464
just joined
Topic Author
Posts: 13
Joined: Tue Jun 14, 2022 10:19 pm

Re: Invalid DHCP server

Wed Jun 15, 2022 2:16 pm

Poi ci sono altri errori di configurazione, ma questa è un'altra storia...

Se non l'hai già fatto:
/interface lte firmware-upgrade lte1 upgrade=yes

e poi:
/sys clock set time-zone-autodetect=no time-zone-name=Europe/Rome
/sys ntp client set enabled=yes primary-ntp=193.204.114.232 secondary-ntp=193.204.114.233

Thank you! This is a great tip that is much appreciated.

/ip pool
add name=dhcp-pool ranges=192.168.88.101-192.168.88.199

/ip dhcp-server
add address-pool=dhcp-pool disabled=no lease-time=1w name=dhcp interface=ether1

/ip dhcp-server network
add address=192.168.88.0/24 dns-server=1.1.1.1,8.8.8.8 gateway=192.168.88.1 netmask=24 ntp-server=193.204.114.232,193.204.114.233

Thank you! These commands helped me understand what are the best configurations to create a DHCP server. I also understood that I was not making a mistake, but simply the writing "Invalid" appeared in the DHCP server because I did not have a PC connected to the Ethernet port.
In fact, even with your commands the writing invalid appears if I disconnect it, why?

After configuring the DHCP server, some clients when I connect them I see that they don't get the LAN IP. If I go to the "Leases" section I see it in the "Offered" state. The client is in DHCP and even if I restart it it does not take the LAN IP.
With the default configuration of the Mikrotik it works. I tried to do a comparison with exporting the default configuration, but I can't find the error.

Ps. I saw that you speak Italian like me, if a language other than English is allowed in the forum we can easily continue in Italian.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 12001
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Invalid DHCP server

Wed Jun 15, 2022 2:21 pm

Ok, repost actual config with /export and do not omit anything (remove only serial number)
censore (not delete) public IPs, e-mails, usernames and passwords.

(IT: Fammi dara un'occhiata a come è configurato ora)
 
alberto464
just joined
Topic Author
Posts: 13
Joined: Tue Jun 14, 2022 10:19 pm

Re: Invalid DHCP server

Wed Jun 15, 2022 2:40 pm

Ok, repost actual config with /export and do not omit anything (remove only serial number)
censore (not delete) public IPs, e-mails, usernames and passwords.

(IT: Fammi dara un'occhiata a come è configurato ora)

Sure!

# jun/15/2022 13:37:03 by RouterOS 7.3
# software id = 3PWC-R7A2
#
# model = RBwAPR-2nD
/interface lte
set [ find ] allow-roaming=no band="" name=lte1
/interface ethernet
set [ find default-name=ether1 ] arp=proxy-arp
/interface wireless
set [ find default-name=wlan1 ] ssid=MikroTik
/interface lte apn
set [ find default=yes ] apn=DELETE authentication=pap ip-type=ipv4 name=APN use-network-apn=no user=DELETE
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/ip pool
add name=dhcp-pool ranges=192.168.88.101-192.168.88.199
/ip dhcp-server
add address-pool=dhcp-pool interface=ether1 name=dhcp
/ip address
add address=192.168.88.1/24 interface=ether1 network=192.168.88.0
add address=82.134.XXX.XXX/24 interface=ether1 network=82.134.XXX.0
/ip dhcp-server network
add address=192.168.88.0/24 dns-server=1.1.1.1,8.8.8.8,8.8.4.4 gateway=192.168.88.1 netmask=24 ntp-server=\
    193.204.114.232,193.204.114.233
/ip dns
set servers=8.8.8.8,8.8.4.4
/ip firewall nat
add action=masquerade chain=srcnat comment="Navigazione Rete Lan" out-interface=lte1 src-address=192.168.88.0/24
add action=dst-nat chain=dstnat comment="Router principale" dst-port=44063 protocol=tcp to-addresses=192.168.88.2 to-ports=44063
/ip service
set telnet disabled=yes
set ftp disabled=yes
set www address=93.175.XXX.XXX/32,192.168.88.0/24
set ssh disabled=yes
set api disabled=yes
set winbox address=93.175.XXX.XXX/32,192.168.88.0/24
set api-ssl disabled=yes
/system clock
set time-zone-name=Europe/Rome
/system ntp client
set enabled=yes
/system ntp client servers
add address=193.204.114.232
add address=193.204.114.233

(Grazie mille per l'aiuto)
Last edited by alberto464 on Wed Jun 15, 2022 2:41 pm, edited 1 time in total.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 12001
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Invalid DHCP server

Wed Jun 15, 2022 2:41 pm

What is the LTE modem model inside?
 
alberto464
just joined
Topic Author
Posts: 13
Joined: Tue Jun 14, 2022 10:19 pm

Re: Invalid DHCP server

Wed Jun 15, 2022 2:48 pm

What is the LTE modem model inside?

Not sure if this is what you are looking for. On the back label it says: R11e-LTE.
Product: RBwAPR-2nD & R11e-LTE
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 12001
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Invalid DHCP server

Wed Jun 15, 2022 2:50 pm

ok, is R11e-LTE,
one moment....
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 12001
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Invalid DHCP server

Wed Jun 15, 2022 2:53 pm

Paste this on terminal, { and } included
{
/interface bridge
add name=bri-lan protocol-mode=none

/interface bridge port
add bridge=bri-lan interface=ether1
add bridge=bri-lan interface=wlan1

/interface lte
set [ find ] band=1,3,7,20

/interface ethernet
set [ find default-name=ether1 ] arp=enabled

/ip dhcp-server
set [find] interface=bri-lan

/ip address
set [find] interface=bri-lan

/ip dns
set servers=1.1.1.1,8.8.8.8

/ip dhcp-server network
set [find] dns-server=1.1.1.1,8.8.8.8

/tool sms
set port=lte1 receive-enabled=yes
}
but remember: you are without firewall...

and for optimize wifi
/interface wireless
set [ find default-name=wlan1 ] band=2ghz-g/n distance=indoors installation=indoor \
   max-station-count=62 mode=ap-bridge radio-name="AP MikroTik" scan-list=2412-2472:5 wireless-protocol=802.11 wps-mode=disabled
 
User avatar
mkx
Forum Guru
Forum Guru
Posts: 11582
Joined: Thu Mar 03, 2016 10:23 pm

Re: Invalid DHCP server

Wed Jun 15, 2022 4:25 pm

/ip dhcp-server
add address-pool=dhcp-pool disabled=no lease-time=1w name=dhcp interface=ether1
...
In fact, even with your commands the writing invalid appears if I disconnect it, why?

Because if nothing is connected to ether1, then interface is "not running" and DHCP server on non-running interface is invalid. Mostly used default config has a bridge with multiple RJ45 ports members (wireless as well if device supports that) and DHCP server is then bound to bridge interface which is (AFAIK) never "not running", so DHCP server doesn't become invalid even if none of bridge member ports is running/active/up.
 
alberto464
just joined
Topic Author
Posts: 13
Joined: Tue Jun 14, 2022 10:19 pm

Re: Invalid DHCP server

Wed Jun 15, 2022 10:37 pm


but remember: you are without firewall...

Thank you very much, I did some tests on the Firewall but I can't find the rules that are good for my case, after I will open a new thread to ask for advice explaining my use case well.

Because if nothing is connected to ether1, then interface is "not running" and DHCP server on non-running interface is invalid. Mostly used default config has a bridge with multiple RJ45 ports members (wireless as well if device supports that) and DHCP server is then bound to bridge interface which is (AFAIK) never "not running", so DHCP server doesn't become invalid even if none of bridge member ports is running/active/up.

Thanks for the great explanation. Now it's clear.

Who is online

Users browsing this forum: tangent, yosue111 and 36 guests