Community discussions

MikroTik App
 
mihailJl
newbie
Topic Author
Posts: 38
Joined: Thu Jun 22, 2017 9:06 am

Access to PC's in separate network with 2 routers

Mon May 21, 2018 10:03 am

20180521_094156.jpg
This is my scenario!
I want to transfer files from PC1 to PC2!
Pinging TEST:
PC1 to: R1,R2,Cloud, 8.8.8.8 is success!
PC2 to: R1,R2,Cloud, 8.8.8.8 is success!
PC1 to: PC2 is unreachable!
What is the practice of putting these computers on the same network in this scenario?
Thanks!
You do not have the required permissions to view the files attached to this post.
 
User avatar
sindy
Forum Guru
Forum Guru
Posts: 11389
Joined: Mon Dec 04, 2017 9:19 pm

Re: Access to PC's in separate network with 2 routers  [SOLVED]

Mon May 21, 2018 10:17 am

What is the practice of putting these computers on the same network in this scenario?
You cannot put them to the same network, but you can add routes to R1 and R2 to the 172.16.x.x network served by the other one, and set an exception from src-nat or masquerade rule if such rule is configured:

R1:
/ip route add dst-address=172.16.1.0/24 gateway=192.168.137.3
/ip firewall nat add chain=srcnat action=accept src-address=172.16.0.0/24 dst-address=172.16.1.0/24 place-before=[find (chain=srcnat && (action=src-nat || action=masquerade))]

R2:
/ip route add dst-address=172.16.0.0/24 gateway=192.168.137.2
/ip firewall nat add chain=srcnat action=accept src-address=172.16.1.0/24 dst-address=172.16.0.0/24 place-before=[find (chain=srcnat && (action=src-nat || action=masquerade))]
 
mihailJl
newbie
Topic Author
Posts: 38
Joined: Thu Jun 22, 2017 9:06 am

Re: Access to PC's in separate network with 2 routers

Mon May 21, 2018 11:59 pm

Thanks Sindy its work perfect!
And only i want to ask about the firewall NAT, why it is needed? I try without it and It works again.
 
User avatar
sindy
Forum Guru
Forum Guru
Posts: 11389
Joined: Mon Dec 04, 2017 9:19 pm

Re: Access to PC's in separate network with 2 routers

Tue May 22, 2018 12:24 am

Thanks Sindy its work perfect!
And only i want to ask about the firewall NAT, why it is needed? I try without it and It works again.
That's because I didn't know whether you have src-nat or masquerade configured on the uplink interfaces of the routers or not. If you do, the requests from the client in 172.16.x.x are src-nat'ed to 192.168.x.x so the server sees them as if coming from the router's address in 192.168.x.x rather than the actual address of the client in 172.16.x.x. It may cause issues to some protocols. The NAT rules I've suggested shadow the src-nat/masquerade ones specifically for packets between the two 172.16.x.x subnets to avoid this.
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 22535
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: Access to PC's in separate network with 2 routers

Tue May 22, 2018 1:06 am

Sweet someone should send you a nice piece of triple chocolate cake (fudge, mousse and dark chocolate)!!