Community discussions

MikroTik App
 
slayercho
just joined
Topic Author
Posts: 9
Joined: Sun Feb 17, 2013 2:38 pm

One direction access

Sun Feb 17, 2013 2:47 pm

Hello
The idea is as follows:

We have a mikrotik x86 machine with 5.2 and configured interfaces
lan1 - internet
lan2 - 192.168.0.1/24
lan2 vlan100 - 192.168.100.1/24

Is it possible to restrict access from vlan100 addresses to 192.168.0.1/24, one direction and i have access to the addresses in vlan100 from 192.168.0.1/24

Block vlan100 not see 192.168.0.1 as:

add action = drop chain = forward disabled = no dst-address = 192.168.0.0/24 src-address = 192.168.100.0/24

In that case, can you tell me what should be the rule 0.0/24 to 100.0/24 sees one direction, because now i cannot access vlan100 from 0.0/24 network
 
SurferTim
Forum Guru
Forum Guru
Posts: 4636
Joined: Mon Jan 07, 2008 10:31 pm
Location: Miramar Beach, Florida

Re: One direction access

Sun Feb 17, 2013 2:56 pm

add "connection-state=new" to that rule.
 
slayercho
just joined
Topic Author
Posts: 9
Joined: Sun Feb 17, 2013 2:38 pm

Re: One direction access

Sun Feb 17, 2013 3:04 pm

still not working
add action=drop chain=forward connection-state=new disabled=no dst-address=192.168.0.0/24 src-address=192.168.100.0/24
With connection state = new access is in two ways from 100.0/24 <--> 0.0/24
Last edited by slayercho on Sun Feb 17, 2013 3:10 pm, edited 1 time in total.
 
SurferTim
Forum Guru
Forum Guru
Posts: 4636
Joined: Mon Jan 07, 2008 10:31 pm
Location: Miramar Beach, Florida

Re: One direction access

Sun Feb 17, 2013 3:10 pm

Post "/ip firewall filter" and "/ip firewall nat".

Which way do you want to drop? That rule will drop any new connections from 192.168.100.0/24 to 192.168.0.0/24. Established connection packets will not be dropped.

If you want to drop new connections to 192.168.0.1, you may need to add a "chain=input" rule also. That would not be a forward rule if that is assigned to a local interface on the router.
 
slayercho
just joined
Topic Author
Posts: 9
Joined: Sun Feb 17, 2013 2:38 pm

Re: One direction access

Sun Feb 17, 2013 3:22 pm

Filter Rules
add action=drop chain=forward disabled=no dst-address=192.168.0.0/24 src-address=192.168.100.0/24
add action=drop chain=input disabled=no dst-address=192.168.0.0/24 src-address=192.168.100.0/24
With this filter rules 100.0/24 has no access to 0.0/24, and 0.0/24 no access to 100.0/24. testing with ping command
The idea is access from 0.0/24. Without access from 100.0/24 to this network.

NAT Rules
add action=masquerade chain=srcnat disabled=no out-interface=Internet src-address=192.168.0.0/24
add action=masquerade chain=srcnat disabled=no out-interface=Internet src-address=192.168.100.0/24

NOTE:
192.168.0.0/24 and 192.168.100.0/24 is on one inteface 100.0 is vlan ot that interface. That is because i have only two lan card on my x86 machine. Is that the problem?
 
SurferTim
Forum Guru
Forum Guru
Posts: 4636
Joined: Mon Jan 07, 2008 10:31 pm
Location: Miramar Beach, Florida

Re: One direction access

Sun Feb 17, 2013 3:27 pm

Filter Rules
add action=drop chain=forward disabled=no dst-address=192.168.0.0/24 src-address=192.168.100.0/24
add action=drop chain=input disabled=no dst-address=192.168.0.0/24 src-address=192.168.100.0/24
With this filter rules 100.0/24 has no access to 0.0/24, and 0.0/24 no access to 100.0/24. testing with ping command
The idea is access from 0.0/24. Without access from 100.0/24 to this network.
With those rules, you shouldn't be able to connect either way. It will block the connection request and the response. You only want to block the request. These should work.
add action=drop chain=forward disabled=no dst-address=192.168.0.0/24 src-address=192.168.100.0/24 connection-state=new
add action=drop chain=input disabled=no dst-address=192.168.0.0/24 src-address=192.168.100.0/24 connection-state=new
Add: These rules will not break an already established connection. If the two devices are connected when you change the rules, that would be a "connection-state=established", and would not be blocked as long as the connection is maintained.
Last edited by SurferTim on Sun Feb 17, 2013 3:33 pm, edited 1 time in total.
 
slayercho
just joined
Topic Author
Posts: 9
Joined: Sun Feb 17, 2013 2:38 pm

Re: One direction access

Sun Feb 17, 2013 3:32 pm

should but doesn't
add action=drop chain=forward disabled=no dst-address=192.168.0.0/24 src-address=192.168.100.0/24 connection-state=new
add action=drop chain=input disabled=no dst-address=192.168.0.0/24 src-address=192.168.100.0/24 connection-state=new
With this rules access is in two ways 100.0/24 access 0.0/24
 
SurferTim
Forum Guru
Forum Guru
Posts: 4636
Joined: Mon Jan 07, 2008 10:31 pm
Location: Miramar Beach, Florida

Re: One direction access

Sun Feb 17, 2013 3:34 pm

Maybe the vlan does add a problem to that. I have not tried that with a vlan.
 
slayercho
just joined
Topic Author
Posts: 9
Joined: Sun Feb 17, 2013 2:38 pm

Re: One direction access

Sun Feb 17, 2013 3:37 pm

If adding a new LAN card that will work with this setup?
 
SurferTim
Forum Guru
Forum Guru
Posts: 4636
Joined: Mon Jan 07, 2008 10:31 pm
Location: Miramar Beach, Florida

Re: One direction access

Sun Feb 17, 2013 3:43 pm

I'm surprised it doesn't work on the vlan, so I don't know what to tell you on that. I use this type rule, and it has always blocked connections in one direction only.

Bear in mind it will not block established connections. I edited my post above to mention that. If the two devices are connected prior to adding that rule, those connections will not be blocked. They would be "connection-state=established". It only blocks new connection attempts in one direction.
 
slayercho
just joined
Topic Author
Posts: 9
Joined: Sun Feb 17, 2013 2:38 pm

Re: One direction access

Sun Feb 17, 2013 4:32 pm

Thanks for your support, i will try other ways to do that.