![]() |
如圖。
1. 實(shí)現(xiàn)武漢和北京兩個(gè)私網(wǎng)地址(loopback地址)的互通。兩個(gè)VPN網(wǎng)關(guān)必須有公網(wǎng)地址,且必須是靜態(tài)地址。
2. 要求私網(wǎng)兩個(gè)網(wǎng)段之間的數(shù)據(jù)流量采用IPSEC加密傳輸。
3. 采用隧道模式。
1. 由于傳輸模式僅適用于兩臺(tái)主機(jī)之間的相連,實(shí)際使用意義不大,本處省略。使用中可參考隧道配置。
2. 兩邊的VPN網(wǎng)關(guān)可以為路由器或Secpath專用VPN網(wǎng)關(guān)。
|
|
|
[Secpath1-beijing] |
ike peer 1 |
配置IKE參數(shù) |
|
pre-shared-key 12345 |
配置預(yù)共享字。兩端必須一致。 有些路由器版本需要加”extrange main”啟動(dòng)主模式。一般,默認(rèn)即為主模式。 |
|
remote-address 202.38.1.2 |
配置隧道對(duì)端地址。 |
|
# |
|
|
ipsec proposal p1 |
創(chuàng)建安全提議,可采用默認(rèn)安全提議內(nèi)容。默認(rèn)為:ESP隧道封裝,DES加密,MD5驗(yàn)證。 通過(guò)”display ipsec proposal”可以查看提議內(nèi)容。包括加密方法、數(shù)據(jù)認(rèn)證方法等。如需更改,則在安全提議模式下更改 |
|
# |
|
|
ipsec policy policy1 1 isakmp |
創(chuàng)建ipsec策略,其安全內(nèi)容采用IKE自動(dòng)協(xié)商。 |
|
security acl 3000 |
指定哪些數(shù)據(jù)流需要加密 |
|
ike-peer 1 |
引用IKE對(duì)等體 |
|
proposal p1 |
引用安全提議 |
|
# |
|
|
interface Ethernet0/0/0 |
|
|
ip address 202.38.1.1 255.255.255.0 |
|
|
ipsec policy policy1 |
在外網(wǎng)接口上啟用IPSEC策略,加密相關(guān)私網(wǎng)數(shù)據(jù) |
|
# |
|
|
acl number 3000 |
|
|
rule 0 permit ip source 10.1.1.0 0.0.0.255 destination 10.1.2.0 0.0.0.255 |
指定去往對(duì)端私網(wǎng)的數(shù)據(jù)流 |
|
rule 1 deny ip |
|
|
# |
|
|
ip route-static 0.0.0.0 0.0.0.0 202.38.2.2 preference 60 |
注意:一定要有去往對(duì)端的路由,包括公網(wǎng)和私網(wǎng)地址。也就是說(shuō),設(shè)備需要知道去往10.1.2.0的路徑,通過(guò)路由發(fā)到公網(wǎng)口上。 |
|
# |
|
|
|
|
[Secpath2-wuhan] |
ike peer 1 |
配置IKE參數(shù) |
|
pre-shared-key 12345 |
配置預(yù)共享字。兩端必須一致。 有些路由器版本需要加”extrange main”啟動(dòng)主模式。 |
|
remote-address 202.38.1.1 |
配置隧道對(duì)端地址。 |
|
# |
|
|
ipsec proposal p1 |
創(chuàng)建安全提議,可采用默認(rèn)安全提議內(nèi)容。通過(guò)”display ipsec proposal”可以查看提議內(nèi)容。包括加密方法、數(shù)據(jù)認(rèn)證方法等。如需更改,則在安全提議模式下更改 |
|
# |
|
|
ipsec policy policy1 1 isakmp |
創(chuàng)建ipsec策略,其安全內(nèi)容采用IKE自動(dòng)協(xié)商。 |
|
security acl 3000 |
指定哪些數(shù)據(jù)需要加密 |
|
ike-peer 1 |
引用IKE對(duì)等體 |
|
proposal p1 |
引用安全提議 |
|
# |
|
|
interface Ethernet0/0/0 |
|
|
ip address 202.38.1.2 255.255.255.0 |
|
|
ipsec policy policy1 |
在外網(wǎng)接口上啟用IPSEC策略,加密相關(guān)私網(wǎng)數(shù)據(jù) |
|
# |
|
|
acl number 3000 |
|
|
rule 0 permit ip source 10.1.2.0 0.0.0.255 destination 10.1.1.0 0.0.0.255 |
指定去往對(duì)端私網(wǎng)的數(shù)據(jù)流,注意與對(duì)端的ACL應(yīng)為鏡像,這樣雙方才能互相對(duì)數(shù)據(jù)加解密。 |
|
rule 1 deny ip |
|
|
# |
|
|
ip route-static 0.0.0.0 0.0.0.0 202.38.2.1 preference 60 |
注意:一定要有去往對(duì)端的路由 |
|
|
|
1、 常見(jiàn)錯(cuò)誤為路由設(shè)置問(wèn)題。沒(méi)有去往對(duì)端私網(wǎng)的路由。
2、 以武漢去往北京的報(bào)文為例,報(bào)文格式如下:
![]() |