思科認(rèn)證CCNP實(shí)驗(yàn):GRE隧道流量的IPSEC加密
由于思科認(rèn)證CCNP實(shí)驗(yàn)中IPSEC只支持對(duì)單播流量的加密,所以我們?cè)谒伎普J(rèn)證CCNP實(shí)驗(yàn)時(shí),先使用GRE隧道可以將廣播、組播包封裝在一個(gè)單播包中,再用IPSEC進(jìn)行加密。
在進(jìn)行IPSEC配置前應(yīng)首先配置好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
思科認(rèn)證CCNP實(shí)驗(yàn)中這個(gè)位置,將總公司內(nèi)部的骨干網(wǎng)絡(luò)設(shè)為Area0,隧道部分和分公司內(nèi)部網(wǎng)絡(luò)設(shè)為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
思科認(rèn)證CCNP實(shí)驗(yàn)里GRE隧道建立好后,就可以進(jìn)行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只對(duì)進(jìn)入GRE隧道的流量進(jìn)行加密
ip access-list extended ToR2
permit gre host 192.1.1.40 host 192.1.1.20
exit
思科認(rèn)證CCNP實(shí)驗(yàn)中的GRE隧道是點(diǎn)對(duì)點(diǎn)模式的,所以傳輸集應(yīng)使用傳輸模式
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實(shí)驗(yàn)***別忘記刪除測(cè)試隧道時(shí)建立的流量:
ip access-list extended perimeter
no permit gre host 192.1.1.20 host 192.1.1.40
【編輯推薦】