设为首页收藏本站language 语言切换
查看: 3153|回复: 13
收起左侧

[已解决] 求助大家来看看这道经典题目!!

[复制链接]
发表于 2012-2-8 11:57:38 | 显示全部楼层 |阅读模式
在R1上既做了NAT 也做了IPSEC VPN,目的是实现内网能访问外网,也能访问总部的内网
在R2上模拟的是ISP
在R3上只做了NAT转换,目的是实现内网用户访问外网
在R4上做了IPSEC VPN,目的是和分布的内网互通

最终出现的问题:
R1的内网用户可以通过NAT访问R2的12.1.1.2地址
R1的内网用户不可以通过NAT访问R3的23.1.1.3地址
R1自身也ping不同R3
R2自身也ping不同R3(是直连网段,晕了)
但:
R3自身可以ping同R1和R2

只要是以目的地址为R3的F0/1的地址都ping 不同,但是反过来R3是可以ping通R1 /R2的
R1和R3内网段192.168.1.0--192.168.3.0可以相互访问(证明VPN没问题)
R3内网可以成功通过NAT访问外网(NAT穿越没问题)
实验工具:GNS3最新版的   IOS  2691 K9 12.4以上的

配置信息(主要是R1 R3 R4)
R1:
!
!
version 12.4
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
memory-size iomem 5
ip cef
!
!
!
!
no ip domain lookup
!
multilink bundle-name authenticated
!
!
!
!
crypto isakmp policy 1
encr 3des
hash md5
authentication pre-share
group 2
crypto isakmp key cisco address 23.1.1.3

!
crypto ipsec transform-set tao esp-3des esp-sha-hmac
!
crypto map cisco 10 ipsec-isakmp
set peer 23.1.1.3
set transform-set tao
match address 100

!
!
interface Loopback0
ip address 192.168.1.1 255.255.255.0
ip nat inside
ip virtual-reassembly
!
interface FastEthernet0/0
ip address 12.1.1.1 255.255.255.0
ip nat outside
ip virtual-reassembly
duplex auto
speed auto
crypto map cisco
!
interface FastEthernet0/1
no ip address
shutdown
duplex auto
speed auto
!
ip route 0.0.0.0 0.0.0.0 12.1.1.2
!
!
no ip http server
no ip http secure-server
ip nat inside source list 101 interface FastEthernet0/0 overload
!
access-list 100 permit ip 192.168.1.0 0.0.0.255 192.168.3.0 0.0.0.255
access-list 101 deny   ip 192.168.1.0 0.0.0.255 192.168.3.0 0.0.0.255
access-list 101 permit ip any any
!
!
control-plane
!
!
!
line con 0
exec-timeout 0 0
logging synchronous
line aux 0
line vty 0 4
!
!
end

R2:
!
!
version 12.4
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
memory-size iomem 5
ip cef
!
!
!
no ip domain lookup
!
multilink bundle-name authenticated
!
!
!
interface FastEthernet0/0
ip address 12.1.1.2 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet0/1
ip address 23.1.1.2 255.255.255.0
duplex auto
speed auto
!
!
!
no ip http server
no ip http secure-server
!
!
control-plane
!
!
!
line con 0
exec-timeout 0 0
logging synchronous
line aux 0
line vty 0 4
!
!
end

R3:
!
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R3
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
ip cef
!
!
!
!
no ip domain lookup
!
multilink bundle-name authenticated
!
!
interface FastEthernet0/0
ip address 192.168.2.1 255.255.255.0
ip nat inside
ip virtual-reassembly
duplex auto
speed auto
!
interface FastEthernet0/1
ip address 23.1.1.3 255.255.255.0
ip nat outside
ip virtual-reassembly
duplex auto
speed auto
!
ip route 0.0.0.0 0.0.0.0 23.1.1.2
ip route 192.168.3.0 255.255.255.0 192.168.2.2
!
!
no ip http server
no ip http secure-server
ip nat inside source list 1 interface FastEthernet0/1 overload
ip nat inside source static udp 192.168.2.2 4500 interface FastEthernet0/1 4500
ip nat inside source static udp 192.168.2.2 500 interface FastEthernet0/1 500
!
access-list 1 permit any
!
!
control-plane
!
!
!
line con 0
exec-timeout 0 0
logging synchronous
line aux 0
line vty 0 4
!
!
end

R4:
!
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R4
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
ip cef
!
!
no ip domain lookup
!
multilink bundle-name authenticated
!
!
!
!
crypto isakmp policy 1
encr 3des
hash md5
authentication pre-share
group 2
crypto isakmp key cisco address 12.1.1.1
!
!
crypto ipsec transform-set tao esp-3des esp-sha-hmac
!
crypto map cisco 10 ipsec-isakmp
set peer 12.1.1.1
set transform-set tao
match address 100
!
!
!
!
interface FastEthernet0/0
ip address 192.168.2.2 255.255.255.0
duplex auto
speed auto
crypto map cisco
!
interface FastEthernet0/1
ip address 192.168.3.1 255.255.255.0
duplex auto
speed auto
!
ip route 0.0.0.0 0.0.0.0 192.168.2.1
!
!
no ip http server
no ip http secure-server
!
access-list 100 permit ip 192.168.3.0 0.0.0.255 192.168.1.0 0.0.0.255
!
!
control-plane
!
!
!
line con 0
exec-timeout 0 0
logging synchronous
line aux 0
line vty 0 4
!
!
end

拓扑图

