Community discussions

MikroTik App
 
b2k
just joined
Topic Author
Posts: 24
Joined: Tue Nov 24, 2009 7:09 am

firewall filter

Tue Nov 24, 2009 7:19 am

please help.. i am newbie here..
hehehe

how to make rules like:

Client A. 192.168.1.2 can not ping to client B. 192.168.2.2 but
client B. 192.168.2.2 can ping to client A. 192.168.1.2


please help.. guys..


:)
 
User avatar
normis
MikroTik Support
MikroTik Support
Posts: 26914
Joined: Fri May 28, 2004 11:04 am
Location: Riga, Latvia
Contact:

Re: firewall filter

Tue Nov 24, 2009 9:16 am

how are these clients connected to the router? are they wireless users, or lan users connected through a switch?
 
b2k
just joined
Topic Author
Posts: 24
Joined: Tue Nov 24, 2009 7:09 am

Re: firewall filter

Tue Nov 24, 2009 11:15 am

how are these clients connected to the router? are they wireless users, or lan users connected through a switch?
lan users connected throungh a switch

i have 2 lan card in my router, A. 192.168.1.1 and B. 192.168.2.1
 
User avatar
normis
MikroTik Support
MikroTik Support
Posts: 26914
Joined: Fri May 28, 2004 11:04 am
Location: Riga, Latvia
Contact:

Re: firewall filter

Tue Nov 24, 2009 11:29 am

in that case, their connections are not going through the router at all, you can't control them.
 
b2k
just joined
Topic Author
Posts: 24
Joined: Tue Nov 24, 2009 7:09 am

Re: firewall filter

Tue Nov 24, 2009 11:42 am

in that case, their connections are not going through the router at all, you can't control them.
if the connections are going through on the router.., how i can control them..?
 
User avatar
normis
MikroTik Support
MikroTik Support
Posts: 26914
Joined: Fri May 28, 2004 11:04 am
Location: Riga, Latvia
Contact:

Re: firewall filter

Tue Nov 24, 2009 11:44 am

but they are not :D

if they would be connected directly to the router, instead of a switch, you would make simple filter rules like:
Client A. 192.168.1.2 can not ping to client B. 192.168.2.2 but
client B. 192.168.2.2 can ping to client A. 192.168.1.2
/ip firewall filter add chain=forward src-address=192.168.2.2/32 dst-address=192.168.1.2/32 action=accept
/ip firewall filter add chain=forward src-address=192.168.1.2/32 dst-address=192.168.2.2/32 action=drop
 
sudiptakp
Frequent Visitor
Frequent Visitor
Posts: 77
Joined: Thu Jan 29, 2009 2:43 pm

Re: firewall filter

Tue Nov 24, 2009 11:52 am

Hi,

If your topology is as following then you may try the configuration as below.

Switch1(192.168.1.0/24)------------(RouterOS)------------Switch2(192.168.2.0/24)

/ip firewall filter
add action=drop chain=forward comment="ping block" disabled=yes icmp-options=8:0-255 \
protocol=icmp src-address=192.168.1.0/24

thanks,

Sudipta
 
sudiptakp
Frequent Visitor
Frequent Visitor
Posts: 77
Joined: Thu Jan 29, 2009 2:43 pm

Re: firewall filter

Tue Nov 24, 2009 11:58 am


/ip firewall filter
add action=drop chain=forward comment="ping block" disabled=yes icmp-options=8:0-255 \
protocol=icmp src-address=192.168.1.0/24
Sorry for typo......in the above config put disabled=no

Thanks,

Sudipta
 
b2k
just joined
Topic Author
Posts: 24
Joined: Tue Nov 24, 2009 7:09 am

Re: firewall filter

Tue Nov 24, 2009 12:07 pm

thanks all.. my problem solve..!
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8712
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: firewall filter

Tue Nov 24, 2009 12:43 pm

/ip firewall filter add chain=forward src-address=192.168.2.2/32 dst-address=192.168.1.2/32 action=accept
/ip firewall filter add chain=forward src-address=192.168.1.2/32 dst-address=192.168.2.2/32 action=drop
is it working?!? I would add 'connection-state=new', because if you simply accept one direction and drop opposite direction - ping won't work in both directions, no?..
 
b2k
just joined
Topic Author
Posts: 24
Joined: Tue Nov 24, 2009 7:09 am

Re: firewall filter

Wed Nov 25, 2009 3:45 am

/ip firewall filter add chain=forward src-address=192.168.2.2/32 dst-address=192.168.1.2/32 action=accept
/ip firewall filter add chain=forward src-address=192.168.1.2/32 dst-address=192.168.2.2/32 action=drop
is it working?!? I would add 'connection-state=new', because if you simply accept one direction and drop opposite direction - ping won't work in both directions, no?..

yups it is working, i am use the sudiptakp solution..

thankss...


by the way guys, how i can block connection between Client A. 192.168.1.2 and client B. 192.168.2.2, but client B. can connect to client A.

need your help guys..
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8712
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: firewall filter

Wed Nov 25, 2009 3:57 am

by the way guys, how i can block connection between Client A. 192.168.1.2 and client B. 192.168.2.2, but client B. can connect to client A.
omg!.. http://forum.mikrotik.com/viewtopic.php ... 94#p181694
 
b2k
just joined
Topic Author
Posts: 24
Joined: Tue Nov 24, 2009 7:09 am

Re: firewall filter

Wed Nov 25, 2009 4:37 am

i mean, client A. 192.168.1.2 can not see shared folder in client B. 192.168.2.2 but
client B. 192.168.2.2 can see shared folder in client A 192.168.1.2

if i used this code :

/ip firewall filter add chain=forward src-address=192.168.2.2/32 dst-address=192.168.1.2/32 action=accept
/ip firewall filter add chain=forward src-address=192.168.1.2/32 dst-address=192.168.2.2/32 action=drop

client A and B totally can not connect
 
b2k
just joined
Topic Author
Posts: 24
Joined: Tue Nov 24, 2009 7:09 am

Re: firewall filter

Wed Nov 25, 2009 5:01 am

by the way guys, how i can block connection between Client A. 192.168.1.2 and client B. 192.168.2.2, but client B. can connect to client A.
omg!.. http://forum.mikrotik.com/viewtopic.php ... 94#p181694

thanks bro.. i am release must used "connection-state=new"

thanks bro...

by the way, can mikrotik block mac address ?
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8712
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: firewall filter

Wed Nov 25, 2009 12:37 pm

/ip firewall filter add src-mac-address=

Who is online

Users browsing this forum: grosnico, jvanhambelgium, merkkg and 46 guests