この例は、Ciscoルーターへのアクセスを制限するコンフィグレーションの一部を示しています。簡潔にするため、わ かり易いようにコンフィグレーションを区切っています。これは、アクセスアイテムの安全性を確保するための一例に 過ぎない点に注意してください。
以下は、IOS認証スキーマの例です。
以下は、特定のユーザの特権レベルを設定するIOSコンフィグレーションの例です。
protocols { bgp {
path-selection always-compare-med;/* Path selection attribute */
aaa new-model
aaa authentication login default tacacs+ local /* Default TACACS, if no service then local user for login */
aaa authentication login console none /* No console authentication */
aaa authentication enable default TACACS+ enable /* Default Tacacs, if no service then local user for enable */
enable secret 5 $1$cOwR$49I5ixU1CqiKrjco8948tp
!
privilege exec level 1 show configuration/* Authorization, level 1 user allowed do show conf, etc. */
privilege exec level 1 show
以下は、FTPなどの各種サービスのIOSコンフィグレーションの例です。
以下は、サービスを拒否し、アクセスを阻止するためのIOSアクセスリストコンフィグレーションの例です。
以下は、IOSシステムログコンフィグレーションの例です。
clock timezone CET 1 ip subnet-zero ip rcmd rsh-enable
ip rcmd remote-host root 192.168.1.10 enable root /* RSH incoming accept from specified host */
ip cef
ip tcp window-size 65535
ip tftp source-interface Loopback0/* Source address for TFTP packets originate on router */
ip ftp source-interface Loopback0/* Source address for FTP packets originate on router */
ip ftp username lunkan/* If using FTP service, username, and password below */
ip ftp password 7 018rfnurcp783jmc0u6 ip host tftps 192.168.1.10/* TFTP server */
ip domain-name lunkan.net
ip name-server 192.168.1.10/* DNS server */
!
interface Loopback0
ip address 1.1.1.1 255.255.255.255 no ip directed-broadcast
!
interface ethernet0 description Link to GIX
ip address 194.68.128.1 255.255.255.0 ip broadcast-address 194.68.128.255
ip access-group 100 in/* Filter inbound traffic */
no ip directed-broadcast/* No forward of packet with broadcast destinations */
no ip redirect/* Disable ICMP redirect */
ip route-cache flow/* Access-list on interface, route-cache flow instead CEF for better performance*/
no ip route-cache cef no ip mroute-cache load-interval 30
no cdp enable/* CDP Level 2 information protocol disable, no gain on EBGP segment */
!
!
logging facility local7/* System log facility */
logging source-interface Loopback0/*Source address for system log packets originate on router */
logging 192.168.1.10/* System log server */
logging buffered 32768 debugging/* Logging information locally stored */
logging console alerts /* Local message to consol, level Alerts and above */
Example IOS Access List
以下は、ここで取り上げたコンフィグレーションで使用されているIOSアクセスリストの例です。
以下は、IOS SNMPコンフィグレーションの例です。
以下は、IOS TACACS+コンフィグレーションの例です。
以下は、ローカルディスクスペースが限られている場合のコアダンプの処理例です。コアダンプは、FTPを自動的に起 動し、リストされているFTPサーバアドレス(この場合は、192.168.1.10)へ送信されます。
access-list 1 permit 192.168.254.0 0.0.0.255 log access-list 1 permit 192.168.1.10 0.0.0.0 log access-list 2 permit 192.168.254.0 0.0.0.255 log access-list 3 permit 192.168.1.10 0.0.0.0 log
access-list 100 deny ip 10.0.0.0 0.255.255.255 any log access-list 100 deny ip 127.0.0.0 0.255.255.255 any log access-list 100 deny ip 172.16.0.0 0.15.255.255 any log access-list 100 deny ip 192.168.0.0 0.0.255.255 any log access-list 100 permit ip any any
!
snmp-server community ida RO 2/* Host with access read-only to router, see access-list 2 */
snmp-server community lena RW 3/* Host with access read-write to router, see access-list 3 */
snmp-server trap-source Loopback0/* Source address for SNMP trap
(UDP 162) packets originate on router */
snmp-server contact lunkan@lunkan.net
snmp-server enable traps config/* SNMP trap categories */
snmp-server enable traps entity snmp-server enable traps envmon snmp-server enable traps bgp
snmp-server host 192.168.1.10 lunkan /* Destination address for SNMP traps and community */
!
!
tacacs-server host 192.168.1.10/* Tacacs server */
tacacs-server key 12345678
!
exeption core-file this_router_name/* Coredump sent to FTP server */
exception protocol ftp exception dump 192.168.1.10
以下は、規制されたIOS Telnetログインアクセスの例です。
以下は、IOS NTPコンフィグレーションの例です。