VPN技能-GRE over IPsec vpn配置学习笔记

打印 上一主题 下一主题

主题 965|帖子 965|积分 2895

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

x

1.基础配置
CLIENT2:

CLIENT3:

PC2:


R1:
interface GigabitEthernet0/0/0
 ip address 12.1.1.1 255.255.255.0
interface GigabitEthernet0/0/1
 ip address 192.168.1.1 255.255.255.0
R2:
interface GigabitEthernet0/0/0
 ip address 12.1.1.2 255.255.255.0
interface GigabitEthernet0/0/1
 ip address 23.1.1.2 255.255.255.0
interface GigabitEthernet0/0/2
 ip address 24.1.1.2 255.255.255.0
R3:
interface GigabitEthernet0/0/0
 ip address 23.1.1.3 255.255.255.0
interface GigabitEthernet0/0/1
 ip address 192.168.3.1 255.255.255.0
R4:
interface GigabitEthernet0/0/0
 ip address 24.1.1.4 255.255.255.0
interface GigabitEthernet0/0/1
 ip address 192.168.4.1 255.255.255.0:
2.配置缺省路由确保双方的公网地址可达
R1:ip route-static 0.0.0.0 0 12.1.1.2
R3:ip route-static 0.0.0.0 0 23.1.1.2
R4:ip route-static 0.0.0.0 0 24.1.1.2

3.在总部R3上创建安全提议以及安全策略:对数据加密和认证的一个方案(认证算法、加密算法、以及隧道封装模式 、IKE版本、认证暗码等等)

3.1创建安全提议aa
[R3]ipsec proposal aa 
注意:
(1)AH 只能用来做认证和校验    ESP 既能用来做认证、校验也能用来做数据加密
(2)AH 可以选择认证算法        ESP可以选择认证和加密两类算法
默认封装方式:默认采用esp模式的隧道封装
相应esp认证算法:MD5-HMAC-96 esp
加密算法:DES
display ipsec proposal name aa


3.2创建IKE安全提议
[R3]ike proposal 5

3.3创建到达上海的IKE对等体,引用IKE安全提议
[R3]ike peer ShangHai v2
[R3-ike-peer-ShangHai]pre-shared-key cipher huawei
[R3-ike-peer-ShangHai]ike-proposal 5
[R3-ike-peer-ShangHai]quit

3.4创建到达上海的ipsec配置文件,调用ike对等体和安全提议aa
[R3]ipsec profile TO_ShangHai
[R3-ipsec-profile-TO_ShangHai]ike-peer ShangHai
[R3-ipsec-profile-TO_ShangHai]proposal aa
[R3-ipsec-profile-TO_ShangHai]quit

3.5创建到达南京的IKE对等体,引用IKE安全提议
ike peer NanJing v2
pre-shared-key cipher huawei
ike-proposal 5

3.6创建到达南京的ipsec配置文件,调用ike对等体和安全提议aa
ipsec profile TO_NanJing
ike-peer NanJing
proposal aa

3.7创建GRE隧道接口并将ipsec vpn策略文件调用到隧道口
interface Tunnel0/0/0
ip address 192.168.13.3 255.255.255.0
tunnel-protocol gre
source GigabitEthernet0/0/0
destination 12.1.1.1
ipsec profile TO_ShangHai

interface Tunnel0/0/1
ip address 192.168.34.3 255.255.255.0
tunnel-protocol gre
source GigabitEthernet0/0/0
destination 24.1.1.4
ipsec profile TO_NanJing

4.配置上海分支R1
4.1创建安全提议以及安全策略:对数据加密和认证的一个方案(认证算法、加密算法、以及隧道封装模式 、IKE版本、认证暗码等等)
ipsec proposal aa
4.2创建IKE安全提议
ike proposal 5
4.3创建到达总部的IKE对等体,引用IKE安全提议
ike peer ZongBu v2
pre-shared-key cipher huawei
ike-proposal 5
quit

4.4创建到达总部的ipsec配置文件,调用ike对等体和安全提议aa
ipsec profile TO_ZongBu
ike-peer ZongBu
proposal aa
quit

4.5创建GRE隧道接口并将ipsec vpn策略文件调用到隧道口
interface Tunnel0/0/0
ip address 192.168.13.1 255.255.255.0
tunnel-protocol gre
source GigabitEthernet0/0/0
destination 23.1.1.3
ipsec profile TO_ZongBu

5.配置南京分支R4
5.1创建安全提议以及安全策略:对数据加密和认证的一个方案(认证算法、加密算法、以及隧道封装模式 、IKE版本、认证暗码等等)
ipsec proposal aa
5.2创建IKE安全提议
ike proposal 5
5.3创建到达总部的IKE对等体,引用IKE安全提议
ike peer ZongBu v2
pre-shared-key cipher huawei
ike-proposal 5
quit

5.4创建到达总部的ipsec配置文件,调用ike对等体和安全提议aa
ipsec profile TO_ZongBu
ike-peer ZongBu
proposal aa
quit

5.5创建GRE隧道接口并将ipsec vpn策略文件调用到隧道口
interface Tunnel0/0/1
ip address 192.168.34.4 255.255.255.0
tunnel-protocol gre
source GigabitEthernet0/0/0
destination 23.1.1.3
ipsec profile TO_ZongBu
quit

6. 配置动态路由协议(大概静态也可以)
在这里不能去宣告公网接口的IP地址,只需要宣告隧道接口的和内网的。
6.1配置R1的ospf
ospf 1
area 0
network 192.168.1.0 0.0.0.255
network 192.168.13.0 0.0.0.255
quit
quit

6.2配置R3的ospf
ospf 1
area 0
network 192.168.3.0 0.0.0.255
network 192.168.13.0 0.0.0.255
network 192.168.34.0 0.0.0.255
quit
quit

6.3配置R4的ospf
ospf 1
area 0
network 192.168.4.0 0.0.0.255
network 192.168.34.0 0.0.0.255
quit
quit

7.配置验证
7.1配置完OSPF查看路由表信息


7.2南京:PC可以访问总部和上海分公司访问上海时需颠末总部中转。也可以在分支之间搭建vpn避免分支互访时绕行总部。

可以在R4上的G0/0/0进行抓包分析,在ping 192.168.1.2时,发现数据包从24.1.1.4去往23.1.1.3,之后通过R3再去转发给R1实现互访。

7.3查看ipsec配置文件
display ipsec profile


7.4查看安全联盟sa
display ipsec sa brief

两个安全联盟(一对):安全联盟是单向的

注意:模仿器有bug ,配置完成后不要重置ipsecsa,不要重启单个路由器,否则会出现不通征象!!如果要重启,可以实验关掉后全部重启!!


免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。
回复

使用道具 举报

0 个回复

倒序浏览

快速回复

您需要登录后才可以回帖 登录 or 立即注册

本版积分规则

大连密封材料

金牌会员
这个人很懒什么都没写!
快速回复 返回顶部 返回列表