拓扑图
发表于 2012-2-8 12:23:40 | 显示全部楼层
只能说我这个菜鸟没看明白
沙发 2012-2-8 12:23:40 回复 收起回复
回复 支持 反对

使用道具 举报

发表于 2012-2-8 13:43:00 | 显示全部楼层
这么长
板凳 2012-2-8 13:43:00 回复 收起回复
回复 支持 反对

使用道具 举报

发表于 2012-2-8 14:03:20 | 显示全部楼层
{:soso_e136:},好多不懂的!!!o(︶︿︶)o 唉
地板 2012-2-8 14:03:20 回复 收起回复
回复 支持 反对

使用道具 举报

发表于 2012-2-8 14:20:54 | 显示全部楼层
R1和R4的加密点不对吧。R1加密点是12.1.1.1指的对端的是23.1.1.2。而在R4对端的加密点是192.168.2.2对端是12.1.1.1.看看是不是这么个问题。
5# 2012-2-8 14:20:54 回复 收起回复
回复 支持 反对

使用道具 举报

 楼主| 发表于 2012-2-8 14:49:54 | 显示全部楼层

要实现NAT穿越,我在R3上做了端口500 和4500映射到R4上了,VPN的功能可以实现的。。主要是R1的内网ping外网有问题,R3的内网PING外网也是正常的
6# 2012-2-8 14:49:54 回复 收起回复
回复 支持 反对

使用道具 举报

发表于 2012-2-8 14:55:13 | 显示全部楼层
taohongyan2010 发表于 2012-2-8 14:49
要实现NAT穿越,我在R3上做了端口500 和4500映射到R4上了,VPN的功能可以实现的。。主要是R1的内网ping外 ...

把配置贴上来看一下。
7# 2012-2-8 14:55:13 回复 收起回复
回复 支持 反对

使用道具 举报

发表于 2012-2-8 14:56:03 | 显示全部楼层
taohongyan2010 发表于 2012-2-8 14:49
要实现NAT穿越,我在R3上做了端口500 和4500映射到R4上了,VPN的功能可以实现的。。主要是R1的内网ping外 ...

SORRY,糊涂了。在研究研究。
8# 2012-2-8 14:56:03 回复 收起回复
回复 支持 反对

使用道具 举报

发表于 2012-2-8 15:08:51 | 显示全部楼层
而且我感觉有很多问题。既然做了NAT就不必再R1上面再写默认路由了。因为已经成功成为12.1.1.1了,这样的话就需要在R2上面写默认路由。要不没有可达路由了。
9# 2012-2-8 15:08:51 回复 收起回复
回复 支持 反对

使用道具 举报

 楼主| 发表于 2012-2-8 16:59:29 | 显示全部楼层
本帖最后由 taohongyan2010 于 2012-2-8 17:03 编辑
拽拽的流氓 发表于 2012-2-8 15:08
而且我感觉有很多问题。既然做了NAT就不必再R1上面再写默认路由了。因为已经成功成为12.1.1.1了,这样的话就 ...

要和对方建立VPN首现是三层路由可达,最起码的在启用VPN之前要R1 和R3公网之间要路由可达,那条默认路由就是解决这个问题的,一般企业出口路由器都是一条默认路由指向ISP。如果我把R1的默认路由去掉,VPN是通不了的。。。在i没启VPN之前R1 R2 R3之间公网IP是相互可达的,R2上不需要再有默认路由,你可以模拟一下。
10# 2012-2-8 16:59:29 回复 收起回复
回复 支持 反对

使用道具 举报

发表于 2012-2-8 19:55:11 | 显示全部楼层
加密点路由可达是对的。今天同做了你这个实验,也是不能成功访问。也不知为何。
但是加密点这个问题我觉得还是在R3上做。
什么时候有个解决方法,通知下,{:soso__11272800316393531148_4:}
11# 2012-2-8 19:55:11 回复 收起回复
回复 支持 反对

使用道具 举报

 楼主| 发表于 2012-2-8 21:35:29 | 显示全部楼层
拽拽的流氓 发表于 2012-2-8 19:55
加密点路由可达是对的。今天同做了你这个实验,也是不能成功访问。也不知为何。
但是加密点这个问题我觉得 ...

其实这个实验是一个工程案例,以前ipsec vpn 和NAT都做在了R3上,使R3CPU负荷很重,现在新加了一台R4的设备,目的是让以前R3上的IPSEC VPN流量割接到R4上,R3上只做NAT,R4来承担IPSEC VPN,但是做出来就出现了这个问题,以前都没发觉到这个问题,最近才发现这个问题。我在研究研究吧,有结果了通知 你
12# 2012-2-8 21:35:29 回复 收起回复
回复 支持 反对

使用道具 举报

发表于 2012-2-8 21:50:00 | 显示全部楼层
taohongyan2010 发表于 2012-2-8 21:35
其实这个实验是一个工程案例,以前ipsec vpn 和NAT都做在了R3上,使R3CPU负荷很重,现在新加了一台R4的设 ...

13# 2012-2-8 21:50:00 回复 收起回复
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 论坛注册

本版积分规则

QQ|Archiver|手机版|小黑屋|sitemap|鸿鹄论坛 ( 京ICP备14027439号 )  

GMT+8, 2025-2-4 23:58 , Processed in 0.065307 second(s), 14 queries , Redis On.  

  Powered by Discuz!

  © 2001-2025 HH010.COM

快速回复 返回顶部 返回列表