Community discussions

MikroTik App
 
maximo401
newbie
Topic Author
Posts: 29
Joined: Fri Apr 29, 2011 4:13 pm

How can I block all ssh connection from the Internet to LAN

Mon Jul 02, 2012 3:34 pm

How can I block all ssh connection from the Internet to pass through the Mikrotik (going to LAN)?

Internet --------------> Mikrotik -----------------> LAN
Eth1 & Eth3 (WAN)
Eth2 (LAN)

I am thinking of creating 2 Firewall rules, 1 for Eth1 and 1 for Eth3

Example:
a. Chain: Input
b. In. Interface: ether1
c. Layer7 Protocol: ssh
d. Action: drop

Please have a look at the attached file if that is correct or guide the best possible solution.
block ssh.docx
Thanks
You do not have the required permissions to view the files attached to this post.
 
Feklar
Forum Guru
Forum Guru
Posts: 1724
Joined: Tue Dec 01, 2009 11:46 pm

Re: How can I block all ssh connection from the Internet to

Mon Jul 02, 2012 5:50 pm

Put the appropriate firewall rule on the forward chain. The input chain is just for traffic headed into the router itself, forward is for traffic that is going through the router to another device.
 
maximo401
newbie
Topic Author
Posts: 29
Joined: Fri Apr 29, 2011 4:13 pm

Re: How can I block all ssh connection from the Internet to

Mon Jul 02, 2012 5:58 pm

Feklar, thank you for your reply.

Lets see if I get this correct now.

General tab on Winbox
a. Chain: forward
b. Protocol: 6 (tcp)
c. Dst. Port: 22
d. In. Interface: ether1

Action tab
e. Action: drop

Then I will make another 1 rule for ether3.

Thanks again
 
Feklar
Forum Guru
Forum Guru
Posts: 1724
Joined: Tue Dec 01, 2009 11:46 pm

Re: How can I block all ssh connection from the Internet to

Mon Jul 02, 2012 8:54 pm

That is the most basic way of doing it, yes. It also needs to be further up in the chain than any accept rule that might fire before those two.

Many people will accept things from known networks and drop everything else, it all depends on how you want to set it up and what fits your needs best.
 
maximo401
newbie
Topic Author
Posts: 29
Joined: Fri Apr 29, 2011 4:13 pm

Re: How can I block all ssh connection from the Internet to

Tue Jul 03, 2012 8:14 am

Thanks again, Feklar.

Much appreciated, the idea helps a lot...

Who is online

Users browsing this forum: GoogleOther [Bot], rspott and 202 guests