一.概述:
测试完了ASA8.4的Twice NAT解决×××地址重叠的问题,同时还与内部主机上互联网不冲突,于是想看看低版本的ASA/pix能否解决相同的问题,在GNS中模拟PIX8.0测试了一下,让人很失望,PIX虽然能解决地址重叠问题,但是同时也使得身后的网络无法连接公网,究其原因其实与路由器类似,不能调整静态NAT的优先级,配置完静态NAT之后,所有访问公网的流量也被静态NAT,导致无法上公网。PIX如果与路由器配置L2L ×××,倒是可以通过路由器来解决地址重叠和同时上公网的问题,这个其实和前面测试的两个路由器建立L2L ×××解决方法类似,不过还是记录下来,至少可以重温一下pix上配置×××的命令。
二.基本思路:
A.pix无法降低静态NAT的优先级,配置静态NAT可以解决地址重叠的问题,但同时也使得内网不能上公网。
B.通过与PIX建立×××的对端路由器来解决地址重叠与同时上公网的问题。
三.测试拓扑:
四.基本配置:
A.总部Server路由器:
interface Ethernet0/0
ip address 10.1.1.2 255.255.255.0
no shut
ip route 0.0.0.0 0.0.0.0 10.1.1.1
B.总部pix防火墙:
interface E0
ip address 10.1.1.1 255.255.255.0
nameif Inside
no shut
interface E1
ip address 202.100.1.1 255.255.255.0
nameif Outside
no shut
route outside 0.0.0.0 0.0.0.0 202.100.1.10
C.Internet路由器:
interface Ethernet0/0
ip address 202.100.1.10 255.255.255.0
no shut
interface Ethernet0/1
ip address 202.100.2.10 255.255.255.0
no shut
D.Branch路由器:
interface Ethernet0/0
ip address 10.1.1.1 255.255.255.0
no shut
interface Ethernet0/1
ip address 202.100.2.1 255.255.255.0
no shut
ip route 0.0.0.0 0.0.0.0 202.100.2.10
E.分支inside路由器:
interface Ethernet0/0
ip address 10.1.1.2 255.255.255.0
no shut
ip route 0.0.0.0 0.0.0.0 10.1.1.1
五.L2L ×××配置:
A.总部PIX80防火墙:
①第一阶段策略:
crypto isakmp policy 10
authentication pre-share
encryption des
hash md5
group 2
tunnel-group 202.100.2.1 type ipsec-l2l
tunnel-group 202.100.2.1 ipsec-attributes
pre-shared-key cisco
②第二阶段转换集:
crypto ipsec transform-set transet esp-des esp-md5-hmac
③感兴趣流:
access-list xingquliu extended permit ip 10.1.1.0 255.255.255.0 192.168.1.0 255.255.255.0
④配置crypto map并应用:
crypto map crymap 10 match address xingquliu
crypto map crymap 10 set peer 202.100.2.1
crypto map crymap 10 set transform-set transet
crypto map crymap interface Outside
crypto isakmp enable Outside
B.分支Branch路由器:
①第一阶段策略:
crypto isakmp policy 10
hash md5
authentication pre-share
group 2
en des
crypto isakmp key cisco address 202.100.1.1
②第二阶段转换集:
crypto ipsec transform-set transet esp-des esp-md5-hmac
③感兴趣流:
ip access-list extended ***
permit ip 192.168.1.0 0.0.0.255 10.1.1.0 0.0.0.255
④配置crypto map并应用:
crypto map crymap 10 ipsec-isakmp
set peer 202.100.1.1
set transform-set transet
match address ***
interface Ethernet0/1
crypto map crymap
六.NAT配置:
---×××配置完成后,两边是不能通讯的,需要配置静态NAT,虽然在PIX上配置静态NAT能地址重叠问题(如果在PIX上配置静态NAT感兴趣流与上面有区别),但是会导致PIX内网网络无法正常上公网,因此只能在PIX对端的路由器上配置静态NAT。
A.PAT上公网配置:
①总部PIX防火墙:
access-list Internet extended permit ip 10.1.1.0 255.255.255.0 any
access-list nonat extended permit ip 10.1.1.0 255.255.255.0 192.168.1.0 255.255.255.0
nat (Inside) 1 access-list Internet
global (Outside) 1 interface
nat (Inside) 0 access-list nonat
②分支Branch路由器:
interface Ethernet0/0
ip nat enable
interface Ethernet0/1
ip nat enable
ip access-list extended Internet
deny ip 10.1.1.0 0.0.0.255 172.16.1.0 0.0.0.255
permit ip 10.1.1.0 0.0.0.255 any
ip nat source list Internet interface Ethernet0/1 overload
B.静态NAT配置:
----只能在分支Branch上配置:
①静态NAT:
interface Loopback0
ip address 1.1.1.1 255.255.255.0
ip nat inside
interface Ethernet0/1
ip address 202.100.2.1 255.255.255.0
ip nat outside
ip nat inside source static network 10.1.1.0 192.168.1.0 /24
ip nat outside source static network 10.1.1.0 172.16.1.0 /24
②PBR配置:
ip access-list extended Real***
permit ip 10.1.1.0 0.0.0.255 172.16.1.0 0.0.0.255
route-map *** permit 10
match ip address Real***
set interface Loopback0
interface Ethernet0/0
ip policy route-map ***
转载于:https://blog.51cto.com/333234/1224824