Community discussions

MikroTik App
 
MaaS10
just joined
Topic Author
Posts: 22
Joined: Tue Oct 01, 2019 3:31 pm

How to connect 2 networks

Mon Jul 19, 2021 5:02 pm

Hey,
I have 2 different networks, lets say N1 and N2.

I need to connect them to each other, but PC from N1 must have access on PC from N2 (opposite too).

They should see only each other, not whole networks.

What type of mikrotik do I have to buy?

Diagram in attachments.
You do not have the required permissions to view the files attached to this post.
 
User avatar
mkx
Forum Guru
Forum Guru
Posts: 11433
Joined: Thu Mar 03, 2016 10:23 pm

Re: How to connect 2 networks

Mon Jul 19, 2021 5:43 pm

From functional point of view any mikrotik with at least 2 ethernet ports will do. From performance point of view they are not same after all, you will use it as router/firewall, which does stress device more than simple switching traffic. So it depends on what kind of performance you expect from it.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11982
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: How to connect 2 networks

Mon Jul 19, 2021 6:14 pm

What you try to achieve is really complicated,
is more simple to add 2nd ethernet on both and place one cable directly between the two PC (and MikroTik).
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 19100
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: How to connect 2 networks

Mon Jul 19, 2021 6:53 pm

This is easy peasy via firewall rules.
Typically we have a last rule in our firewall forward chain that is a block all else rule.

Just before this rule we would make one that basically states.

Allow PC1 on network 1 to access PC2 on network 2.

What isnt clear to me though is if you want it as a one way connection or two way.
By that I mean can both initiate a connection (responses are always allowed) .

add action=accept chain=forward in-interface=network1 src-address=IPofPC1 out-interface=network2 dst-address=IPofPC2

Is the general idea.

By the way, I saw Rextended' house pictures, this is what it looked like.
Aka, some of us dont have the luxury of having our houses wired internally within the rooms (vice in the walls) ;-P
rextended.jpeg
You do not have the required permissions to view the files attached to this post.
 
MaaS10
just joined
Topic Author
Posts: 22
Joined: Tue Oct 01, 2019 3:31 pm

Re: How to connect 2 networks

Mon Jul 19, 2021 7:41 pm

Thanks anav,
I need them to communicate two way, so basically all I need to do is add this FW rule?
add action=accept chain=forward in-interface=network1 src-address=IPofPC1 out-interface=network2 dst-address=IPofPC2
 
sindy
Forum Guru
Forum Guru
Posts: 10205
Joined: Mon Dec 04, 2017 9:19 pm

Re: How to connect 2 networks

Mon Jul 19, 2021 9:06 pm

I need them to communicate two way, so basically all I need to do is add this FW rule?
You need to add more rules than this one - maybe check this post first?

With a stateful firewall, "to communicate two way" and "to be able to initiate a new connection from eithe side" are not exactly the same thing.
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 19100
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: How to connect 2 networks

Mon Jul 19, 2021 9:46 pm

Thanks anav,
I need them to communicate two way, so basically all I need to do is add this FW rule?
add action=accept chain=forward in-interface=network1 src-address=IPofPC1 out-interface=network2 dst-address=IPofPC2
add action=accept chain=forward in-inteface=network2 src-address=IPofPC2 out-inteface=network1 dst-address=IPofPC1
Corrected and just to be clear if PC1 initiates a session with PC2, the all the responses to that traffic are automatically accepted (from PC2 to PC1).
Thus if in reality its PC1 always first contacting then only one rule is needed.
 
MaaS10
just joined
Topic Author
Posts: 22
Joined: Tue Oct 01, 2019 3:31 pm

Re: How to connect 2 networks

Tue Jul 20, 2021 8:20 am

Well, actually I need them to be able to initiate a new connection from either side. Sometimes will PC2 initiate sessions, but mostly it will be PC1. So I need both of them to initiate session.

Who is online

Users browsing this forum: Ahrefs [Bot], anav, hatred, hribowwwc, InfraErik, kolopeter and 81 guests