思科認證CCNP實驗:GRE隧道流量的IPSEC加密
由于思科認證CCNP實驗中IPSEC只支持對單播流量的加密,所以我們在思科認證CCNP實驗時,先使用GRE隧道可以將廣播、組播包封裝在一個單播包中,再用IPSEC進行加密。
在進行IPSEC配置前應首先配置好GRE隧道,下面是R1上的GRE隧道配置:
R1:
interface tunnel0
ip address 192.168.3.1 255.255.255.0
tunnel source s1/1
tunnel destination 192.1.1.20
exit
interface s1/1
ip address 192.1.1.40 255.255.255.0
ip access-group perimeter in
exit
interface lo0
ip address 192.168.1.1 255.255.255.0
exit
ip route 0.0.0.0 0.0.0.0 192.1.1.20
思科認證CCNP實驗中這個位置,將總公司內部的骨干網絡設為Area0,隧道部分和分公司內部網絡設為Area1:
router ospf 1
network 192.168.1.0 0.0.0.255 area 0
network 192.168.3.0 0.0.0.255 area 1
exit
ip access-list extended perimeter
permit udp host 192.1.1.20 host 192.1.1.40 eq 500
permit esp host 193.1.1.20 host 192.1.1.40
permit gre host 193.1.1.20 host 192.1.1.40
deny ip any any
exit
R2:
interface tunnel0
ip address 192.168.3.2 255.255.255.0
tunnel source s1/0
tunnel destination 192.1.1.40
exit
interface s1/0
ip address 192.1.1.20 255.255.255.0
ip access-group perimeter in
exit
interface lo0
ip address 192.168.2.1 255.255.255.0
exit
ip route 0.0.0.0 0.0.0.0 192.1.1.40
router ospf 1
network 192.168.2.0 0.0.0.255 area 1
network 192.168.3.0 0.0.0.255 area 1
exit
ip access-list extended perimeter
permit udp host 192.1.1.40 host 192.1.1.20 eq 500
permit esp host 192.1.1.40 host 192.1.1.20
permit gre host 192.1.1.40 host 192.1.1.20
deny ip any any
exit
思科認證CCNP實驗里GRE隧道建立好后,就可以進行IPSEC配置了:
R1上的配置:
crypto isakmp enable
crypto isakmp identity address
crypto isakmp policy 10
encryption aes
authentication pre-share
group 2
hash sha
exit
crypto isakmp key cisco123 address 192.1.1.20 no-xauth
IPSEC只對進入GRE隧道的流量進行加密
ip access-list extended ToR2
permit gre host 192.1.1.40 host 192.1.1.20
exit
思科認證CCNP實驗中的GRE隧道是點對點模式的,所以傳輸集應使用傳輸模式
crypto ipsec transform-set trans esp-aes esp-sha-hmac
mode transport
exit
crypto map mymap 10 ipsec-isakmp
match address ToR2
set transform-set trans
set peer 192.1.1.20
exit
interface s1/1
crypto map mymap
exit
CCNP實驗***別忘記刪除測試隧道時建立的流量:
ip access-list extended perimeter
no permit gre host 192.1.1.20 host 192.1.1.40
【編輯推薦】