|
Here are some quick recommendations:
- Better logging:
service timestamps debug datetime msec localtime show-timezone
service timestamps log datetime msec localtime show-timezone
service sequence-numbers
- Use aaa for authentication/authorization:
aaa new-model
aaa authentication login default local
aaa authentication login admin local
- Create enable password
enable secret 0 <some strong password>
- Create a suitable user account.
user <some name> secret 0 <a good password>
- Source routes and grat arps are not good, disable them
no ip source-route
no ip gratuitous-arps
- Close half open connections
ip tcp synwait-time 10
- Do not resolve names
no ip domain lookup
- Log logins, give three attempts before blocking logins
login block-for 60 attempts 3 within 30
login on-failure log
login on-success log
- CDP should not be used unless needed. And never on a router connected to untrusted networks.
no cdp run
Also, use "no cdp enable" on each interface, as it is a good practice to disable cdp globally and on each interface.
- SSH configuration. Use version 2 and log it.
ip ssh time-out 60
ip ssh authentication-retries 2
ip ssh version 2
ip ssh logging events
As well, you will need to generate a key, use the following:
cry key gen rsa mod 1024
- Use ssh to access router, and admin aaa group. Get rid of the password on the vty lines.
line vty 0 4
transport input ssh
login authentication admin
- Create an access-list to protect the vty lines
access-list 15 permit 10.0.0.0 0.0.0.255 log
access-list 15 deny any log
- Apply the access-list to your vty lines
line vty 0 4
access-class 12 in
- Kill the aux port, unless you use it.
line aux 0
no exec
transport input none
transport output none
- Stop backscatter from null0
int null0
no ip unreachables
- Log stuff.
logging buffered 32768 debug
- but keep console clear.
logging console critical <-- usually I will disable console logging. But here I left critical messages to console.
- Set up ntp, and disable ntp on all interfaces except on the interface you will receive time updates on.
ntp server 132.246.168.148 <-- sample timeserver ip's
ntp server 132.246.168.164
ntp disable <-- apply to interfaces that do not provide time info
- If you are not using snmp, disable it.
no snmp-server enable
- Don't boot from the network.
no network boot
Do the login related changes first and don't save them. Test them out thoroughly. If you accidentally lock yourself out just cycle the power. Don't write the changes until you are sure they work properly.
Also, in access-list 100 the permitted network is too large, change it to match your actual internal lan. As well, if you really want a well protected network, I would strongly advise filtering outbound traffic. For example, permit only http, https and dns (to a valid dns server) out. Then add further to the permitted list as needed.
You will need an access-list on the external interface (di0) - or, even better, use the IOS firewall if available. Depending on how thoroughly you want to filter inbound packets, your external access-list could just block private addresses, e.g.:
ip access-list ext incoming
10 deny ip 10.0.0.0 0.255.255.255 any
20 deny ip 172.16.0.0 0.15.255.255 any
30 deny ip 192.168.0.0 0.0.255.255 any
40 deny ip 127.0.0.0 0.255.255.255 any
50 deny ip 224.0.0.0 31.255.255.255 any
60 deny ip 225.0.0.0 0.255.255.255 any
70 deny ip 169.254.0.0 0.0.255.255 any
80 deny ip host 0.0.0.0 any
90 permit ip any any
If you have a static ip, deny packets with that ip as a source. You can also log the above deny lines - logging is a good thing!
You can also block ports, e.g. telnet, snmp, etc. that you never want coming into your network. There are plenty of things you can add to the external access-list depending on your preferences.
You can also go all the way and restrict bogon and hijacked ip address blocks, but that takes work and must be maintained, and can be considered overkill for a home user.
I always create a loopback and use it for a variety of purposes, in particular as a source ip for certain functions, e.g. syslog, snmp, ssh, rcmd, etc.
There are other things you can do, e.g. ip accounting, ios firewall, ip verify unicast, syslog/snmp, ip flow, archive, ids, mop, etc.
This will get you started, more can be done later. Depending on your IOS version and feature set not all of the above may be available.
Spice_Weasel
Oh as I was young and easy in the mercy of his means, Time held me green and dying
Though I sang in my chains like the sea.
|
Last edited by Spice_Weasel : 28-Oct-2007 at 01:36 AM.
|
|
|
|