实验十 综合应用
一、实验目的:
- 进一步掌握局域网2安全配置应用
- 进一步掌握日志服务器、NTP服务器的配置应用
- 进一步掌握AAA配置应用
- 进一步掌握设备权限等级管理、远程管理安全配置应用
- 进一步掌握IPsec站点对站点VPN的配置应用
- 进一步掌握ZPF的配置应用
二、实验要求:
- 每个学生必须单独完成实验。
- 必须在文档中记录实验过程。
三、实验内容或步骤:
- 打开“lab12-Application.pkt”文件,完成以下实验要求。
- 开启NTP服务器的NTP服务,并设置相应的安全参数(password为cisco)。
- 开启Syslog服务器的日志服务。
- 对三层交换机Switch-Company和路由器R-Company进行相应配置,使得三层交换机和路由器将日志上传到步骤3开启的日志服务器上,并确保日志记录中包含有时间信息,上传的日志等级为debugging。
- 在AAA服务器AAA-Server、路由器R-Company、三层交换机Switch-Company上进行相应配置,使得:
1)SSH版本为2,配置时用到的域名采用zzz.com
2)SSH的rsa密钥长度为1024
3)通过Radius认证之后才能远程SSH登录路由器R-Company(为保险起见,设置本地账号为备选认证方式)。
4)通过tacacs+认证之后才能远程登录三层交换机Switch-Company(为保险起见,设置本地账号为备选认证方式),tacacs+采用单连接模式。
5)对远程登录start-stop行为进行审计。
6)与radius或tacacs+服务器通信时的密钥统一为zzz
7)为远程登录设置连接超时时间
8)AAA服务器创建的账号统一为“姓名拼音首字母”,密码为序号
9)特权密码为cisco
- 总公司通过DHCP服务器为终端用户提供IP地址,要求对总公司的S-Net1和S-Net2进行相应配置,使得终端设备不受DHCP欺骗攻击,并限制受控接口每秒接收到DHCP Discovery的数量为3.
- 总公司对Admin管理机有安全要求,需要通过802.1x认证之后,才能连接进网络。(用户账号为admin,密码为ZZZ-admin001,交换机和AAA服务器之间的key仍然为zzz)
- 分公司需要隔离ROOM1中的设备的通信数据,要求配置PVLAN Edge。
- 现在需要对总公司、分公司的这两个路由器进行IPsec配置,实现站点对站点VPN,使得分公司的员工能够与总公司的员工进行通信,并用文本框记录:
1)isakmp协商的策略(至少3个策略)。
2)预共享密钥为姓名全拼,
3)IPsec策略,transform-set配置采用esp模式(加密算法用aes,散列算法用sha-hmac)
- 公司管理员对R-Company路由器进行权限等级管理,新分配了5级和8级权限,要求:
1)等级密码分别为admin02、admin03,且是密文保存的
2)5级权限为可执行show running这个exec命令;
3)8级权限为可执行ip route和router rip两个configure命令(要有ip route / router rip的全命令)
- 公司来了1个9实习生(shixi01)和1个新的管理员(admin04),在Switch-Company三层交换机上配置,使得这两个新员工有不同的视图,要求:
1)视图shixi01的命令包括show interface(全命令)、show ip route两个exec命令,密码是shixi;
2)视图admin04的命令包括 show ip route、ping(全命令)两个exec命令以及username(全命令),密码是admin
- 现在需要在连通性的基础上对ZZZ机构的路由器ZPF进行ZPF配置,实现基本安全:
1)WEB服务器放置在DMZ区,外网用户访问该服务器时,只能访问其443端口(https),内网用户可以http或者https访问服务器。
2)现已知外网的ZIME-Server服务器,管理员只允许ZZZ内部用户ping、https访问这台服务器,其他操作不允许。对内网访问外网的其他通信暂时无安全管控需求。
3)不影响总公司、分公司内部的通信。
解答
2、开启NTP服务器的NTP服务,并设置相应的安全参数(password为cisco)
3、开启Syslog服务器的日志服务。
4、对三层交换机Switch-Company和路由器R-Company进行相应配置,使得三层交换机和路由器将日志上传到步骤3开启的日志服务器上,并确保日志记录中包含有时间信息,上传的日志等级为debugging。
R-Company(config)#logging on
R-Company(config)#logging host 192.168.12.130
R-Company(config)#logging trap debugging
R-Company(config)#service timestamps log datetime msec
R-Company(config)#ntp server 192.168.12.140
R-Company(config)#ntp trusted-key 1
R-Company(config)#ntp authentication-key 1 md5 cisco
Switch-Company(config)#logging on
Switch-Company(config)#logging host 192.168.12.130
Switch-Company(config)#logging trap debugging
Switch-Company(config)#service timestamps log datetime msec
Switch-Company(config)#ntp server 192.168.12.140
Switch-Company(config)#ntp trusted-key 1
Switch-Company(config)#ntp authentication-key 1 md5 cisco
验证:
5、在AAA服务器AAA-Server、路由器R-Company、三层交换机Switch-Company上进行相应配置,使得:
1)SSH版本为2,配置时用到的域名采用zzz.com
2)SSH的rsa密钥长度为1024
3)通过Radius认证之后才能远程SSH登录路由器R-Company(为保险起见,设置本地账号为备选认证方式)。
4)通过tacacs+认证之后才能远程登录三层交换机Switch-Company(为保险起见,设置本地账号为备选认证方式),tacacs+采用单连接模式。
5)对远程登录start-stop行为进行审计。
6)与radius或tacacs+服务器通信时的密钥统一为zzz
7)为远程登录设置连接超时时间
8)AAA服务器创建的账号统一为“姓名拼音首字母”,密码为序号
9)特权密码为cisco
R-Company(config)#ip domain-name zzz.com
R-Company(config)#crypto key generate rsa
The name for the keys will be: R-Company.zzz.com
Choose the size of the key modulus in the range of 360 to 2048 for your
General Purpose Keys. Choosing a key modulus greater than 512 may take
a few minutes.
How many bits in the modulus [512]: 1024
R-Company(config)#ip ssh version 2
R-Company(config)#ip ssh time-out 120
R-Company(config)#radius-server host 192.168.12.150 auth-port 1645 key zzz
R-Company(config)#aaa new-model
R-Company(config)#aaa authentication login default group radius local
R-Company(config)# line vty 0 4
R-Company(config-line)#login authentication default
R-Company(config-line)#exit
R-Company(config)#aaa accounting exec default start-stop group radius
R-Company(config)#enable secret cisco
Switch-Company(config)#ip domain-name zzz.com
Switch-Company(config)#crypto key generate rsa
The name for the keys will be: R-Company.zzz.com
Choose the size of the key modulus in the range of 360 to 2048 for your
General Purpose Keys. Choosing a key modulus greater than 512 may take
a few minutes.
How many bits in the modulus [512]: 1024
Switch-Company(config)#ip ssh version 2
Switch-Company(config)#ip ssh time-out 120
Switch-Company(config)#tacacs-server host 192.168.12.150 single-connection key zzz
Switch-Company(config)#aaa new-model
Switch-Company(config)#aaa authentication login default group tacacs+ local
Switch-Company(config)# line vty 0 4
Switch-Company(config)#login authentication default
Switch-Company(config)#exit
Switch-Company(config)#aaa accounting exec default start-stop group tacacs+
Switch-Company(config)#enable secret cisco
验证:
6、总公司通过DHCP服务器为终端用户提供IP地址,要求对总公司的S-Net1和S-Net2进行相应配置,使得终端设备不受DHCP欺骗攻击,并限制受控接口每秒接收到DHCP Discovery的数量为3.
S-Net1(config)#ip dhcp snooping
S-Net1(config)#interface range fastEthernet 0/1-3
S-Net1(config-if-range)#ip dhcp snooping limit rate 3
S-Net2(config)#interface range fastEthernet 0/24
S-Net2(config-if)#ip dhcp snooping trust
S-Net1(config)#ip dhcp snooping
S-Net2(config)#interface range fastEthernet 0/1-3
S-Net2(config-if-range)#ip dhcp snooping limit rate 3
S-Net2(config)#interface range fastEthernet 0/24
S-Net2(config-if)#ip dhcp snooping trust
7、总公司对Admin管理机有安全要求,需要通过802.1x认证之后,才能连接进网络。(用户账号为admin,密码为ZZZ-admin001,交换机和AAA服务器之间的key仍然为zzz)
Switch-B2-F1(config)#dot1x system-auth-control
Switch-B2-F1(config)#interface FastEthernet0/3
Switch-B2-F1(config-if)#dot1x pae authenticator
Switch-B2-F1(config-if)#authentication port-control auto
Switch-B2-F1(config)#radius-server host 192.168.12.150 auth-port 1645 key zzz
Switch-B2-F1(config)#aaa new-model
Switch-B2-F1(config)#aaa authentication dot1x default group radius
验证:
测试连接成功
8、分公司需要隔离ROOM1中的设备的通信数据,要求配置PVLAN Edge。
Switch-Room1(config)#interface range fastEthernet 0/1-2
Switch-Room1(config-if-range)#switchport protected
验证:
9、现在需要对总公司、分公司的这两个路由器进行IPsec配置,实现站点对站点VPN,使得分公司的员工能够与总公司的员工进行通信,并用文本框记录:
1)isakmp协商的策略(至少3个策略)。
2)预共享密钥为姓名全拼,
3)IPsec策略,transform-set配置采用esp模式(加密算法用aes,散列算法用sha-hmac)
SC-Router(config)#crypto isakmp policy 1
SC-Router(config-isakmp)# encryption aes 256
SC-Router(config-isakmp)# authentication pre-share
SC-Router(config-isakmp)# group 5
SC-Router(config)#crypto isakmp key wyx address 60.191.116.66
SC-Router(config)#crypto ipsec transform-set sc-r esp-aes esp-sha-hmac
SC-Router(config)#crypto map sc-r-map 1 ipsec-isakmp
SC-Router(config-crypto-map)# set peer 60.191.116.66
SC-Router(config-crypto-map)# set pfs group5
SC-Router(config-crypto-map)# set transform-set sc-r
SC-Router(config-crypto-map)# match address 101
SC-Router(config)#ip nat inside source list 100 interface FastEthernet0/1 overload
SC-Router(config)#access-list 100 deny ip 172.16.0.0 0.0.255.255 192.168.0.0 0.0.255.255
SC-Router(config)#access-list 100 permit ip any any
SC-Router(config)#access-list 101 permit ip 172.16.0.0 0.0.255.255 192.168.0.0 0.0.255.255
SC-Router(config)#interface FastEthernet0/0
SC-Router(config-if)# ip nat inside
SC-Router(config)#interface FastEthernet0/1
SC-Router(config-if)# ip nat outside
SC-Router(config-if)# crypto map sc-r-map
R-Router(config)#crypto isakmp policy 1
R-Router(config-isakmp)# encryption aes 256
R-Router(config-isakmp)# authentication pre-share
R-Router(config-isakmp)# group 5
R-Router(config)#crypto isakmp key wyx address 159.238.70.46
R-Router(config)#crypto ipsec transform-set sc-r esp-aes esp-sha-hmac
R-Router(config)#crypto map sc-r-map 1 ipsec-isakmp
R-Router(config-crypto-map)# set peer 159.238.70.46
R-Router(config-crypto-map)# set pfs group5
R-Router(config-crypto-map)# set transform-set sc-r
R-Router(config-crypto-map)# match address 101
R-Router(config)#ip nat inside source list 100 interface FastEthernet0/1 overload
R-Router(config)#access-list 100 deny ip 192.168.0.0 0.0.255.255 172.16.0.0 0.0.255.255
R-Router(config)#access-list 100 permit ip any any
R-Router(config)#access-list 101 permit ip 192.168.0.0 0.0.255.255 172.16.0.0 0.0.255.255
R-Router(config)#interface FastEthernet0/1
R-Router(config-if)# ip nat inside
R-Router(config)#interface FastEthernet1/0
R-Router(config-if)# ip nat outside
R-Router(config-if)# crypto map sc-r-map
验证:
10、公司管理员对R-Company路由器进行权限等级管理,新分配了5级和8级权限,要求:
1)等级密码分别为admin02、admin03,且是密文保存的
2)5级权限为可执行show running这个exec命令;
3)8级权限为可执行ip route和router rip两个configure命令(要有ip route / router rip的全命令)
R-Company(config)#username admin02 privilege 5 secret admin02
R-Company(config)#username admin03 privilege 8 secret admin03
R-Company(config)#privilege configure level 8 ip
R-Company(config)#privilege configure all level 8 ip route
R-Company(config)#privilege configure level 8 router
R-Company(config)#privilege configure all level 8 router rip
R-Company(config)#privilege exec level 8 configure
R-Company(config)#privilege exec level 5 show
R-Company(config)#privilege exec level 5 show running-config
11、公司来了1个实习生(shixi01)和1个新的管理员(admin04),在Switch-Company三层交换机上配置,使得这两个新员工有不同的视图,要求:
1)视图shixi01的命令包括show interface(全命令)、show ip route两个exec命令,密码是shixi;
2)视图admin04的命令包括 show ip route、ping(全命令)两个exec命令以及username(全命令),密码是admin
Switch-Company(config)#parser view admin04
Switch-Company(config-view)# secret admin
Switch-Company(config-view)# commands configure include all username
Switch-Company(config-view)# commands exec include configure
Switch-Company(config-view)# commands exec include all ping
Switch-Company(config-view)# commands exec include show ip route
Switch-Company(config)#parser view shixi01
Switch-Company(config-view)# secret shixi
Switch-Company(config-view)# commands exec include all show interfaces
Switch-Company(config-view)# commands exec include show ip route
验证:
admin04视图
shixi01视图
12、现在需要在连通性的基础上对ZZZ机构的路由器ZPF进行ZPF配置,实现基本安全:
1)WEB服务器放置在DMZ区,外网用户访问该服务器时,只能访问其443端口(https),内网用户可以http或者https访问服务器。
3)不影响总公司、分公司内部的通信。
1.1)
zone security IN
zone security OUT
zone security DMZ
access-list 100 permit tcp any host 192.168.14.100 eq 443
class-map type inspect match-all OUT-DMZ
match access-group 100
Exit
policy-map type inspect OUT-DMZ-MAP
class type inspect OUT-DMZ
Inspect
Exit
Exit
zone-pair security OUT-DMZ-PAIR source OUT destination DMZ
service-policy type inspect OUT-DMZ-MAP
exit
interface FastEthernet0/0
ip address 192.168.13.1 255.255.255.0
zone-member security OUT
!
interface FastEthernet0/1
ip address 192.168.11.1 255.255.255.0
zone-member security IN
!
interface FastEthernet1/0
ip address 192.168.14.254 255.255.255.0
zone-member security DMZ
1.2)
access-list 102 permit tcp any host 192.168.14.100 eq www
access-list 102 permit tcp any host 192.168.14.100 eq 443
class-map type inspect match-all IN-DMZ
match access-group 102
exit
policy-map type inspect IN-DMZ-MAP
class type inspect IN-DMZ
Inspect
Exit
exit
zone-pair security IN-DMZ-PAIR source IN destination DMZ
service-policy type inspect IN-DMZ-MAP
3)
access-list 101 permit ip any any
class-map type inspect match-all IN-OUT
match access-group 101
exit
class-map type inspect match-all OUT-IN
match access-group 101
exit
policy-map type inspect IN-OUT-MAP
class type inspect IN-OUT
inspect
Exit
exit
policy-map type inspect OUT-IN-MAP
class type inspect OUT-IN
Inspect
Exit
exit
zone-pair security IN-OUT-PAIR source IN destination OUT
service-policy type inspect IN-OUT-MAP
exit
zone-pair security OUT-IN-PAIR source OUT destination IN
service-policy type inspect OUT-IN-MAP
//IN和OUT区域双向放行
验证:
172.16.0.0 网段ping 192.168.0.0网段
192.168.0.0网段
172.16.0.0
2)现已知外网的ZIME-Server服务器,管理员只允许ZZZ内部用户ping、https访问这台服务器,其他操作不允许。对内网访问外网的其他通信暂时无安全管控需求。
ZPF(config)#access-list 101 permit icmp any host 218.75.41.141
ZPF(config)#access-list 101 permit tcp any host 218.75.41.141 eq 443
ZPF(config)#access-list 101 deny ip any host 218.75.41.141
ZPF(config)#access-list 101 permit ip any any