Community discussions

MikroTik App
 
sponton
just joined
Topic Author
Posts: 2
Joined: Sun Sep 15, 2013 10:30 am

Block client internet access, but allow local access.

Sun Sep 15, 2013 10:41 am

Hi! I'm trying to block a device at home from accessing the internet, without blocking it localy.
I've tried theese lines, but somehow it doesnt block all the traffic.

add action=drop chain=forward comment="Block PS3" out-interface=\
ether1-gateway src-address=192.168.88.210


Any ideas?

//Johan
 
jandafields
Forum Guru
Forum Guru
Posts: 1515
Joined: Mon Sep 19, 2005 6:12 pm

Re: Block client internet access, but allow local access.

Mon Sep 23, 2013 5:55 am

Hi! I'm trying to block a device at home from accessing the internet, without blocking it localy.
I've tried theese lines, but somehow it doesnt block all the traffic.

add action=drop chain=forward comment="Block PS3" out-interface=\
ether1-gateway src-address=192.168.88.210


Any ideas?

//Johan
That rule will work 100% if the src-address is correct and the out-interface is correct (not using ppp) and if you do NOT use webproxy... and if there are no allow rules above this one.
 
sponton
just joined
Topic Author
Posts: 2
Joined: Sun Sep 15, 2013 10:30 am

Re: Block client internet access, but allow local access.

Wed Oct 30, 2013 10:25 pm

Sorry. It did work. My bad.
(Thank god I asked tough. I recently reset my router and didn't back it up, and where looking for clues about my old conf.)
 
qbek
just joined
Posts: 20
Joined: Mon Sep 21, 2015 3:34 pm
Location: Poland
Contact:

Re: Block client internet access, but allow local access.

Thu Jan 14, 2016 1:10 pm

Any idea?
 
User avatar
Deantwo
Member
Member
Posts: 331
Joined: Tue Sep 30, 2014 4:07 pm

Re: Block client internet access, but allow local access.

Thu Jan 14, 2016 2:03 pm

Any idea?
About what?
A simple firewall rule solved this issue easily.
 
gotsprings
Forum Guru
Forum Guru
Posts: 2122
Joined: Mon May 14, 2012 9:30 pm

Re: Block client internet access, but allow local access.

Thu Jan 14, 2016 2:29 pm

Ip address of device you wish to block.
Firewall chain forwarding devices IP action = drop.

Anything beyond the switch level would get dumped.
 
User avatar
ZeroByte
Forum Guru
Forum Guru
Posts: 4047
Joined: Wed May 11, 2011 6:08 pm

Re: Block client internet access, but allow local access.

Thu Jan 14, 2016 5:18 pm

Silly things to consider:
Did you make the PS3 into a static lease in the DHCP server? If not, then the PS3 might get a different IP address from time to time. (go into the dhcp server > leases tab, double-click the entry for the PS3, and there is a "make static" button)

Assuming that the IP address is right, then the most likely issue is that there's another rule earlier in your filter's forward chain that allows the traffic.

The order of the rules is important. The Mikrotik starts at the top of the list and goes rule by rule until the first match, at which point the packet will follow the action of that rule and no more rules will be checked.

If you have a rule that says to accept out-interface=ether1-gateway and it comes before your 'block the PS3' rule, then move the block rule just before the accept rule. Don't worry about any fasttrack rule or rule which says to allow "connection-state=established,related" because whenever the PS3 tries to go on the internet, each connection it tries to make will be state=new on the first packet and these rules won't match.
 
neutronlaser
Member
Member
Posts: 445
Joined: Thu Jan 18, 2018 5:18 pm

Re: Block client internet access, but allow local access.

Wed Mar 20, 2019 4:20 pm

Do you need to block input and output too?
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 19379
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: Block client internet access, but allow local access.

Wed Mar 20, 2019 5:28 pm

Well if you want the full proof solution...
a. put IP on its own vlan or bridge or separate ethernet subnet.(disables any connectivity at layer 2)
b. allow vlan/bridge/ethernet subnet to and fro home subnet (use firewall to allow connectivity at Layer 3 but only internally)
c. DONE.

c. assumes drop all else at end of forward chain.
Firewall Filter Forward Rules
standard fastrack
standard accept established related
standard drop invalid
standard ipsec
+++++++++ All the flow you WANT TO ALLOW ++++++++++
drop all else

++++++++++++ examples of flow you wish to allow++++++++++

home LAN to WAN
home LAN to special subnet for problem devices/people ;-)
special subnet to home LAN
allow port forwarding if required (WAN to home lan)

+++++++++++++++++++++++++++++++++++++++++++++++++

The other method keeps layer 2 connectivity between all LAN IPs (keep existing LAN structure no changes required)
Create a firewall address list - 'bannedWAN' ( a source address list) of the IP or multiple IPs that you wish to block from the internet.
The key here as noted is that you are relying upon that IP not changing, so it has to be statically assigned.

In this case above the LAN to WAN rule could be modified or you could make two rules.

One rule option
add action=accept chain=forward in-interface-List=LAN source-address-list=!bannedWAN out-interface-list=WAN

Two rule option (ORDER IS IMPORTANT)
add action=drop chain=forward in-interface-list=LAN source-address-list=bannedWAN out-interface-list=WAN
add action=accept chain=forward in-interface-list=LAN out-interface-list=WAN
 
Antonski
just joined
Posts: 2
Joined: Sun Oct 04, 2020 9:48 pm

Re: Block client internet access, but allow local access.

Sun Oct 04, 2020 9:55 pm

Hello,
This rule (post#6) is working fine for me, even though I've put it last.
However, it is working only for locally connected machines.
How to block an IP, that is connected to another router, which is connected to this mikrotik?
The second router is for wireless access with LAN network 192.168.1.0/24.
I would like to block only one user from this network, address is static.
Thanks a lot in advance!

Edit: added reference post 6
Last edited by Antonski on Sun Oct 18, 2020 9:15 pm, edited 1 time in total.
 
qbek
just joined
Posts: 20
Joined: Mon Sep 21, 2015 3:34 pm
Location: Poland
Contact:

Re: Block client internet access, but allow local access.

Mon Oct 05, 2020 12:54 pm

By MAC address?
 
Antonski
just joined
Posts: 2
Joined: Sun Oct 04, 2020 9:48 pm

Re: Block client internet access, but allow local access.

Sun Oct 18, 2020 9:06 pm

Well, the device to be blocked is connected to another router, in chain with Mikrotik. So the device MAC address is not known to Mikrotik, I believe.

Who is online

Users browsing this forum: abbio90, qwertykolea and 84 guests