Community discussions

MikroTik App
 
MilosHlavicka
just joined
Topic Author
Posts: 4
Joined: Wed Feb 13, 2013 4:40 pm

2 Mikrotiks on same subnet use just one DHCP for Wifi

Thu May 17, 2018 3:00 pm

Got this configuration.
Main Mikrotik with 192.168.88.1 with DHCP server enabled
second mikrotik which I am using only as switch + wifi AP(WAN port emty). Got DHCP server disabled and configured his IP in networking on 192.168.88.10

my default route is to forward everything to bridge interface.

When I connect through LAN it works and I am getting DHCP lease from Main mikrotik.
But when I connect on WIFI I dont get any IP assigned. Wifi interface is connected to bridge but seems it doesnt see main mikrotiks DHCP and dont give it to clients on WIFI.

Any1 know how to configure this ?
 
dougunder
newbie
Posts: 43
Joined: Tue May 01, 2018 10:53 pm

Re: 2 Mikrotiks on same subnet use just one DHCP for Wifi

Thu May 17, 2018 10:35 pm

Can you post your config?

We've got SXTs in wireless client mode running dhcp server for a hAP AC inside the home in bridge mode (all interfaces bridged} and it works fine.

I don't recall making and special changes to the bridge to make it work. Do an export and I'll see if anything looks amiss.

Here is a script I use, Very tight so it fits in flashfig. DHCP server not enabled at this point as it screws up provisioning.
At that stage they both get dhcp from the prov router

{{
:global model [/system resource get board-name ];
:global e [interface ethernet print count-only where name~"ether"];
:global w [/interface wireless print count-only where name~"wlan"];
:global s [/interface ethernet print count-only where name~"spf"];
:global c [/interface ethernet print count-only where name~"combo"];
:global t;
:global p;
/system script {
add name=swbridge source={:global t; :global p;:if ($p != "e") do={:while ($p >0) do={/interface bridge port add bridge=Switch-Bridge interface=[($t.$p)];:set $p ($p-1)}}} policy=read,write
};
:local bridge do={/system script run swbridge};
/interface {
ethernet{
set [/interface ethernet find default-name~"ether" ] disabled=no;
set [/interface ethernet find (default-name~"combo") or (default-name~"sfp-sfpplus")] l2mtu=9000 mtu=2000 disabled=no
}
};
:if ($model="SXT HG5 ac" or $model="SXTsq 5 ac" ) do={
/interface {
wireless security-profiles {
set [find name="default"] authentication-types=wpa2-psk management-protection=allowed mode=dynamic-keys comment=default wpa2-pre-shared-key=REDACTED;
add authentication-types=wpa2-psk comment=REDACTED management-protection=allowed mode=dynamic-keys name=gcet-res wpa2-pre-shared-key=REDACTED
};
bridge {
add name=NAT-Gateway disabled=no;
port {
add bridge=NAT-Gateway interface=ether1
}
}
};
/ip dhcp-client {
add comment=defconf dhcp-options=hostname,clientid disabled=no interface=wlan1
}
};
:if ($model="hAP ac" or $model="CCR1009-7G-1C-1S+") do={
/interface bridge {
add name=Switch-Bridge auto-mac=yes disabled=no;
:set $t "ether"; :set $p $e; $bridge;
:set $t "wlan"; :set $p $w; $bridge;
:set $t "spf"; :set $p $s; $bridge;
:set $t "combo"; :set $p $c; $bridge;
};
/ip dhcp-client {
add comment=provision dhcp-options=hostname,clientid disabled=no interface=Switch-Bridge
}
};
/system script remove swbridge
}}
 
Redmor
Member Candidate
Member Candidate
Posts: 256
Joined: Wed May 31, 2017 7:40 pm
Location: Italy

Re: 2 Mikrotiks on same subnet use just one DHCP for Wifi

Fri May 18, 2018 12:00 am

Got this configuration.
Main Mikrotik with 192.168.88.1 with DHCP server enabled
second mikrotik which I am using only as switch + wifi AP(WAN port emty). Got DHCP server disabled and configured his IP in networking on 192.168.88.10

my default route is to forward everything to bridge interface.

When I connect through LAN it works and I am getting DHCP lease from Main mikrotik.
But when I connect on WIFI I dont get any IP assigned. Wifi interface is connected to bridge but seems it doesnt see main mikrotiks DHCP and dont give it to clients on WIFI.

Any1 know how to configure this ?
Reset configuration with no default configuration and configure them only with what you need.
"WAN unplugged", why if you can make it a simple Ethernet in a Bridge?
 
MilosHlavicka
just joined
Topic Author
Posts: 4
Joined: Wed Feb 13, 2013 4:40 pm

Re: 2 Mikrotiks on same subnet use just one DHCP for Wifi

Fri May 18, 2018 12:28 am

Got this configuration.
Main Mikrotik with 192.168.88.1 with DHCP server enabled
second mikrotik which I am using only as switch + wifi AP(WAN port emty). Got DHCP server disabled and configured his IP in networking on 192.168.88.10

my default route is to forward everything to bridge interface.

When I connect through LAN it works and I am getting DHCP lease from Main mikrotik.
But when I connect on WIFI I dont get any IP assigned. Wifi interface is connected to bridge but seems it doesnt see main mikrotiks DHCP and dont give it to clients on WIFI.

Any1 know how to configure this ?


Reset configuration with no default configuration and configure them only with what you need.
"WAN unplugged", why if you can make it a simple Ethernet in a Bridge?
Just for illustration, I wont be using any LAN ports anyway just need wifi get to work.
 
dougunder
newbie
Posts: 43
Joined: Tue May 01, 2018 10:53 pm

Re: 2 Mikrotiks on same subnet use just one DHCP for Wifi

Fri May 18, 2018 1:54 am

We create a bridge, add all interfaces to the bridge, and run dhcp client on the bridge.
I doubt a static address would make a difference.

Thats pretty much it.

My script is just a much less wordy way (loop instead of adding individually each interface)

Given you only have the issue on the wifi I'd guess wlan1 and wlan2 aren't properly bridged

Your not wiring in the AP? Thats bad practice dude. Clients connect wireless, back channel should be wired.
Otherwise its a game of telephone.
 
yhfung
Member Candidate
Member Candidate
Posts: 141
Joined: Tue Nov 20, 2012 6:58 pm

Re: 2 Mikrotiks on same subnet use just one DHCP for Wifi

Fri May 18, 2018 7:07 am

MilosHlavicka,

You do not need to do any forwarding action for the traffic.

I hooked up the same system as you wanted as follows:


1. Reset your second router
2. Use the quickset to set up your router IP
3. Uncheck the DHCP server
4. Reboot the router
5. Connect any port other than WAN (ether1)

With the above configuration, I can access the Internet with both wire and wireless via the second router without any problem.

Please check whether the above can help you to resolve your problems.

The unit that I used for above experiment was hAP ac^2.

YH

Who is online

Users browsing this forum: No registered users and 34 guests