注册 | 登录 忘记密码? 51cto首页 | 博客 | 论坛 | 招聘
热点文章 华硕获奖方案 - 中小企业..
 帮助

在Cisco路由器上配置VPN


2008-03-01 11:49:13
 标签:VPN 路由器   [推送到技术圈]

网络环境介绍:
用两台路由器分别代表公司总部(R1)和公司分部(R2).公司总部内部地址为192.168.1.0/24网段.分部内部地址为192.168.2.0/24网段.
网络拓扑如下:
 
实验配置:
R1
 
r1#show run
Building configuration...
Current configuration : 1505 bytes
!
version 12.3
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname r1
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
ip subnet-zero
!
!
ip cef
no ip domain lookup
!
ip audit po max-events 100
no ftp-server write-enable
!        
!
!
!
!
!
!
!
!
!
!
!
!
!
!
crypto isakmp policy 1     定义策略集,下面是策略集的内容,两边要一致.
 hash md5       
 authentication pre-share
 lifetime 64000
crypto isakmp key cisco address 202.10.1.2   设置共享密钥和对端地址!
!
crypto ipsec transform-set benet ah-md5-hmac esp-des 配置IPSec的相关参数,两边也要一致.
!        
crypto map map1 1 ipsec-isakmp  配置端口应用,就是将IKE与IPSec做个关联,我是这样理解的.
 set peer 202.10.1.2
 set transform-set benet
 match address 101
!
!
!
!
interface Loopback0    回环地址模拟公司内部地址
 ip address 192.168.1.1 255.255.255.0
!
interface FastEthernet0/0
 no ip address
 shutdown
 duplex auto
 speed auto
!
interface FastEthernet0/1
 no ip address
 shutdown
 duplex auto
 speed auto
!        
interface Serial1/0         配置路由器的地址
 ip address 202.10.1.1 255.255.255.0
 serial restart-delay 0
 crypto map map1
!
interface Serial1/1
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial1/2
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial1/3
 no ip address
 shutdown
 serial restart-delay 0
!
ip http server
no ip http secure-server
ip classless
ip route 192.168.2.0 255.255.255.0 202.10.1.2    静态路由到公司分部
!
!
access-list 101 permit ip 192.168.1.0 0.0.0.255 192.168.2.0 0.0.0.255
!设置要加密的数据流.这里是指从192.168.1.0到192.168.2.0的数据流
!
!
!
!
!
!
!
!
line con 0
 exec-timeout 0 0
 logging synchronous
 transport preferred all
 transport output all
line aux 0
 transport preferred all
 transport output all
line vty 0 4
!        
end
R2上的配置差不多,就把IP地址改了.
r2#show run
Building configuration...
Current configuration : 1505 bytes
!
version 12.3
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname r2
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
ip subnet-zero
!
!
ip cef
no ip domain lookup
!
ip audit po max-events 100
no ftp-server write-enable
!        
!
!
!
!
!
!
!
!
!
!
!
!
!
!
crypto isakmp policy 1
 hash md5
 authentication pre-share
 lifetime 64000
crypto isakmp key cisco address 202.10.1.1
!
!
crypto ipsec transform-set cisco ah-md5-hmac esp-des
!        
crypto map map1 1 ipsec-isakmp
 set peer 202.10.1.1
 set transform-set cisco
 match address 101
!
!
!
!
interface Loopback0
 ip address 192.168.2.1 255.255.255.0
!
interface FastEthernet0/0
 no ip address
 shutdown
 duplex auto
 speed auto
!
interface FastEthernet0/1
 no ip address
 shutdown
 duplex auto
 speed auto
!        
interface Serial1/0
 ip address 202.10.1.2 255.255.255.0
 serial restart-delay 0
 crypto map map1
!
interface Serial1/1
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial1/2
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial1/3
 no ip address
 shutdown
 serial restart-delay 0
!
ip http server
no ip http secure-server
ip classless
ip route 192.168.1.0 255.255.255.0 202.10.1.1
!
!
access-list 101 permit ip 192.168.2.0 0.0.0.255 192.168.1.0 0.0.0.255
!
!
!
!
!
!
!
!
!
line con 0
 exec-timeout 0 0
 logging synchronous
 transport preferred all
 transport output all
line aux 0
 transport preferred all
 transport output all
line vty 0 4
!        
end
r2#
 
这命令还是要常敲啊,学完这个有段时间了,就差不多都忘了.




    文章评论
 <<   1   2   >>   页数 ( 1/2 )  
2008-03-01 21:40:51
来坐个沙发。。嘿嘿``想当年我们的教材里还没有VPN啊。。

2008-03-02 09:01:14
二代的教材里加了好多现在用得很多的知识,你们还有好多都没有呢
不过,就是有些说的太简单了

2008-03-03 10:49:08
是青鸟的?

2008-03-03 13:45:43
我是在青鸟啊,你也是吗?

2008-03-03 19:33:42
哈哈,我也是青鸟的啊。大家真的有缘!

2008-03-03 19:36:05
我也是青鸟的,你们觉的青鸟怎么样啊?

2008-03-03 20:16:15
说心里话,青鸟没想像中那么好,但也不是听别人说的那么差.总之一句话,想学东西,最后还是要靠自己.师傅带进门而已.

 <<   1   2   >>   页数 ( 1/2 )  

发表评论

昵   称:
验证码:  点击图片可刷新验证码  博客过2级,无需填写验证码
内   容: