Community discussions

MikroTik App
 
danilabagroff
newbie
Topic Author
Posts: 36
Joined: Sat Sep 09, 2017 10:48 pm

NAT between two bridges

Mon Aug 09, 2021 4:43 pm

I have setup a WiFi repeater on wlan2 and finally get virtual interface wlan2r - both interfaces in the bridge1. I also have wlan5(5Ghz) and some eth-interfaces are bridged in bridge2. DHCP server and masquerade for bridge1 are also configured.

Eventually I need wifi repeater for wifi devices(and this is working like a charm) and router for lan/eth devices via wlan2r interface, but looks like I am missing something :(
# aug/09/2021 16:39:59 by RouterOS 6.43.4
# software id = NJLR-V2DA
#
# model = RB4011iGS+5HacQ2HnD
# serial number = A282096F16A1
/interface bridge
add comment="Bridge to network wirelessly extended" name=bridge1 \
    protocol-mode=none
add comment="Bridge for local network" fast-forward=no name=bridge2
/interface wireless
set [ find default-name=wlan1 ] disabled=no mode=ap-bridge name=wlan5 ssid=\
    mega254
/interface wireless security-profiles
set [ find default=yes ] authentication-types=wpa2-psk mode=dynamic-keys \
    supplicant-identity=MikroTik wpa2-pre-shared-key=pass1
add authentication-types=wpa2-psk mode=dynamic-keys name=\
    wlan2-TP-Link_6B98-repeater supplicant-identity=MikroTik \
    wpa2-pre-shared-key=pass2
/interface wireless
set [ find default-name=wlan2 ] band=2ghz-b/g/n channel-width=20/40mhz-eC \
    disabled=no frequency=2462 mode=station-pseudobridge security-profile=\
    wlan2-TP-Link_6B98-repeater ssid=TP-Link_6B98
add disabled=no mac-address=BA:69:F4:B2:47:55 master-interface=wlan2 name=\
    wlan2r security-profile=wlan2-TP-Link_6B98-repeater ssid=megaex
/ip pool
add comment="Local DHCP Address Pool" name=dhcp ranges=\
    10.254.0.100-10.254.0.254
/ip dhcp-server
add address-pool=dhcp disabled=no interface=bridge2 lease-script=\
    "Local DHCP server" name=dhcpserver
/interface bridge port
add bridge=bridge1 interface=wlan2r
add bridge=bridge1 interface=wlan2
add bridge=bridge2 interface=wlan5
add bridge=bridge2 interface=ether2
add bridge=bridge2 interface=ether3
add bridge=bridge2 interface=ether4
add bridge=bridge2 interface=ether5
add bridge=bridge2 interface=ether6
add bridge=bridge2 interface=ether7
add bridge=bridge2 interface=ether8
add bridge=bridge2 interface=ether9
add bridge=bridge2 interface=ether10
/interface bridge settings
set use-ip-firewall=yes
/ip address
add address=192.168.88.1/24 comment="default configuration" interface=ether1 \
    network=192.168.88.0
add address=10.254.0.1/24 interface=bridge2 network=10.254.0.0
/ip dhcp-client
add comment="DHCP & DNS from remote network wirelessly extended" \
    dhcp-options=hostname,clientid disabled=no interface=bridge1
/ip dhcp-server network
add address=10.254.0.0/24 dns-server=10.254.0.1 gateway=10.254.0.1 netmask=24
/ip dns
set allow-remote-requests=yes
/ip dns static
add address=10.254.0.1 name=gw254.mega
add address=10.254.0.1 name=gw254
/ip firewall filter
add action=passthrough chain=forward log-prefix=firewall
add action=accept chain=forward connection-state=\
    established,related,untracked log=yes log-prefix=firewall
/ip firewall nat
add action=masquerade chain=srcnat disabled=yes out-interface=ether1
add action=masquerade chain=srcnat out-interface=bridge1
add action=masquerade chain=srcnat disabled=yes out-interface=bridge2
/system identity
set name=gw254
Last edited by danilabagroff on Mon Aug 09, 2021 5:39 pm, edited 1 time in total.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11967
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: NAT between two bridges

Mon Aug 09, 2021 5:19 pm

If is a repeater, what repeat? Your network or a wireless of another person?
 
danilabagroff
newbie
Topic Author
Posts: 36
Joined: Sat Sep 09, 2017 10:48 pm

Re: NAT between two bridges

Mon Aug 09, 2021 5:48 pm

If is a repeater, what repeat? Your network or a wireless of another person?
wlan2r is configured as a repeater(ssid=megaex) of wireless of another person with ssid=TP-Link_6B98. These wlans(wlan2r + wlan2) are bridged in bridge1

Internet is reachable from TP-Link_6B98 and my question is about NAT and/or routing from bridge2(where my wired devices are) to bridge1.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11967
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: NAT between two bridges

Mon Aug 09, 2021 5:49 pm

ok, now is clear.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11967
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: NAT between two bridges

Mon Aug 09, 2021 6:06 pm

paste this on terminal, whitout omit the { } !!!
{
/interface bridge settings
set use-ip-firewall=no
/interface bridge
remove [find where name=bridge1]
set bridge2 fast-forward=yes name=bridge protocol-mode=none
/interface wireless
set [ find default-name=wlan2 ] band=2ghz-g/n ssid=mega254 security-profile=default
/interface bridge port
remove [find]
add bridge=bridge interface=ether1
add bridge=bridge interface=ether2
add bridge=bridge interface=ether3
add bridge=bridge interface=ether4
add bridge=bridge interface=ether5
add bridge=bridge interface=ether6
add bridge=bridge interface=ether7
add bridge=bridge interface=ether8
add bridge=bridge interface=ether9
add bridge=bridge interface=ether10
add bridge=bridge interface=wlan2
add bridge=bridge interface=wlan5
/ip address
remove [find where address="192.168.88.1/24"]
set [find where address="10.254.0.1/24"] interface=bridge
/ip dhcp-client
set [find] interface=wlan2r
/ip firewall filter
remove [find]
/ip firewall nat
remove [find]
add action=masquerade src-address=10.254.0.1/24 chain=srcnat out-interface=wlan2r
}
 
danilabagroff
newbie
Topic Author
Posts: 36
Joined: Sat Sep 09, 2017 10:48 pm

Re: NAT between two bridges

Tue Aug 10, 2021 12:40 am

paste this on terminal, whitout omit the { } !!!
Thank you very much for the effort! I will take this as a start point. I still need real LAN for wired devices because in your configuration, as far as I understand, everything will be routed via remote tplink network which is LAN but not really local :)
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11967
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: NAT between two bridges

Tue Aug 10, 2021 12:43 am

If work as I'm expected, your wlan2r is WAN, all other is LAN, including wlan2, not used anymore for extend again TP-link.
The router is the RouterBOARD.

Who is online

Users browsing this forum: No registered users and 41 guests