Community discussions

MikroTik App
 
Zombayo
just joined
Topic Author
Posts: 1
Joined: Wed Dec 20, 2023 3:03 pm

Problem sharing directories from two IP addresses with two mikrotik routers on the same network

Wed Dec 20, 2023 3:55 pm

In one network I have two Mikrotik routers with two IP addresses:

MikroTik1: WAN -> 194.141.118.46 -> DHCP on PC1 -> 192.168.0.2
MikroTik2: WAN -> 194.141.118.47 -> DHCP on PC2 -> 192.168.0.2

When PC1 shares a directory, it cannot be mapped to PC2 like: \\194.141.118.46\Map

When PC2 shares a directory, it cannot be mapped to PC1 like: \\194.141.118.47\Map

Settings in MikroTik1 is:

# dec/20/2023 15:46:46 by RouterOS 6.47.10
# software id = CGUK-AFJL
#
# model = RB952Ui-5ac2nD
# serial number = CC460EF3AC25
/interface bridge
add admin-mac=2C:C8:1B:EF:8B:35 auto-mac=no comment=defconf name=bridge
/interface wireless
set [ find default-name=wlan1 ] band=2ghz-b/g/n channel-width=20/40mhz-XX disabled=no distance=indoors frequency=auto installation=indoor mode=ap-bridge ssid=MikroTik-EF8B3A wireless-protocol=802.11
set [ find default-name=wlan2 ] band=5ghz-a/n/ac channel-width=20/40/80mhz-XXXX disabled=no distance=indoors frequency=auto installation=indoor mode=ap-bridge ssid=MikroTik-EF8B39 wireless-protocol=802.11
/interface list
add comment=defconf name=WAN
add comment=defconf name=LAN
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/ip hotspot profile
set [ find default=yes ] html-directory=flash/hotspot
/ip pool
add name=dhcp ranges=192.168.0.2-192.168.0.10
/ip dhcp-server
add address-pool=dhcp disabled=no interface=bridge name=defconf
/interface bridge port
add bridge=bridge comment=defconf interface=ether2
add bridge=bridge comment=defconf interface=ether3
add bridge=bridge comment=defconf interface=ether4
add bridge=bridge comment=defconf interface=ether5
add bridge=bridge comment=defconf interface=wlan1
add bridge=bridge comment=defconf interface=wlan2
/ip neighbor discovery-settings
set discover-interface-list=LAN
/interface list member
add comment=defconf interface=bridge list=LAN
add comment=defconf interface=ether1 list=WAN
/ip address
add address=192.168.0.1/24 comment=defconf interface=ether2 network=192.168.0.0
add address=194.141.118.46/27 interface=ether1 network=194.141.118.32
/ip dhcp-client
add comment=defconf interface=ether1
/ip dhcp-server lease
add address=192.168.0.2 mac-address=B4:B5:2F:D5:49:8F server=defconf
add address=192.168.0.11 mac-address=1C:61:B4:E4:01:EC server=defconf
/ip dhcp-server network
add address=192.168.0.0/24 comment=defconf gateway=192.168.0.1 netmask=24
/ip dns
set allow-remote-requests=yes servers=8.8.8.8
/ip dns static
add address=192.168.0.1 comment=defconf name=router.lan
/ip firewall address-list
add address=194.141.118.43 list=sysadmin
add address=194.141.118.47 list=synpv1
/ip firewall filter
add action=accept chain=input dst-port=445 protocol=tcp
add action=accept chain=input dst-port=3389 protocol=tcp src-address-list=sysadmin
add action=accept chain=input dst-port=3389 protocol=tcp src-address-list=synpv1
add action=accept chain=input comment="defconf: accept ICMP" protocol=icmp
add action=accept chain=forward comment="defconf: accept established,related, untracked" connection-state=established,related,untracked
add action=accept chain=forward comment="defconf: accept in ipsec policy" ipsec-policy=in,ipsec
add action=accept chain=input comment="defconf: accept to local loopback (for CAPsMAN)" dst-address=127.0.0.1
add action=accept chain=forward comment="defconf: accept out ipsec policy" ipsec-policy=out,ipsec
add action=drop chain=input comment="defconf: drop invalid" connection-state=invalid log=yes
add action=drop chain=input comment="defconf: drop all not coming from LAN" in-interface-list=!LAN log=yes
add action=fasttrack-connection chain=forward comment="defconf: fasttrack" connection-state=established,related
add action=drop chain=forward comment="defconf: drop invalid" connection-state=invalid
add action=drop chain=forward comment="defconf: drop all from WAN not DSTNATed" connection-nat-state=!dstnat connection-state=new in-interface-list=WAN
/ip firewall nat
add action=masquerade chain=srcnat comment="defconf: masquerade" ipsec-policy=out,none out-interface-list=WAN
add action=dst-nat chain=dstnat dst-address=194.141.118.46 dst-port=3389 protocol=tcp to-addresses=192.168.0.1
add action=dst-nat chain=dstnat dst-address=194.141.118.46 dst-port=3390 protocol=tcp to-addresses=192.168.0.11 to-ports=3390
add action=dst-nat chain=dstnat dst-address-type=local dst-port=445 protocol=tcp to-addresses=192.168.0.2 to-ports=445
/ip route
add distance=1 gateway=194.141.118.60
/ip service
set winbox port=3389
/ip smb
set domain=NIMH_PD
/ip smb users
set [ find default=yes ] name=user
/system clock
set time-zone-name=Europe/Sofia
/tool mac-server
set allowed-interface-list=LAN
/tool mac-server mac-winbox
set allowed-interface-list=LAN

