一、拓扑

一个小的综合实验,包括路由协议、tunnel、IPSEC等结合在一起。

二、配置


ROUTER 1
————————————————-


int lo0
ip add 1.1.1.1 255.255.255.0
no sh
int s1/0
clock rate 64000
ip add 15.1.1.1 255.255.255.0
no sh
router rip //rip 路由协议
ver 2
no au
net 15.1.1.0

int tun 1 // ***隧道1
ip add 12.1.1.1 255.255.255.0
tun sour s1/0
tun dest 25.1.1.2
router eigrp 100 //eigrp 路由协议
no au
net 1.1.1.0 0.0.0.255
net 12.1.1.0

crypto isakmp policy 10 //ipsec策略编号1-1000,号越小,优先级越高
hash md5 // 密钥认证的算法
authentication pre-share // 告诉路由使用预先共享的密钥
exit
crypto isakmp key cisco14 address 47.1.1.4 // 设置密钥cisco14 , 对端ip地址
crypto ipsec transform-set TOR4 esp-des esp-md5-hmac
// 设置test传输模式的名称。ah-md5-hamc esp-des表示传输模式中采用的验证和加密参数
crypto map IPSec*** 10 ipsec-isakmp
// 设置map的名字,10是策略的编号
set peer 47.1.1.4 // 设置对端的IP 地址
set transform-set TOR4 // IPSec传输模式的名字TOR4
match address 100 //映射匹配acl
exit
interface Serial1/0 //进入应用***的接口
crypto map IPSec*** //IPSec*** map的名字
exit
access-list 100 permit ip 1.1.1.0 0.0.0.255 4.4.4.0 0.0.0.255 // 定义哪些地址的报文加密或是不加密

int tun 0 // ***隧道0
ip add 13.1.1.1 255.255.255.0
tun sour s1/0
tun dest 37.1.1.3
router eigrp 100
no au
net 3.3.3.0 0.0.0.255
net 13.1.1.0

crypto isakmp policy 20
hash md5
authentication pre-share
exit
crypto isakmp key cisco13 address 37.1.1.3
crypto ipsec transform-set TOR3 esp-des esp-md5-hmac
crypto map IPSec*** 20 ipsec-isakmp
set peer 37.1.1.3
set transform-set TOR3
match address 150
exit
interface Serial1/0
crypto map IPSec***
exit
access-list 150 permit ip 1.1.1.0 0.0.0.255 3.3.3.0 0.0.0.255

ip route 0.0.0.0 0.0.0.0 5.5.5.5 //默认路由

conf t
wr

ROUTER 2
————————————————-
int lo0
ip add 2.2.2.2 255.255.255.0
no sh
int s1/0
ip add 25.1.1.2 255.255.255.0
clock rate 64000
no sh
int tun 1 // ***隧道1
ip add 12.1.1.2 255.255.255.0
tun sour s1/0
tun des 15.1.1.1
router rip //rip 路由协议
ver 2
no au
net 25.1.1.0
router eigrp 100 //eigrp 路由协议
no au
net 12.1.1.0
net 2.2.2.0 0.0.0.255

ROUTER 3
————————————————-
int lo0
ip add 3.3.3.3 255.255.255.0
no sh
int s1/0
ip add 37.1.1.3 255.255.255.0
no sh
router rip //rip 路由协议
ver 2
no au
net 37.1.1.0

int tun 0
ip add 13.1.1.3 255.255.255.0
tun sour s1/0
tun dest 15.1.1.1
exit
router eigrp 100 //eigrp 路由协议
no au
net 3.3.3.0 0.0.0.255
net 13.1.1.0

crypto isakmp policy 20
hash md5
authentication pre-share
exit
crypto isakmp key cisco13 address 15.1.1.1
crypto ipsec transform-set TOR1 esp-des esp-md5-hmac
crypto map IPSec*** 20 ipsec-isakmp
set peer 15.1.1.1
set transform-set TOR1
match address 150
exit
interface Serial1/0
crypto map IPSec***
exit
access-list 150 permit ip 1.1.1.0 0.0.0.255 3.3.3.0 0.0.0.255

