首页 > 学院 > 网络通信 > 正文

路由器安全设置 详解

2019-11-05 00:26:00
字体:
来源:转载
供稿:网友

  hostname Perimeter-Router           ! 路由器名称
enable secret ena-secret            ! 特权访问口令为 ena-secret

interface serial 0                   ! 定义接口
description To The Internet        ! 目的描述
ip address 161.71.73.33 255.255.255.248     ! 设置IP地址
ip access-list 101 in                           ! 定义入站过滤器
ip access-list 102 out                          ! 定义出站过滤器
access-list 101 permit tcp any any established Note 1     ! 答应所有tcp业务流入,会话始于园区网内


access-list 101 permit tcp any host 144.254.1.3 eq FTP     ! 答应 ftp 到不洁网
                                                            !(dirty net )中的ftp服务器
access-lsit 101 permit tcp any host 144.254.1.3 eq ! 答应 ftp 数据到不洁网中的ftp服务器
ftp-date                                                      
                                                             
access-list 101 deny ip 127.0.0.0 0.255.255.255 any ! 阻止来自Internet并以RFC
access-list 101 deny ip 10.0.0.0 0.255.255.255 any   !保留地址为源的数据包入站
access-list 101 deny ip 172.16.0.0 0.240.255.255 any
access-list 101 deny ip 192.168.0.0 0.0.255.255 any
access-list 101 deny icmp any any echo-reply         ! 拒绝任何应答
access-list 101 deny icmp any any host-unreachable ! 拒绝任何无法接通的主机
access-list 101 deny udp any any eq snmp             ! 拒绝引入的SNMP
access-list 101 deny udp any eq 2000                  ! 拒绝引入的openwindows
access-list 101 deny udp any any gt 6000             ! 拒绝引入的X-windows
access-list 101 deny tcp any any eq 2000                 ! 拒绝引入的openwindows
access-list 101 deny tcp any any gt 6000                ! 拒绝引入的X-windows
access-list 101 deny udp any any eq 69                   ! 拒绝引入的tftpd
access-list 101 deny udp any any eq 111                  ! 拒绝引入的SunRPC
access-list 101 deny udp any any eq 2049                 ! 拒绝引入的NFS
access-list 101 deny tcp any any eq 111                  ! 拒绝引入的SunRPC
access-list 101 deny tcp any any eq 2049                 ! 拒绝引入的 NFS
access-list 101 deny tcp any any eq 87                   ! 拒绝引入的连接
access-list 101 deny tcp any any eq 512      ! 拒绝引入的 BSD UNIX “r”指令
access-list 101 deny tcp any any eq 513      ! 拒绝引入的 BSD UNIX “r”指令
access-list 101 deny tcp any any eq 514      ! 拒绝引入的 BSD UNIX “r”指令
access-list 101 deny tcp any any eq 515      ! 拒绝引入的 lpd
access-list 101 deny tcp any any eq 540      ! 拒绝引入的  uUCpd

access-list 101 permit ip any any             ! 其它均答应

access-list 102 permit ip 144.254.0.0 0.0.255.255 any  ! 只答应有源的包
access-list 102 deny ip any any                 ! 园区网到Internet的地址

aaa new-model                                         ! 在全范围实现AAA
aaa authentication login default tacacs+        !默认登录方法经由 tacacs+
aaa authentication login staff tacacs+ local   !通过tacacs+鉴别工作人员用户名...
                                          ! 假如无法连接服务器,退而求其次的方法是本地鉴别
aaa authorization exec tacacs+ local           ! 鉴别通过后,授权运行 exec shell
aaa authorization commands 0 tacacs+ none     ! 鉴别与指定特权等级相关的运行模式指令
aaa authorization commands 1 tacacs+ none     ! 假如无可用的tacacs+ 服务器,
aaa authorization commands 15 tacacs+ local   ! 15级权限指令就需要本地鉴别,其它
                                                      ! 不需要任何鉴别
aaa accounting update newinfo                    ! 每当有新的记帐信息需要报告时,中间记帐
                                                      ! 记录将被送到服务器
aaa accounting exec start-stop tacacs+         ! 对终端会话进行记帐
aaa accounting network start-stop tacacs+     ! 对所有 PPP, SLIP和ARAP连接记帐
username staff passWord 7 staffpassword       ! 创建本地口令并以加密格式存储
tacacs-server host 144.254.5.9                  ! 定义tacacs+ 服务器地址
tacacs-server key thisisasecret                 ! 定义共享的 tacacs+ 密码

line con 0
exec-timeout 5 30                        ! 确认控制台会话结束时间
login authentication staff             ! 只有用户名工作人员可接入控制台
line aux 0
transport input none                     ! 没有telnet进入
no exec                                    ! 该端口没有得到运行提示
line vty 0 3
exec-timeout 5 30                        ! 确认 telnet 会话结束时间
login authentication default           ! 通过 tacacs+ 登录鉴别
PRivilege level 15                       ! 获得15级权限
line vty 4
exec-timeout 5 30                        ! 确认 telnet 会话结束时间
login authentication staff             ! 鉴别为工作人员
rotary 1
privilege level 1
logging on                                 ! 开启syslog
logging 144.254.5.5                      ! 定义syslog服务器地址
logging console information             ! 定义登录的信息


发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表