雏鹰部落

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 4447|回复: 10

[讨论/求助] 做的pat不通

  [复制链接]
发表于 2012-2-20 10:07:03 | 显示全部楼层 |阅读模式

请大家帮我看看上面的拓扑图:已经做了静态路由在R3上可以ping通R1的loopback address(1.1.1.1)也可以ping通R4的loopback address(4.4.4.4),但R1ping不通R4,想做nat让他们相同,,可以无论我做动态nat还是pat都不同,,下面是R3的配置:
                                                                              interface Loopback0
ip address 3.3.3.3 255.255.255.0
no ip directed-broadcast
!         
interface Ethernet0/0
no ip address
no ip directed-broadcast
shutdown
!         
interface Serial0/0
ip address 192.168.2.2 255.255.255.0
no ip directed-broadcast
ip nat inside
clockrate 64000
!         
interface Serial0/1
ip address 192.168.1.2 255.255.255.0
no ip directed-broadcast
ip nat inside
ignore-dcd
clockrate 64000
!         
interface Serial0/2
no ip address
no ip directed-broadcast
shutdown
!         
interface Serial0/3
ip address 192.168.3.1 255.255.255.0
no ip directed-broadcast
ip nat outside
clockrate 64000
!         
ip nat pool pule 192.168.4.1 192.168.4.2 netmask 255.255.255.0
ip nat inside source list 1 pool pule
ip classless
ip route 1.1.1.0 255.255.255.0 192.168.1.1
ip route 2.2.2.0 255.255.255.0 192.168.2.1
ip route 4.4.4.0 255.255.255.0 192.168.3.2
no ip http server
!         
!         
line con 0
exec-timeout 0 0
logging synchronous
transport input none
line aux 0
line vty 0 4
!         
no scheduler allocate
end



请各位师兄师姐能帮忙看看,,,谢谢  有愿意远程帮助更谢谢啊,,

本帖子中包含更多资源

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

x
发表于 2012-2-20 10:20:57 | 显示全部楼层
本帖最后由 紫川凌 于 2012-2-20 10:23 编辑

是你路由的问题  你做了NAT 之后地址是会转成192.168.4.1 192.168.4.2。你做NAT的这台路由器需要知道去往R4的路由,建议加一条默认路由.而且你做了NAT之后,R4还需要有 去往192.168.4.1 192.168.4.2 的路由。 还有,这个叫动态NAT ,PAT是端口复用。
发表于 2012-2-20 10:25:08 | 显示全部楼层
还有你的访问控制列表也没有写
发表于 2012-2-20 10:26:37 | 显示全部楼层
楼上正解:)
 楼主| 发表于 2012-2-20 10:28:32 | 显示全部楼层
hostname r3
!
!
!
!
!
!
ip subnet-zero
!
partition flash 2 8 8
!
!
!
!
interface Loopback0
ip address 3.3.3.3 255.255.255.0
no ip directed-broadcast
--More--
13:17:04: %SYS-5-CONFIG_I: Configured from console by console
!         
interface Ethernet0/0
no ip address
no ip directed-broadcast
shutdown
!         
interface Serial0/0
ip address 192.168.2.2 255.255.255.0
no ip directed-broadcast
ip nat inside
clockrate 64000
!         
interface Serial0/1
ip address 192.168.1.2 255.255.255.0
no ip directed-broadcast
ip nat inside
ignore-dcd
clockrate 64000
!         
interface Serial0/2
no ip address
no ip directed-broadcast
shutdown
!         
interface Serial0/3
ip address 192.168.3.1 255.255.255.0
no ip directed-broadcast
ip nat outside
clockrate 64000
!         
ip nat pool pule 192.168.4.1 192.168.4.2 netmask 255.255.255.0
ip nat inside source list 1 pool pule
ip classless
ip route 1.1.1.0 255.255.255.0 192.168.1.1
ip route 2.2.2.0 255.255.255.0 192.168.2.1
ip route 4.4.4.0 255.255.255.0 192.168.3.2
no ip http server
!         
access-list 1 permit 192.168.1.0 0.0.0.255
!         
line con 0
exec-timeout 0 0
logging synchronous
transport input none
line aux 0
line vty 0 4
acl是写了
发表于 2012-2-20 11:11:21 | 显示全部楼层
R4增加 去往 192.168.4.0网络的路由 到R3
 楼主| 发表于 2012-2-20 11:20:33 | 显示全部楼层
tea 发表于 2012-2-20 11:11
R4增加 去往 192.168.4.0网络的路由 到R3

感谢各位的回复,,问题已解决,我原来是在R1的路由是3.3.3.0 255.255.255.0 192.168.1.2替换成默认路由0.0.0.0 0.0.0.0 192.168.1.2就行了相同把R2的路由也替换成默认路由就可以了
发表于 2012-2-20 11:41:04 | 显示全部楼层
本帖最后由 ufd_苜 于 2012-2-20 11:42 编辑

若要使得R1 R2 R3 R4的loo0都能通信
那么在
R1上要加入去往2.2.2.2 3.3.3.3 4.4.4.4的路由
同理R2和R3和R4上也要加入
另外,把ip route 3.3.3.0 255.255.255.0 192.168.1.2  替换成默认路由指向192.168.1.2并不是推荐的做法
把R1、R2、R3去往4.4.4.4的路由替换成默认路由
因为实际工程中 R4是外网,设定成默认路由是正确的
在R4上 要设定去往192.168.4.0的静态路由到R3

静态路由:在路由器较少的情况,或者是网络中一些网段需要特殊的转发路径和特殊处理的地方使用。去往内网的地址,最好设定成目标网络地址明确的静态路由。动态NAT:具有一个NAT地址池,在地址池中动态的使用IP地址做内外网地址映射
PAT:利用“IP+端口号”形成唯一映射关系的技术,复用外网出口的端口
所以楼主伙伴本例中,应该是动态NAT
 楼主| 发表于 2012-2-20 13:55:57 | 显示全部楼层
ufd_苜 发表于 2012-2-20 11:41
若要使得R1 R2 R3 R4的loo0都能通信
那么在
R1上要加入去往2.2.2.2 3.3.3.3 4.4.4.4的路由

只能在R1和R2上加入默认路由,不能在R4上设置默认路由,,如果R1设置不是默认路由而R4设置的是默认路由还是不同
发表于 2012-4-2 03:55:38 | 显示全部楼层
支持你加分
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|熊猫同学技术论坛|小黑屋| 网络工程师论坛 ( 沪ICP备09076391 )

GMT+8, 2024-5-22 10:25 , Processed in 0.085259 second(s), 20 queries , Gzip On.

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