路由技术 交换技术
   无线技术 综合技术 解决方案
   网络管理 网络协议 网络设备
   考试认证 juniper专题
3G纵览 数据通信
   光通信 智能网 WIMAX VOIP
   IPTV NGN
安全产品 病毒防治
    防火墙 安全方案 IDS/IPS    DOS/DDOS
存储技术 存储设备
   存储方案 服务器专区

Google
 
作者: 发布时间:2007-09-29 11:23:30 来源:ciscohuawei.com
 

环境:两台路由器,由串口相联。

要求:如下图所示,设置 R1 以太口的 secondary 地址为 10.1.1.2-10.1.1.4, 将 10.1.1.2 和 10.1.1.3 这两个辅助地址做动态 NAT 转换 , 地址池范围 :80.1.1.2-80.1.1.9 ;将辅助地址 10.1.1.4 静态转换成 80.1.1.10 ,将以太口的主 IP 地址作 PAT 转换。

3214b32b0397896eb7812f637bdb5473.jpg

步骤一、基本配置

R1 的配置:

R1(config)#interface e0

R1(config-if)#ip address 10.1.1.1 255.255.255.0

R1(config-if)# ip address 10.1.1.2 255.255.255.0 secondary à 设置辅助 IP

R1(config-if)# ip address 10.1.1.3 255.255.255.0 secondary

R1(config-if)# ip address 10.1.1.4 255.255.255.0 secondary

R1(config-if)# no keepalive à 关闭检测

R1(config-if)#no shutdown

R1(config-if)#interface s0

R1(config-if)#ip address 30.1.1.1 255.255.255.0

R1(config-if)#clock rate 64000

R1(config-if)#no shutdown

R2 的配置:

R2(config)#interface loopback 0

R2(config-if)#ip address 20.1.1.1 255.255.255.0

R2(config-if)#interface s1

R2(config-if)#ip address 30.1.1.2 255.255.255.0

R2(config-if)#no shutdown 配置路由:

R2(config)# ip route 80.1.1.0 255.255.255.240 serial 1

R1(config)# ip route 0.0.0.0 0.0.0.0 serial 0

步骤二、 NAT 与 PAT 的创建

NAT 的配置 :

R1(config)# access-list 10 permit host 10.1.1.2 à 定义转换列表

R1(config)# access-list 10 permit host 10.1.1.3

R1(config)# ip nat pool ippool 80.1.1.2 80.1.1.9 prefix-length 28 à 定义地址池

R1(config)# ip nat inside source list 10 pool ippool à 将池和列表关联

PAT 的配置:

R1(config)# access-list 11 permit host 10.1.1.1 à PAT 转换列表

R1(config)# ip nat inside source list 11 interface serial 0 overload à 与接口映射

静态 NAT 的配置:

R1(config)# ip nat inside source static 10.1.1.4 80.1.1.10

R1(config)#interface e0

R1(config-if)# ip nat inside à 加载到接口

R1(config-if)#interface s0

R1(config-if)# ip nat outside à 加载到接口

步骤三、测试

R1# ping

Protocol [ip]:

Target IP address :20.1.1.1

Extended commands [n] : y

Source address or interface: 10.1.1.1

!!!!!

R1# ping

Protocol [ip]:

Target IP address: 20.1.1.1

Extended commands [n]: y

Source address or interface: 10.1.1.2

!!!!!

R1# ping

Protocol [ip]:

Target IP address: 20.1.1.1

Extended commands [n] : y

Source address or interface: 10.1.1.3

!!!!!

R1# show ip nat translation à 查看转换列表

Pro Inside global Inside local Outside local Outside global

--- 80.1.1.10 10.1.1.4 --- ---

--- 80.1.1.2 10.1.1.2 --- ---

-- - 80.1.1.3 10.1.1.3 --- ---

icmp 30.1.1.1:2832 10.1.1.1:2832 20.1.1.1:2832 20.1.1.1:2832

icmp 30.1.1.1:2833 10.1.1.1:2833 20.1.1.1:2833 20.1.1.1:2833

icmp 30.1.1.1:2834 10.1.1.1:2834 20.1.1.1:2834 20.1.1.1:2834

icmp 30.1.1.1:2835 10.1.1.1:2835 20.1.1.1:2835 20.1.1.1:2835

icmp 30.1.1.1:2836 10.1.1.1:2836 20.1.1.1:2836 20.1.1.1:2836

步骤四、显示当前配置

R1 的当前配置:

R1#show running-config

hostname R1

!

no ip domain-lookup

!

interface Ethernet0

ip address 10.1.1.2 255.255.255.0 secondary

ip address 10.1.1.3 255.255.255.0 secondary

ip address 10.1.1.4 255.255.255.0 secondary

ip address 10.1.1.1 255.255.255.0

ip nat inside

no keepalive

!

interface Serial0

ip address 30.1.1.1 255.255.255.0

ip nat outside

clockrate 64000

!

ip nat pool ippool 80.1.1.2 80.1.1.9 prefix-length 28

ip nat inside source list 10 pool ippool

ip nat inside source list 11 interface Serial0 overload

ip nat inside source static 10.1.1.4 80.1.1.10

ip route 0.0.0.0 0.0.0.0 Serial0

!

access-list 10 permit 10.1.1.2

access-list 10 permit 10.1.1.3

access-list 11 permit 10.1.1.1

!

line con 0

exec-timeout 0 0

logging synchronous

end

R2 的当前配置:

r2#show running-config

hostname r2

no ip domain-lookup

!

interface Loopback0

ip address 20.1.1.1 255.255.255.0

!

interface Serial1

ip address 30.1.1.2 255.255.255.0

!

ip route 80.1.1.0 255.255.255.240 Serial1

line con 0

exec-timeout 0 0

logging synchronous

end

※ 相关信息
无相关信息
 

  最新文章

·CCNA认证英文词汇中文解析
·CCNA640-802考试大纲
·CCNA管理手册:路由基础知
·CCNA——我的学习和考试感
·ccna实验—配置ISDN DDR
·ccna实验—背对背帧中继
·ccna实验—帧中继链路上运
·ccna实验—静态、动态NAT
·ccna实验—访问列表与tel
·ccna实验—RIPv1与EIGRP在
 

  热门文章

·CCNA最新考题 12.17
·Cisco常用单词(3)
·ccna实验—静态、动态NAT
·Cisco常用单词(2)
·ccna实验—配置STP与VTP
·CCNA学习:OSPF从入门到精
·CCNA常用学习书籍
·ccna实验—访问列表与tel
·ccna实验—帧中继链路上运
·ccna实验—RIP路由协议
 
 

 

Copyright ? 2006 All rights reserved