Settings in MikroTik2 is:

# dec/20/2023 15:46:21 by RouterOS 6.47.10
# software id = B47I-3CH8
#
# model = RB952Ui-5ac2nD
# serial number = CC460E9CB025
/interface bridge
add admin-mac=2C:C8:1B:F0:96:A2 auto-mac=no comment=defconf name=bridge
/interface wireless
set [ find default-name=wlan1 ] band=2ghz-b/g/n channel-width=20/40mhz-XX distance=indoors frequency=auto installation=indoor mode=ap-bridge ssid=MikroTik-F096A7 wireless-protocol=802.11
set [ find default-name=wlan2 ] band=5ghz-a/n/ac channel-width=20/40/80mhz-XXXX distance=indoors frequency=auto installation=indoor mode=ap-bridge ssid=MikroTik-F096A6 wireless-protocol=802.11
/interface list
add comment=defconf name=WAN
add comment=defconf name=LAN
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/ip hotspot profile
set [ find default=yes ] html-directory=flash/hotspot
/ip pool
add name=dhcp ranges=192.168.0.2-192.168.0.10
/ip dhcp-server
add address-pool=dhcp disabled=no interface=bridge name=defconf
/interface bridge port
add bridge=bridge comment=defconf interface=ether2
add bridge=bridge comment=defconf interface=ether3
add bridge=bridge comment=defconf interface=ether4
add bridge=bridge comment=defconf interface=ether5
add bridge=bridge comment=defconf interface=wlan1
add bridge=bridge comment=defconf interface=wlan2
/ip neighbor discovery-settings
set discover-interface-list=LAN
/interface list member
add comment=defconf interface=bridge list=LAN
add comment=defconf interface=ether1 list=WAN
/ip address
add address=192.168.0.1/24 comment=defconf interface=ether2 network=192.168.0.0
add address=194.141.118.47/27 interface=ether1 network=194.141.118.32
/ip dhcp-client
add comment=defconf interface=ether1
/ip dhcp-server lease
add address=192.168.0.2 mac-address=E0:D5:5E:01:D5:21 server=defconf
/ip dhcp-server network
add address=192.168.0.0/24 comment=defconf gateway=192.168.0.1 netmask=24
/ip dns
set allow-remote-requests=yes servers=192.168.0.1,8.8.8.8,1.1.1.3
/ip dns static
add address=192.168.0.1 comment=defconf name=router.lan
add address=192.168.0.1 name=share.lan
/ip firewall address-list
add address=194.141.118.43 list=sysadmin
add address=194.141.118.46 list=Syn_2
/ip firewall filter
add action=accept chain=input dst-port=445 protocol=tcp
add action=accept chain=input dst-port=137,138,139,445 protocol=tcp
add action=accept chain=input dst-port=3389 protocol=tcp src-address-list=Syn_2
add action=accept chain=input dst-port=3389 protocol=tcp src-address-list=sysadmin
add action=accept chain=input comment="defconf: accept established,related,untracked" connection-state=established,related,untracked
add action=drop chain=input comment="defconf: drop invalid" connection-state=invalid
add action=accept chain=input comment="defconf: accept ICMP" protocol=icmp
add action=accept chain=input comment="defconf: accept to local loopback (for CAPsMAN)" dst-address=127.0.0.1
add action=drop chain=input comment="defconf: drop all not coming from LAN" in-interface-list=!LAN
add action=accept chain=forward comment="defconf: accept in ipsec policy" ipsec-policy=in,ipsec
add action=accept chain=forward comment="defconf: accept out ipsec policy" ipsec-policy=out,ipsec
add action=fasttrack-connection chain=forward comment="defconf: fasttrack" connection-state=established,related
add action=accept chain=forward comment="defconf: accept established,related, untracked" connection-state=established,related,untracked
add action=drop chain=forward comment="defconf: drop invalid" connection-state=invalid
add action=drop chain=forward comment="defconf: drop all from WAN not DSTNATed" connection-nat-state=!dstnat connection-state=new in-interface-list=WAN
/ip firewall nat
add action=masquerade chain=srcnat comment="defconf: masquerade" ipsec-policy=out,none out-interface-list=WAN
add action=dst-nat chain=dstnat dst-address=194.141.118.47 dst-port=3389 protocol=tcp to-addresses=192.168.0.1
add action=dst-nat chain=dstnat dst-address-type=local dst-port=445 protocol=tcp to-addresses=192.168.0.2 to-ports=445
/ip route
add distance=1 gateway=194.141.118.60
/ip service
set winbox port=3389
/ip smb
set domain=NIMH_PD
/ip smb users
set [ find default=yes ] name=user
/system clock
set time-zone-name=Europe/Sofia
/tool mac-server
set allowed-interface-list=LAN
/tool mac-server mac-winbox
set allowed-interface-list=LAN
 
User avatar
leoservices
Trainer
Trainer
Posts: 169
Joined: Fri Jan 13, 2012 2:20 am
Location: Belo Horizonte - MG - Brazil
Contact:

Re: Problem sharing directories from two IP addresses with two mikrotik routers on the same network

Wed Dec 27, 2023 2:33 pm

The ideal would be a LAN with different networks; LAN1 192.168.0.0/24 LAN2 192.168.1.0/24 a connection between routers to have access using L3 Router.

I have never tested SMB redirection in NAT but I believe that the IP is arriving at the PC as its own IP. Do a masquerade and it should do the trick.
on both routers

Who is online

Users browsing this forum: rmenkveld and 8 guests