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

[求助] 为什么在R3上做了NAT端口过载,R1,R2无法ping外网

[复制链接]
发表于 2016-8-15 22:08:05 | 显示全部楼层 |阅读模式
3鸿鹄币
首先上拓扑,用GNS3弄得。 拓扑.png
R1,R2,R3的fa1/0为内网口,S0/0为外网口。
路由用OSPF。
现在的问题是,在R3上做了NAT的端口过载,允许192.168.0.0 0.0.255.255 的地址复用端口S0/0,但是现在的问题是无法从内网ping外网,既R4。
其实这些实验很久以前,1年多前,做过好几遍了,现在回顾一下发现做不来,我隐约感觉到问题出在了路由层面,因为模拟因特网的R4路由器以及R3的外网口并没加入ospf,没有向ospf域内传递路由条目。我如果在内网中ping外网,无法ping通。。。。请各位帮忙解答一下。不胜感激。

每一台路由器的run-config如下(一些没用的感叹号删了):
R1:
Router#show running-config
Building configuration...

Current configuration : 621 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname Router
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
!
!
ip cef


interface FastEthernet0/0
ip address 192.168.12.1 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet1/0
no ip address
shutdown
duplex auto
speed auto
!
router ospf 1
log-adjacency-changes
network 192.168.0.0 0.0.255.255 area 0
!
no ip http server
!
control-plane
!
        
line con 0
line aux 0
line vty 0 4
!
!
end


R2
Router#show running-config
Building configuration...


Current configuration : 669 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname Router
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
!
!
ip cef
!

interface FastEthernet0/0
ip address 192.168.12.2 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet1/0
ip address 192.168.23.2 255.255.255.0
duplex auto
speed auto
!
router ospf 1
log-adjacency-changes
network 192.168.12.2 0.0.0.0 area 0
network 192.168.23.2 0.0.0.0 area 1
!
no ip http server
!

control-plane
!   
line con 0
line aux 0
line vty 0 4
!
!
end



R3
Router#show running-config
Building configuration...

Current configuration : 1108 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname Router
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
!
!
ip cef
!


interface Serial0/0
ip address 202.100.10.1 255.255.255.0
ip nat outside
ip virtual-reassembly
serial restart-delay 0
!
interface Serial0/1
no ip address
shutdown
serial restart-delay 0
!
interface Serial0/2
no ip address
shutdown
serial restart-delay 0
!
interface Serial0/3
no ip address
shutdown
serial restart-delay 0
!
interface FastEthernet1/0
ip address 192.168.23.3 255.255.255.0
ip nat inside
ip virtual-reassembly
duplex auto
speed auto
!
router ospf 1
log-adjacency-changes
network 192.168.0.0 0.0.255.255 area 1
!         
no ip http server
!
ip route 0.0.0.0 0.0.0.0 202.100.10.2
!
ip nat source list 1 interface Serial0/0 overload
ip nat inside source list 1 interface Serial0/0 overload
!
access-list 1 permit 192.168.0.0 0.0.255.255
!

control-plane
!

line con 0
line aux 0
line vty 0 4
!
!
end

R4
Router#show running-config
Building configuration...

Current configuration : 670 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname Router
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
!
!
ip cef
!

interface Serial0/0
ip address 202.100.10.2 255.255.255.0
serial restart-delay 0
!
interface Serial0/1
no ip address
shutdown
serial restart-delay 0
!         
interface Serial0/2
no ip address
shutdown
serial restart-delay 0
!
interface Serial0/3
no ip address
shutdown
serial restart-delay 0
!
no ip http server
!

control-plane
!

!
line con 0
line aux 0
line vty 0 4
!
!
end


最佳答案

查看完整内容

R1和R2没有默认路由,肯定没有办法到R4,你R3上写了条默认路由,可以用ospf下发默认路由的命令 default imformation origin ,这样就搞定了
发表于 2016-8-15 22:08:06 | 显示全部楼层
R1和R2没有默认路由,肯定没有办法到R4,你R3上写了条默认路由,可以用ospf下发默认路由的命令 default   imformation origin ,这样就搞定了
沙发 2016-8-15 22:08:06 回复 收起回复
回复

使用道具 举报

 楼主| 发表于 2016-8-16 08:19:46 | 显示全部楼层
没人吗?please help.
板凳 2016-8-16 08:19:46 回复 收起回复
回复

使用道具 举报

 楼主| 发表于 2016-8-16 11:03:44 | 显示全部楼层
请叫我银桑 发表于 2016-8-16 09:35
R1和R2没有默认路由,肯定没有办法到R4,你R3上写了条默认路由,可以用ospf下发默认路由的命令 default   i ...

谢谢了大兄弟,回头试试。
地板 2016-8-16 11:03:44 回复 收起回复
回复

使用道具 举报

 楼主| 发表于 2016-8-16 20:52:28 | 显示全部楼层
请叫我银桑 发表于 2016-8-16 09:35
R1和R2没有默认路由,肯定没有办法到R4,你R3上写了条默认路由,可以用ospf下发默认路由的命令 default   i ...

默认路由都发布了,其他的路由器上都可以看到一条默认路由,还是不行。。。。
是不是我在R3上做得NAT出问题了?我的配置是
access-list 1 permit 10.0.0.0 0.255.255.255 (只允许我在R1上开的Loback 进行映射)
ip nat inside source list 1 interface serial 1/0 overload
怎么还是不行???
诶哟我擦,我忘了在内网口用ip nat inside,没有在外网口用ip nat outsi了。。

刚放了这两个命令,可以了。。
谢谢了大兄弟。
--
看样子,就算是NAT出去,也还是得有路由条目去进行转发数据包啊,以前做得时候没有考虑到这些。
谢谢了大兄弟。
5# 2016-8-16 20:52:28 回复 收起回复
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-2-8 05:51 , Processed in 0.083427 second(s), 13 queries , Redis On.  

  Powered by Discuz!

  © 2001-2025 HH010.COM

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