no service finger
no service pad
no service udp-small-servers
no service tcp-small-servers
service password-encryption
service tcp-keepalives-in
service tcp-keepalives-out
no ip bootp server
no ip http server
no ip finger
no ip source-route
no ip gratuitous-arps
ip cef
! После 3-х неудачных попыток генерировать syslog messages.
security authentication failure rate 3 log
!
! При 3-х неудачных логинов в течение 20сек блокировать на 60сек
login block-for 60 attempts 3 within 20
!
ip ssh version 2
ip domain name my.domain.ru
crypto key generate rsa
! Таймаут логина и кол-во попыток ввода имя/пароль
ip ssh time-out 30
ip ssh authentication-retries 3
! Настройка времени и его отображения
clock timezone MSK 3 0
service timestamps debug datetime msec localtime show-timezone
service timestamps log datetime msec localtime show-timezone
!
! Включение логирования
logging on
service sequence-numbers
!
!
! Логи на консоль
logging console critical
logging monitor debugging
!
! Настройка логирования в буфер
logging buffered informational
logging buffered 16386
logging rate-limit 100 except 4
!
! Настройка сообщений на сервер syslog
logging 192.168.1.10
logging trap debugging
 no ip redirects
 no ip proxy-arp
 no ip unreachables
 no ip directed-broadcast
 no ip mask-reply
no cdp enable
! Включаем AAA
aaa new-model
!
! Добавляем локального админа
! Он будет использоваться в случае недоступности сервера ACS:
username adm_user privilege 15 secret 12345678
!
! Добавляем сервера ACS, а также ключ для доступа к серверам
tacacs-server directed-request
tacacs server acs01
 address ipv4 192.168.110.46
 key my_key
tacacs server acs02
 address ipv4 192.168.110.47
 key my_key
!
! Добавляем группу серверов ACS
aaa group server tacacs+ tac_acs
 server name acs01
 server name acs02
 ip tacacs source-interface Port-channel1.180
!
! Настраиваем default method list, предназначенный для authentication.
! default method list будет использоваться для аутентификации сессий
! SSH, Telnet, VTY, AUX, Console в случае если в свойствах этой сессии не указан
! другой method list.
! login - означает что method list используется для логина.
! default - то что он дефолтный
! local - первый метод аутентификации через local БД
! enable - второй метод аутентификации с использованием пароля enable (имя пользователя не важно)
aaa authentication login default local enable
!
! Следующий method list является custom authentication method list, и предназначен для
! аутентификации в vty.
! Здесь method tac_acs есть обращение к группе серверов созданным нами ранее
aaa authentication login authen_cons_login group tac_acs local
!
!
! Следующая конструкция предназначена для включения Accounting.
! 1 и 15 означает уровни privelege на которых будет происходить accounting.
! Также отметим, что accounting возможен только при работе с сервером ACS
aaa accounting commands 1 default start-stop group tac_acs
aaa accounting commands 15 default start-stop group tac_acs
!
! Вешаем правила на линии vty
line vty 0 4
 login authentication authen_cons_login
!
line vty 5 15
 login authentication authen_cons_login
!
!В данной реализации мы не используем авторизацию и делаем необходимость ввода пароля enable:
enable secret 12345678
!
aaa authentication fail-message ^C
      Any unauthorized access is monitored
and can result in criminal or civil prosecution
            under applicable law.
^C
!
banner motd ^C
*************** Cisco 891 ***************
^C
!
access-list 23 permit 192.168.0.0 0.0.255.255
!
line vty 0 4
 access-class 23 in
 exec-timeout 60 0
 login authentication authen_cons_login
 transport input all
line vty 5 15
 access-class 23 in
 exec-timeout 60 0
 login authentication authen_cons_login
 transport input all
ip access-list extended outside_acl_in
 remark --- Add anti-spoofing entries. !--- Deny special-use address sources. !--- Refer to RFC 3330 for additional special use addresses.
 deny ip 127.0.0.0 0.255.255.255 any
 deny ip 192.0.2.0 0.0.0.255 any
 deny ip 224.0.0.0 31.255.255.255 any
 deny ip host 255.255.255.255 any
 remark --- The deny statement should not be configured !--- on Dynamic Host Configuration Protocol (DHCP) relays.
 deny ip host 0.0.0.0 any
 remark --- Filter RFC 1918 space.
 deny ip 10.0.0.0 0.255.255.255 any
 deny ip 172.16.0.0 0.15.255.255 any
 deny ip 192.168.0.0 0.0.255.255 any
remark --- The deny toll fraud
deny   udp any any eq 2427 log
deny   tcp any any eq 2428 log
deny   tcp any any range 1718 1720 log
deny   tcp any any eq 1731 log
deny   tcp any any eq 2000 log
deny   tcp any any eq 5060 log
deny   udp any any eq 5060 log
 remark --- Explicitly permit return traffic. !--- Allow specific ICMP types.
 permit icmp any any echo
 permit icmp any any echo-reply
 permit icmp any any unreachable
 permit icmp any any time-exceeded
 deny   icmp any any
 remark --- These are outgoing DNS queries.
 permit udp any eq 53  any gt 1023
 remark --- Permit older DNS queries and replies to primary DNS server.
 permit udp any eq 53  any eq 53
 remark --- Permit legitimate business traffic.
 permit tcp any any established
 permit udp any range 1 1023 any gt 1023
 remark --- Deny all other DNS traffic.
 deny udp any any eq 53
 deny tcp any any eq 53
 remark --- Allow IPSec VPN traffic.
 permit udp any any eq 500
 permit udp any any eq 4500
 permit 50 any any
 permit 51 any any
 permit gre any any
 remark --- These are Internet-sourced connections to !--- publicly accessible servers.
 permit tcp any any eq 22
 remark --- Explicitly deny all other traffic.
 deny ip any any
access-list 5 permit 192.168.1.4
!
snmp-server community 12345 RO 5
snmp-server ifindex persist
ip domain timeout 2
ip domain name my_domain
ip name-server 192.168.10.5
ip name-server 192.168.10.4
ntp source Vlan1
ntp server 192.168.252.2
ip flow-export source Vlan1
ip flow-export version 5
ip flow-export destination 192.168.10.45 9996
ip flow-top-talkers
 top 20
 sort-by bytes
 cache-timeout 10000
Источник:
http://www.cisco.com/c/en/us/support/docs/ip/access-lists/44541-tacl.html
Добавить комментарий