ROUTER 4
————————————————-
int lo0
ip add 4.4.4.4 255.255.255.0
no sh
int s1/0
ip add 47.1.1.4 255.255.255.0
no sh
router rip //rip 路由协议
ver 2
no au
net 47.1.1.0

ip route 0.0.0.0 0.0.0.0 7.7.7.7 //默认路由

crypto isakmp policy 10
hash md5
authentication pre-share
exit
crypto isakmp key cisco14 address 15.1.1.1
crypto ipsec transform-set TOR1 esp-des esp-md5-hmac
crypto map IPSec*** 10 ipsec-isakmp
set peer 15.1.1.1
set transform-set TOR1
match address 100
exit
interface Serial1/0
crypto map IPSec***
exit
access-list 100 permit ip 1.1.1.0 0.0.0.255 4.4.4.0 0.0.0.255

ROUTER 5
————————————————-
interface Loopback0
ip address 5.5.5.5 255.255.255.0
int s1/0
ip add 15.1.1.5 255.255.255.0
no sh
int s1/1
ip add 25.1.1.5 255.255.255.0
no sh
int s1/2
ip add 56.1.1.5 255.255.255.0
clock rate 64000
no sh
router rip //rip 路由协议
ver 2
no au
net 15.1.1.0
net 25.1.1.0
net 56.1.1.0

ip route 0.0.0.0 0.0.0.0 1.1.1.1 //默认路由
ip route 0.0.0.0 0.0.0.0 6.6.6.6

ROUTER 6
————————————————-

interface Loopback0
ip address 6.6.6.6 255.255.255.0
int s1/0
ip add 56.1.1.6 255.255.255.0
no sh
int s1/1
ip add 67.1.1.6 255.255.255.0
clock rate 64000
no sh
router rip //rip 路由协议
ver 2
no au
net 56.1.1.0
net 67.1.1.0

ip route 0.0.0.0 0.0.0.0 5.5.5.5 //默认路由
ip route 0.0.0.0 0.0.0.0 7.7.7.7

ROUTER 7
————————————————-
interface Loopback0
ip address 7.7.7.7 255.255.255.0
int s1/0
ip add 67.1.1.7 255.255.255.0
no sh
int s1/1
ip add 37.1.1.7 255.255.255.0
clock rate 64000
no sh
int s1/2
ip add 47.1.1.7 255.255.255.0
clock rate 64000
no sh
router rip //rip 路由协议
ver 2
no au
net 67.1.1.0
net 37.1.1.0
net 47.1.1.0
ip route 0.0.0.0 0.0.0.0 6.6.6.6 //默认路由
ip route 0.0.0.0 0.0.0.0 4.4.4.4

三、验证




本文转载于公众号:网络之路博客

©著作权归作者所有:来自51CTO博客作者网络之路blo的原创作品,如需转载,请注明出处,否则将追究法律责任

更多相关文章

  1. 原来我还有网络天赋
  2. VUE---路由菜单Icon自定义的实现
  3. Linux免交互登录远程服务器并执行命令
  4. IDEA激活码注册码密钥,2021年最新永久激活码共享!
  5. 多厂商***系列之三:Cisco EZ***的实现【PC&路由器拨号】
  6. 多厂商***系列之四:Cisco&H3C Dynamic LAN-To-LAN ***【 包含路由
  7. 多厂商***系列之一:加密基础与IPSec【附带思科与H3C的配置介绍】
  8. TCPIP卷一(6):距离矢量与链路状态 路由选择协议
  9. TCPIP卷一(10):EIGRP的DUAL算法和SIA解决方案

随机推荐

  1. php中static关键字的理解
  2. PHP的Phar包原来性能这么强
  3. php利用32进制实现对id加密解密
  4. 详解 PHP 中的三大经典模式
  5. 宿主机nginx与docker的PHP搭配使用
  6. PHP浮点精度问题
  7. PHP变量的初始化以及赋值方式介绍
  8. PHP序列化和反序列化语法差异问题
  9. PHP 编写基本的 Socket 程序
  10. 如何直接访问php实例对象的private属性