Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1461642
  • 博文数量: 167
  • 博客积分: 2108
  • 博客等级: 上尉
  • 技术积分: 3287
  • 用 户 组: 普通用户
  • 注册时间: 2009-02-03 10:37
个人简介

10多年思科技术培训师。独特的以技术为载体,引导和建立思维、学习方法的授课技巧;丰富的大型企业定制培训经验;数年网络方案设计;专注技术架构;开思科技术书籍本地化先河;荣获2010和2012年读者最喜爱的作者奖;携手白宫通信局服务2011年美副总统拜登访华;全国高等职业技能大赛命题专家;

文章分类
文章存档

2017年(1)

2016年(2)

2015年(5)

2014年(15)

2013年(9)

2012年(24)

2011年(43)

2010年(35)

2009年(33)

分类: 系统运维

2011-11-19 17:27:33

部分拓扑是这样的:R2与R3通过以太口互连,在R3上启用NAT。R2的接口地址是192.168.1.1/24,R3的接口地址是192.168.1.2/24,该接口是NAT的outside接口。R3的相关配置内容如下:
interface Loopback0
 ip address 172.16.4.1 255.255.255.0
!
interface Loopback1
 ip address 172.16.5.1 255.255.255.0
!
interface FastEthernet0/0
 ip address 172.16.3.1 255.255.255.0
 ip nat inside
 ip virtual-reassembly
 duplex auto
 speed auto
!
interface FastEthernet0/1
 ip address 192.168.1.2 255.255.255.0
 ip nat outside
 ip virtual-reassembly
 duplex auto
 speed auto
!
router eigrp 100
 network 172.16.3.0 0.0.0.255
 network 172.16.4.0 0.0.0.255
 network 172.16.5.0 0.0.0.255
 network 192.168.1.0
 no auto-summary
!
router ospf 5
 router-id 3.3.3.3
 log-adjacency-changes
 network 172.16.0.0 0.0.255.255 area 0
 network 192.168.1.0 0.0.0.255 area 0
!
router rip
 version 2
 network 172.16.0.0
 no auto-summary
!
ip nat pool teet 20.20.20.1 20.20.20.1 prefix-length 24
ip nat inside source list 1 pool teet overload
!
access-list 1 permit 192.168.1.0 0.0.0.255
!
之后,eigrp 和ospf的邻居关系都失去了。使用debug看,显示出一下信息:
*Sep  6 09:26:08.957: NAT: translation failed (A), dropping packet s=192.168.1.2 d=192.168.1.1
*Sep  6 09:26:10.153: NAT: translation failed (A), dropping packet s=192.168.1.2 d=224.0.0.10
*Sep  6 09:26:13.957: NAT: translation failed (A), dropping packet s=192.168.1.2 d=192.168.1.1
*Sep  6 09:26:14.633: NAT: translation failed (A), dropping packet s=192.168.1.2 d=224.0.0.10
*Sep  6 09:26:15.269: NAT: translation failed (A), dropping packet s=192.168.1.2 d=224.0.0.5
以上信息重复出现。
说明路由器自己outside接口发出的数据在地址翻译时失败,因而被丢弃。
那么修改ACL,
R3(config)#no access-list 1
R3(config)#access-list 1 deny host 192.168.1.2
R3(config)#access-list 1 deny host 192.168.1.0 0.0.0.255
察看访问列表:
R3#sh access-lists 
Standard IP access list 1
    10 deny   192.168.1.2 (23 matches)
    20 permit 192.168.1.0, wildcard bits 0.0.0.255
这样修改之后,就正常建立邻居,交换路由信息了。
R3#SH IP ROUTE 

     172.16.0.0/16 is variably subnetted, 6 subnets, 2 masks
C       172.16.4.0/24 is directly connected, Loopback0
C       172.16.5.0/24 is directly connected, Loopback1
R       172.16.0.0/29 [120/1] via 172.16.3.2, 00:00:06, FastEthernet0/0
D       172.16.1.0/24 [90/156160] via 192.168.1.1, 00:02:33, FastEthernet0/1
D       172.16.2.0/24 [90/30720] via 192.168.1.1, 00:02:33, FastEthernet0/1
C       172.16.3.0/24 is directly connected, FastEthernet0/0
C    192.168.1.0/24 is directly connected, FastEthernet0/1
R3#

笔者认为:outside接口发出的数据,本来就不应该翻译。因为地址翻译执行的前提是数据必须经由outside和inside接口,只经由一个接口不应该翻译。

阅读(2154) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~