Community discussions

MikroTik App
 
OKNET
Member
Member
Topic Author
Posts: 354
Joined: Mon Jun 22, 2015 9:22 am

Manage inter-vlan connections

Thu Mar 09, 2017 12:53 pm

Once switch1-cpu is involved in multiple Vlans for routing purpose, each Vlan can route to WAN by its own gateway

Doing so, also inter-vlan is automatically enabled but this is unwanted.

I've got to insert a filter rule on top of my forward ones :

chain=forward action=drop in-interface=all-vlan out-interface=all-vlan
chain=forward action=accept connection-state=established,related
chain=forward action=drop connection-state=invalid
chain=forward action=drop connection-state=new connection-nat-state=!dstnat in-interface=pppoe-out1
chain=forward action=drop connection-state=new connection-nat-state=!dstnat in-interface=ether24

(first one is the only position that deny inter-vlan traffic)

However, I need some host in a single Vlan to access all hosts in the other Vlans

I've tried many rules in many order but host to inter-vlan packets are always dropped: what's the rights syntax ? where I'm wrong???

Thank you
Last edited by OKNET on Thu Mar 09, 2017 4:54 pm, edited 1 time in total.
 
User avatar
pukkita
Trainer
Trainer
Posts: 3051
Joined: Wed Dec 04, 2013 11:09 am
Location: Spain

Re: Manage inter-vlan connections

Thu Mar 09, 2017 1:20 pm

Try
chain=forward action=accept in-interface=all-vlan out-interface=all-vlan src-address=allo.wed.host.ip
chain=forward action=drop in-interface=all-vlan out-interface=all-vlan
chain=forward action=accept connection-state=established,related
chain=forward action=drop connection-state=invalid
chain=forward action=drop connection-state=new connection-nat-state=!dstnat in-interface=pppoe-out1
chain=forward action=drop connection-state=new connection-nat-state=!dstnat in-interface=ether24
 
OKNET
Member
Member
Topic Author
Posts: 354
Joined: Mon Jun 22, 2015 9:22 am

Re: Manage inter-vlan connections

Thu Mar 09, 2017 4:53 pm

Already tried. It doesn't work.

In this allow rule, packets counter increases while pinging a machine on another vlan but it increases as well on the next rule (the dropping one).
Any idea ?
 
sid5632
Long time Member
Long time Member
Posts: 554
Joined: Fri Feb 17, 2017 6:05 pm

Re: Manage inter-vlan connections

Thu Mar 09, 2017 10:10 pm

Already tried. It doesn't work.

In this allow rule, packets counter increases while pinging a machine on another vlan but it increases as well on the next rule (the dropping one).
Any idea ?
Obviously, communication is a two way business. You are getting packets there but not back. Try adding a corresponding dst-address rule:
chain=forward action=accept in-interface=all-vlan out-interface=all-vlan src-address=allo.wed.host.ip
chain=forward action=accept in-interface=all-vlan out-interface=all-vlan dst-address=allo.wed.host.ip
 
OKNET
Member
Member
Topic Author
Posts: 354
Joined: Mon Jun 22, 2015 9:22 am

Re: Manage inter-vlan connections

Fri Mar 10, 2017 9:02 am

You're right, I must allow packets in both directions
It works , thanks
 
User avatar
pukkita
Trainer
Trainer
Posts: 3051
Joined: Wed Dec 04, 2013 11:09 am
Location: Spain

Re: Manage inter-vlan connections

Fri Mar 10, 2017 12:52 pm

Sorry, I missed rule order:
chain=forward action=accept in-interface=all-vlan out-interface=all-vlan src-address=allo.wed.host.ip 
chain=forward action=accept connection-state=established,related
chain=forward action=drop in-interface=all-vlan out-interface=all-vlan
chain=forward action=drop connection-state=invalid
chain=forward action=drop connection-state=new connection-nat-state=!dstnat in-interface=pppoe-out1
chain=forward action=drop connection-state=new connection-nat-state=!dstnat in-interface=ether24 
even better:
chain=forward action=accept in-interface=all-vlan out-interface=all-vlan src-address=allo.wed.host.ip connection-state=new
chain=forward action=accept connection-state=established,related
chain=forward action=drop in-interface=all-vlan out-interface=all-vlan
chain=forward action=drop connection-state=invalid
chain=forward action=drop connection-state=new connection-nat-state=!dstnat in-interface=pppoe-out1
chain=forward action=drop connection-state=new connection-nat-state=!dstnat in-interface=ether24 
However, I need some host in a single Vlan to access all hosts in the other Vlans
@sid5632:
I understood that single host should be the one able to connect to the others, that is, initiate the connections and not viceversa; with your suggested ruleset other vlan hosts can initiate connections to allo.wed.host.ip with no restrictions.
 
sid5632
Long time Member
Long time Member
Posts: 554
Joined: Fri Feb 17, 2017 6:05 pm

Re: Manage inter-vlan connections

Fri Mar 10, 2017 1:40 pm

I understood that single host should be the one able to connect to the others, that is, initiate the connections and not viceversa; with your suggested ruleset other vlan hosts can initiate connections to allo.wed.host.ip with no restrictions.
Agreed.
 
OKNET
Member
Member
Topic Author
Posts: 354
Joined: Mon Jun 22, 2015 9:22 am

Re: Manage inter-vlan connections

Fri Mar 10, 2017 3:39 pm

Confirm, new order , it works !

Who is online

Users browsing this forum: davidvanrensburg, li77616211, patrikg, sas2k and 112 guests