2024年6月13日发(作者:)
Cisco ASA 8.4(8.0)链路冗余+VPN配置
一、 网络拓扑
本部分ASA主要使用SLA、NAT、ACL、DPD及IPSec VPN 等技术
二、 设备基本网络配置
R1的基本网络配置
!
interface Loopback0
ip address 192.168.1.1 255.255.255.0
!
interface Ethernet1/0
ip address 10.1.1.2 255.255.255.0
!
ip route 0.0.0.0 0.0.0.0 10.1.1.1
!
R2的基本网络配置
!
interface Loopback0
ip address 2.2.2.2 255.255.255.0
!
interface Ethernet1/0
ip address 202.100.1.2 255.255.255.0
half-duplex
!
interface Ethernet1/1
ip address 202.100.2.2 255.255.255.0
half-duplex
!
router ospf 100
router-id 2.2.2.2
log-adjacency-changes
passive-interface Ethernet1/0
network 202.100.1.0 0.0.0.255 area 0
network 202.100.2.0 0.0.0.255 area 0
!
R3上的基本网络配置
!
interface Loopback0
ip address 3.3.3.3 255.255.255.0
!
interface Ethernet1/0
ip address 61.1.1.2 255.255.255.0
half-duplex
!
interface Ethernet1/1
ip address 61.1.2.2 255.255.255.0
half-duplex
!
router ospf 100
router-id 3.3.3.3
log-adjacency-changes
passive-interface Ethernet1/0
network 61.1.1.0 0.0.0.255 area 0
network 61.1.2.0 0.0.0.255 area 0
!
R4上的基本网络配置
!
interface Loopback0
ip address 4.4.4.4 255.255.255.0
!
interface Ethernet1/0
ip address 172.16.1.2 255.255.255.0
half-duplex
!
interface Ethernet1/1
ip address 202.100.2.1 255.255.255.0
half-duplex
!
router ospf 100
router-id 4.4.4.4
log-adjacency-changes
passive-interface Ethernet1/0
network 61.1.2.0 0.0.0.255 area 0
network 172.16.1.0 0.0.0.255 area 0
network 202.100.2.0 0.0.0.255 area 0
!
ASA8.4上的基本网络配置
!
interface GigabitEthernet0
nameif Inside
security-level 100
ip address 10.1.1.1 255.255.255.0
!
interface GigabitEthernet1
nameif Outside
security-level 0
ip address 202.100.1.1 255.255.255.0
!
interface GigabitEthernet2
nameif Backup
security-level 0
ip address 61.1.1.1 255.255.255.0
!
route Inside 192.168.1.0 255.255.255.0 10.1.1.2 1
!
ASA8.0上的基本网络配置
!
interface Ethernet0/0
nameif Outside
security-level 0
ip address 172.16.1.1 255.255.255.0
!
interface Ethernet0/1
nameif Inside
security-level 100
ip address 10.1.2.1 255.255.255.0
!
route Outside 0.0.0.0 0.0.0.0 172.16.1.2 1
route Inside 192.168.2.0 255.255.255.0 10.1.2.2 1
!
三、ASA上的SLA配置
ASA8.4上的SLA配置
ASA(config)# sla monitor 1
ASA(config-sla-monitor)# type echo protocol ipIcmpEcho 202.100.1.2
interface Outside
ASA(config-sla-monitor-echo)# frequency 10
ASA(config-sla-monitor-echo)# sla monitor schedule 1 life forever start-time
now
ASA(config)# sla monitor 2
ASA(config-sla-monitor)# type echo protocol ipIcmpEcho 61.1.1.2 interface
Backup
ASA(config-sla-monitor-echo)# frequency 10
ASA(config-sla-monitor-echo)# sla monitor schedule 2 life forever start-time
now
关于SLA可以百度
Track配置
ASA(config)# track 1 rtr 1 reachability
ASA(config)# track 2 rtr 2 reachability
ASA(config)# route Outside 0.0.0.0 0.0.0.0 202.100.1.2 1 track 1
ASA(config)# route Backup 0.0.0.0 0.0.0.0 61.1.1.2 254
至此链路冗余配置完毕,可以通过ping跟traceroute命令来检测配置,在检测之前需
要先在ASA上放行ICMP流量
ASA(config)# access-list outside extended permit icmp any any
ASA(config)# access-list outside extended permit udp any any range 33434
33523
在出接口上应用
ASA(config)# access-group outside in interface Outside
ASA(config)# access-group outside in interface Backup
在ASA上测试,长ping 172.16.1.2,并关闭Internet_1的E1/0接口
测试证明SLA配置正确,接下来继续配置IPSec VPN。
四、 NAT配置
ASA8.4上的NAT配置
ASA(config)#object network Inside_network 定义object名称
ASA(config-network-object)#subnet 192.168.1.0 255.255.255.0 定义内部网络
ASA(config-network-object)# nat (inside,outside) static interface 配置复用
Outside接口的NAT转换
ASA(config)#object network Inside_network_Backup
ASA(config-network-object)#subnet 192.168.1.0 255.255.255.0 定义
内部网络,由于不同的出接口需要配置不同的NAT,所以需要定义两条
ASA(config-network-object)# nat (inside,backup) static interface 配置复用
Backup接口的NAT转换
ASA(config)#object network VPN_network
ASA(config-network-object)#subnet 192.168.1.0 255.255.255.0 定义分支机构
的局域网地址
配置NAT
ASA(config)# nat (Inside,Outside) source static Inside_network Inside_network
destination static VPN_network VPN_network 定义全局Outside接口对感兴趣流
不执行NAT转换
ASA(config)# nat (Inside,Backup) source static Inside_network_Backup
Inside_network_Backup destination static VPN_network VPN_network
定义全局Backup接口对感兴趣流不执行NAT转换
测试NAT
ASA8.0上的NAT配置
ASA(config)# access-list nonat extended permit ip 192.168.2.0 255.255.255.0
192.168.1.0 255.255.255.0 定义感兴趣流
ASA(config)# global (Outside) 1 interface 定义全区复用接口NAT
ASA(config)# nat (Inside) 0 access-list nonat 匹配感兴趣流的将不执行转换
ASA(config)# nat (Inside) 1 0.0.0.0 0.0.0.0 内部网络转换
测试NAT
五、IPSec VPN 配置
ASA8.4上的IPSec VPN配置
IKEV1 第一阶段配置
ASA(config)# crypto ikev1 enable Outside 激活Outside接口
ASA(config)# crypto ikev1 enable Backup
ASA(config)# crypto ikev1 policy 10
ASA(config-ikev1-policy)# authentication pre-share
ASA(config-ikev1-policy)# encryption 3des
ASA(config-ikev1-policy)# group 2
ASA(config-ikev1-policy)# hash md5
Tunnel配置
ASA(config)#tunnel-group 172.16.1.1 type ipsec-l2l VPN类型
ASA(config)# tunnel-group 172.16.1.1 ipsec-attributes
ASA(config-tunnel-ipsec)# ikev1 pre-shared-key cisco 预共享秘钥
配置感兴趣流
ASA(config)#access-list vpn extended permit ip 192.168.1.0 255.255.255.0
192.168.2.0 255.255.255.0
配置转换集
ASA(config)# crypto ipsec ikev1 transform-set trans esp-3des esp-md5-hmac
加密策略
配置MAP
ASA(config)#crypto map mymap 10 match address vpn 匹配感兴趣流
ASA(config)#crypto map mymap 10 set peer 172.16.1.1 对端地址
ASA(config)#crypto map mymap 10 set ikev1 transform-set trans 转换集
接口配置
ASA(config)#crypto map mymap interface Outside 接口应用
ASA(config)#crypto map mymap interface Backup 接口应用
ASA8.0上的IPSec VPN 配置
ASA(config)# crypto isakmp enable Outside
ASA(config)# crypto isakmp policy 10
ASA(config-isakmp-policy)# authentication pre-share
ASA(config-isakmp-policy)# encryption 3des
ASA(config-isakmp-policy)# hash md5
ASA(config-isakmp-policy)# group 2
Tunnel配置
ASA(config)# tunnel-group 202.100.1.1 type ipsec-l2l
ASA(config)# tunnel-group 202.100.1.1 ipsec-attributes
ASA(config-tunnel-ipsec)# pre-shared-key cisco
ASA(config)# tunnel-group 61.1.1.1 type ipsec-l2l
ASA(config)# tunnel-group 61.1.1.1 ipsec-attributes
ASA(config-tunnel-ipsec)# pre-shared-key cisco
配置感兴趣流
ASA(config)#access-list vpn extended permit ip 192.168.1.0 255.255.255.0
192.168.2.0 255.255.255.0
配置转换集
ASA(config)# crypto ipsec ikev1 transform-set trans esp-3des esp-md5-hmac
加密策略
配置MAP
ASA(config)#crypto map mymap 10 match address vpn
ASA(config)#crypto map mymap 10 set peer 202.100.1.1 61.1.1.1 主线路的地
址先配置
ASA(config)#crypto map mymap 10 set transform-set trans
DPD配置
ASA(config)#crypto isakmp keepalive 10 启用周期性工作的DPD模式,快速检
测有问题的VPN Tunnel
接口配置
ASA(config)#crypto map mymap interface Outside 接口应用
至此IPSec VPN 配置完毕,下面进行检测,同样需要在ASA8.0上放行ICMP流量
ASA(config)#access-list outside extended permit icmp any any
ASA(config)#access-group outside in interface Outisde
在分支机构R5路由器上ping总部局域网地址192.168.1.1
显示VPN链路
畅通,在分支机构的ASA上查看IPSec SA
显示与总部
202.100.1.1的地址建立的VPN Tunnel
长ping 192.168.1.1 并shutdown Internet_1路由器的E1/0接口
VPN链路在Internet_1路由器的E1/0接口shutdown后成功自动切换VPN网关,
在在分支机构的ASA上查看IPSec SA,显示peer地址为61.1.1.1
配置完成
技术交流QQ:365145245
发布评论