Question Locked

Blocking router login access from the Internet

0 helpful
6 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I am seeing failed login attempts to my perimeter cisco routers from the Internet on my TACACS and I want to block such access totally.
I have read up CBAC but i understand it will not inspect traffic whose source or destination address is the router itself. I need tips on how best to secure these routers so as to forestall DOS

Thx

6 replies

by jdclyde

access-list 111 deny tcp any host eq 23
access-list 111 permit ip any any

[i]and, in the WAN interface:[/i]

access-group 111 in

[b]
repeat as necessary for the different protocols you wish to block. If you have the webserver running on the router, make sure to do the same for port 80.[/b]

Side note, failed login attempts have nothing to do with DOS attacks.

by bizintelligence

First of all, please consider following:

What do you use router for?
What ports do you need to be opened?
What public IPs do you need to be allowed?
What services do you need on router to be running?

When you have answer for above questions then
> stop all unwanted services
> Create strong (combination of characters,numbers and special characters) and long password (10 to 20 characters).
> Create access lists for incoming traffic. Please test it in a simulator (cisco packet tracer 5.1 or free GNS 3.0) before applying it on real router.
> Log and analyse your incoming traffic.
> Test your setup periodically for current threats.

Edited:

Also please read following document:
http://whitepapers.techrepublic.com.com/abstract.aspx?docid=974729

Good Luck !

by redsi

Another easy way to protect your logins (assuming a 12.4xxx version IOS):

-- Add an access-class to your vty line

-- The example below allows login via SSH (Secure Shell) to the router from addresses or subnets/wildcards specified in the access-list

EXAMPLE:

!
line vty 0 4
access-class 102 in
authorization exec local_author
login authentication local_authen
transport input ssh
!

-- you can adjust the authorization and login lines to your particular "aaa" setup

-- then add the access-list to match the example "access-class 102 in" as specified in the line vty config section above.

EXAMPLE:

!
access-list 102 remark ---BEGIN ACL 102 VTY---
access-list 102 permit ip 192.168.xxx.0 0.0.0.255 any log
access-list 102 deny ip any any
access-list 102 remark ---END ACL 102 VTY--
!

-- Where "192.168.xxx.0 0.0.0.255" is your local subnet or subnet or ip address authorized to SSH to the router

-- replace the "192.168.xxx.0 0.0.0.255" as necessary for your particular configuration

-- you can also add more "allow ssh login from" addresses by adding them above/before the "deny ip any any" line in the access-list.

EXAMPLE:

!
access-list 102 remark ---BEGIN ACL 102 VTY---
access-list 102 permit ip 192.168.1.0 0.0.0.255 any log
access-list 102 permit ip host 10.10.10.10 any log
access-list 102 deny ip any any
access-list 102 remark ---END ACL 102 VTY--
!

-- you can also change the "any" on the permit lines to a particular ip address of a single interface on your router to further restrict logins. (useful in firewall NAT situations on router with multiple interfaces - you can restrict ssh vty login to the inside interface only)

-- in the following example we will assume that your router has "FastEthernet 0/0" at "192.168.1.1" and "FastEthernet 1/0" at "10.10.10.1" and we want to restrict logins to a single host at ip address "10.10.10.10" on the "FastEthernet 1/0" connected subnet and only to the "FastEthernet 1/0" interface, as opposed to all (any) of the interfaces on the router.

EXAMPLE:

!
access-list 102 remark ---BEGIN ACL 102 VTY---
access-list 102 permit ip host 10.10.10.10 host 10.10.10.1 log
access-list 102 deny ip any any
access-list 102 remark ---END ACL 102 VTY--
!

-- you should also consider including the following lines in your config to further harden the login process and thwart brute-force attacks.

EXAMPLE:

!
login block-for 180 attempts 5 within 60
login on-failure log
login on-success log
!
ip ssh time-out 60
ip ssh authentication-retries 2
!

-- hope that helps you out

by aoladipo

Thanks everyone. I got a lot of help and respite from applying access-lists to my vty lines.
In response to jdclyde's post, I do agree that failed logins do not always mean DOS but a malicious attacker might as well flood a router with millions of telnet session requests using cheaply available tools and deny it of the resources required for legitimate processes.
Thanks all.

This discussion is closed to new replies.