Community discussions

MikroTik App
 
schotter
just joined
Topic Author
Posts: 3
Joined: Mon Apr 19, 2021 1:33 pm

Different (sub)nets for each port? [solved]

Mon Apr 19, 2021 2:14 pm

Hi,

I'm wondering whether it's possible to configure a MikroTik product like the hEX PoE lite in such a way, so I can share my internet with someone else without giving them access to my LAN.
Let's say there are three parties and every party has its own switch after the shared router. Also everyone's LAN is connected through one cable at a specific port.
  • My stuff: 192.168.1.0/24
  • Friendly Neighbour: 192.168.2.0/24
  • Strange Neighbour: 192.169.172.0/24
Can this be done?
Is it possible with the mentioned product or do I have to reach for something better?

Greetings,
schotter
Last edited by schotter on Thu Apr 22, 2021 10:53 am, edited 1 time in total.
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 19322
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: Different (sub)nets for each port?

Tue Apr 20, 2021 3:33 pm

Yes use vlans.
Route three vlans through the single port (assuming your stuff is also on that port?)

However that does not seem like the whole story and to config the router for that we need the whole story
A network diagram will help.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 12001
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Different (sub)nets for each port?

Wed Apr 21, 2021 8:02 pm

without complicate anything, simply add rules on bridge filter:
ether1 can't communicate with ether2,
ether1 can't communicate with ether3,
ether2 can't communicate with ether1,
ether2 can't communicate with ether3,
ether3 can't communicate with ether1,
ether3 can't communicate with ether2,
is more simple than use 3 pool, 3 DHCP server, 3 NAT, etc...

assuming the bridge is called "bri-lan" and the 3 ports are called ether1, eher2 and ether3:
/interface bridge filter
add action=drop chain=forward in-bridge=bri-lan in-interface=ether1 out-bridge=bri-lan out-interface=ether2
add action=drop chain=forward in-bridge=bri-lan in-interface=ether1 out-bridge=bri-lan out-interface=ether3
add action=drop chain=forward in-bridge=bri-lan in-interface=ether2 out-bridge=bri-lan out-interface=ether1
add action=drop chain=forward in-bridge=bri-lan in-interface=ether2 out-bridge=bri-lan out-interface=ether3
add action=drop chain=forward in-bridge=bri-lan in-interface=ether3 out-bridge=bri-lan out-interface=ether1
add action=drop chain=forward in-bridge=bri-lan in-interface=ether3 out-bridge=bri-lan out-interface=ether2

if you do this not like "in this way",
Any 192.169.172.0/24 can maliciously reach 192.168.1.0/24 and 192.168.2.0/24
because all net are on same router...
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 19322
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: Different (sub)nets for each port?

Wed Apr 21, 2021 9:09 pm

The description is not clear.
A. If the toplogy is such that EACH neighbour (and you) has their own port on the router heading towards their own switch
B. If the topology is such that one ethernet cable due to available location wiring will carry two or the three of the networks.

Case A
Easiest and best option is simply define the three separate subnets and their interface is the associated etherport being used.
As far as separation, that is easily taken care of in firewall forward filter rules. In the forward chain simply put in a last rule that drops all traffic.
In this case you will want to put an allow LAN to WAN rule for internet access prior to this last rule.

Case B
If you have to put 2 or more subnet through a wire, then thats when vlans make sense.. However this is predicated upon there being a smart device at the other end to be able to read vlan tags and then send/disperse the traffic where it needs to go. Since A is more likely wont go into more detail.
 
schotter
just joined
Topic Author
Posts: 3
Joined: Mon Apr 19, 2021 1:33 pm

Re: Different (sub)nets for each port?

Thu Apr 22, 2021 10:52 am

Thanks for your replies. It's case A. Every neighbour will have their own cable, maybe a second one for redundancy, but those will be fixed to certain ports.

Who is online

Users browsing this forum: GoogleOther [Bot], spookymulder84 and 71 guests