CCNA-第4天-HDLC+PPP+FR

HDLC:

HDLC优点:
简单

HDLC缺点:

1.标准的HDLC只能支持(上层)单协议环境
2.HDLC不支持认证,无法保证链路的安全性.





CISCO为了能够支持多协议环境,对HDLC的帧结构进行了修改.(CISCO HDLC)
插入一个私有的协议位,实现对多协议环境的支持,
导致与别的厂商的设备在HDLC协议上不兼容.

在CISCO设备的同步串行链路上,默认采用CISCO HDLC.


查看接口封装类型:
Router#show interfaces serial 0
...
Encapsulation HDLC,

配置接口封装:
R2(config)#int s 0
R2(config-if)#encapsulation hdlc (默认封装方式)





PPP(Point-to-Point Protocol)(业界标准)
为了能与别的厂商的设备兼容,只能采用PPP

PPP的组成:(L2协议)

NCP:对上层(网络层)的多种网络协议提供支持,封装,无差别接口.(IPCP/IPXCP)

LCP:与物理层协商,负责链路的建立,控制,维护.




观察PPP协商的过程:
R1#debug ppp negotiation

R1(config-if)#no shut

Interface Serial1, changed state to up

LCP: State is Open

IPCP: State is Open
CDPCP: State is Open

Line protocol on Interface Serial1, changed state to up


检查:
R1#show int s 1
Serial1 is up, line protocol is up
...
Encapsulation PPP, LCP Open
Open: CDPCP, IPCP,





PAP (Password Authentication Protocol)认证:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
特征:
1:两次握手
No.1:被认证方将账号/密码以明文的方式发送给主认证方
No.2:主认证方返回成功与否的信息

2:在链路上以明文的方式发送账号密码(不够安全)




Step1:确认链路是PPP链路.
R1#show run interface serial 0

Step2:为对方创建一个认证用的账号密码:
R1(config)#username AAA password AAA
R2(config)#username BBB password BBB

Step3:在接口中,选择PAP认证:
R1/2(config-if)#ppp authentication pap

Step4:将对方为我方创建好的账号密码信息,发送给对方进行验证:
R1(config-if)#ppp pap sent-username BBB password BBB
R2(config-if)#ppp pap sent-username AAA password AAA

Step5:观察认证过程:
R1#debug ppp authentication



CHAP(Challenge Handshake Authentication Protocol)认证:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
特征:
1:三次握手
NO.1:主认证方,发送随机数(X=4)给被认证方,

NO.2:被认证方,根据对方的帐号,查询自己的数据库,调出相应的密码=7,
将密码和随机数一起放入MD5加密器中加密,将得到的结果Y=33,
以回应的形式,返回给主认证方.

(MD5加密运算,不可逆)

NO.3:主认证方进行,与被认证方在NO.2中相同操作,得到结果Y'
主认证方把Y和Y'两结果进行对比,
如果相同则认证成功,不相同则认证失败.

2:从不在链路上发送密码, 只是Hash Value(随机数,不可逆),可以保证安全

CHAP默认以路由

器的主机名做帐号


R2 ser1/0 ----------- ser1/0 R1 ser1/1 ----------- ser1/1 R3

Step0:路由器接口下封装PPP
R1/2/3(config-if)#encapsulation ppp

============================
CHAP双向认证

Step1:为对方创建用户名和密码:(双方密码要一致)
R1(config)#username R2 password CCIE
R2(config)#username R1 password CCIE

Step2:在双方路由器接口下选择CHAP:
R1/2(config-if)#ppp authentication chap

============================
CHAP单向认证

Step1:全局模式下为对方创建用户名和密码:
R1(config)#username R3 password CCNP

Step2:在认证路由器接口下选择CHAP:
R1(config-if)#ppp authentication chap

Step3:在被认证的路由器接口下配置用户名和密码
R3(config-if)#ppp chap hostname R3
R3(config-if)#ppp chap password CCNP






Frame Relay:
1.FR是一个纯Layer2的协议
2.FR是ISP提供的面向连接的服务,通过VC实现
VC(virtual circuits)
3.VC虚链路:PVC 永久虚链路
SVC 交换虚链路
4.在一个物理链路上,可承载多条VC
5.DLCI (Data Link Connection Identifier) 号,用于标识PVC的标号(PVC号) 取值范围:16~1007
只有本地意义:在一条PVC的两端,DLCI号可以相同
在同一个物理接口中的多条PVC的DLCI号不能相同

本地的DLCI是为让我找到别人的,而不是让别人找到我的。
所以本地的DLCI跟别的DLCI可以一样,但是本地的多个DLCI不能一样。



6.PVC signaling
FR的信令标准(LMI类型/本地管理接口)
6-1.cisco
6-2.ANSI 美国国家标准学会(American National Standards Institute: ANSI)
6-3.Q933a
在IOS 12.0以后的IOS中,都可以自动检测到FR-SW所采用的LMI标准

7.FR address Mapping
FR的Layer 2地址(DLCI号)与Layer 3地址(IP地址)的映射关系
Layer 3(IP)对方的IP 与 本端的 Layer 2(DLCI)的映射

8.FR Inverse ARP //FR的反向ARP
在FR网络中,通过Layer 2本地DLCI,查询Layer 3对方的IP地址
从而形成地址映射的过程






ARP 已知对方IP,求对方的MAC
RARP 已知自己的MAC,求自己的IP
Inverse ARP 已知自己的DLCI(给对方使用的DLCI号码),求对方IP









LAB:模拟电信运营上的4个端口FR-SW
step1:
Router(config)#ho FR-SW
FR-SW(config)#no ip routing //关闭路由功能
FR-SW(config)#frame-relay switching //开启FR交换能力



step2:
FR-SW(config)#int s0/1 s0/2 s0/3 s0/0
FR-SW(config-if)#encapsulation frame-relay
FR-SW(config-if)#frame-relay intf-type dce
FR-SW(config-if)#clock rate 64000
FR-SW(config-if)#frame-relay lmi-type cisco





step3:配置FR路由
FR-SW(config)#int s0/X
FR-SW(config-if)#frame-relay route XXX interface serial 0/X XXX
入接口DLCI号 出接口 出接口的DLCI号

interface Serial0/0
frame-relay route 401 interface Serial0/1 104

frame-relay route 402 interface Serial0/2 204
frame-relay route 403 interface Serial0/3 304
!
interface Serial0/1
frame-relay route 102 interface Serial0/2 201
frame-relay route 103 interface Serial0/3 301
frame-relay route 104 interface Serial0/0 401
!
interface Serial0/2
frame-relay route 201 interface Serial0/1 102
frame-relay route 203 interface Serial0/3 302
frame-relay route 204 interface Serial0/0 402
!
interface Serial0/3
frame-relay route 301 interface Serial0/1 103
frame-relay route 302 interface Serial0/2 203
frame-relay route 304 interface Serial0/0 403


show frame route



FR客户端配置
R1/2/3/4
interface Serial 0/0
encapsulation frame-relay
no shutdown



show int serial 0/0
show frame-relay pvc
show frame-relay map


动态的DLCI映射是支持模拟广播的
通过Inverse-ARP动态映射的



手动映射

R1/2/3/4(config-if)#no frame-relay inverse-arp //关闭FR的反向ARP
R1/2/3/4#clear frame-relay inarp //清除反向ARP留下的cache

R1(config)#int s0/0
R1(config-if)#frame-relay map ip 100.1.1.X 10X broadcast
对方IP 本地DLCI 模拟广播






LAB-3:配置FR的点到点子接口
step1:主接口封装FR
R1(config)#int s0/0
R1(config-if)#encapsulation frame-relay
R1(config-if)#no frame-relay inverse-arp
R1(config-if)#no shutdown
======================================
step2:建立点到点子接口
R1(config)#int s0/0.12 point-to-point
R1(config-subif)#no frame-relay inverse-arp
R1(config-subif)#frame-relay interface-dlci 102
R1(config-subif)#ip add 100.1.1.1 255.255.255.0

R2(config)#int s0/0
R2(config-subif)#no frame-relay inverse-arp
R2(config-subif)#frame-relay map ip 100.1.1.1 201 broadcast
R2(config-subif)#ip add 100.1.1.2 255.255.255.0
======================================
step2:配置FR的多点子接口
R1(config)#int s0/0.134 multipoint
R1(config-subif)#no frame-relay inverse-arp
R1(config-subif)#frame-relay map ip 200.1.1.3 103 broadcast
R1(config-subif)#frame-relay map ip 200.1.1.4 104 broadcast
R1(config-subif)#ip add 200.1.1.1 255.255.255.0

R3(config)#int s0/0
R3(config-subif)#no frame-relay inverse-arp
R3(config-subif)#frame-relay map ip 200.1.1.1 301 broadcast
R3(config-subif)#ip add 200.1.1.3 255.255.255.0

R4(config)#int s0/0
R4(config-subif)#no frame-relay inverse-arp
R4(config-subif)#frame-relay map ip 200.1.1.1 401 broadcast
R4(config-subif)#ip add 200.1.1.4 255.255.255.0




Frame-relay 的3种接口

Frame-relay 主接口
Frame-relay MA子接口

MA:(当接口下存在一条或多条VC时)
Router(config-if)#frame-relay map ip /对方IP address/ /本地DLCI/
Router(config-subif)#frame-relay map ip /对方IP address/ /本地DLCI/


Frame-relay PTP子接口

PTP:(当接口下只有一条VC时)
Router(config-subif)#frame-relay interface-dlci /本地DLCI/






NAT
LAB-1:NAT的基本配置


step1:定义NAT的内口/外口

R1(config)#int e0
R1(config-if)#ip nat inside //将e0口定义为NAT的内网口

R1(config)#int s1
R1(config-if)#ip nat outside //将s1口定义为NAT的外网口


step2:配置一个静态的(IP对IP)NAT转换
R1(config)#ip nat inside source static 192.168.1.2 13.0.0.1

inside local inside globle

R1#show ip nat translations

Pro Inside global Inside local Outside local Outside global
--- 13.0.0.1 192.168.1.2 --- ---

R1#debug ip nat









LAB-2:配置动态NAT

step1:定义NAT的内口/外口

R1(config)#int e0
R1(config-if)#ip nat inside //将e0口定义为NAT的内网口

R1(config)#int s1
R1(config-if)#ip nat outside //将s1口定义为NAT的外网口


step2:用ACL定义需要做NAT的用户群
R1(config)#access-list 1 permit 192.168.1.0 0.0.0.255


step3:配置一个基于公网接口serial 1的NAT端口复用

R1(config)#ip nat inside source list 1 interface serial 1 overload
内网用户 NAT的出接口 端口复用


show ip nat tran
deb ip nat

show ip nat translations


LAB-3:配置一个基于地址池的NAT

step0:在网关上为内部用户配置辅助地址
R1(config)#inter e0
R1(config-if)#ip add 192.168.1.1 255.255.255.0
R1(config-if)#ip add 192.168.2.1 255.255.255.0 secondary //配置辅助地址

step1:定义内/外口

step2:定义用户群
R1(config)#access-list 1 permit 192.168.1.0 0.0.0.255
R1(config)#access-list 2 permit 192.168.2.0 0.0.0.255


step3:从ISP处购买来的公网IP,分别放入为不同子网准备的地址池中
R1(config)#ip nat pool POOL_1 13.0.0.8 13.0.0.11 prefix-length 24
地址池的名字 起始IP地址 结束IP地址

R1(config)#ip nat pool POOL_2 13.0.0.12 13.0.0.15 netmask 255.255.255.0


step4:为不同的子网,进行基于不同NAT-Pool的转换
R1(config)#ip nat inside source list 1 pool POOL_1 overload
R1(config)#ip nat inside source list 2 pool POOL_2 overload

测试



LAB-4基于端口号的NAT转换 PAT
R1(config)#ip nat inside source static tcp 192.168.1.2 23 13.0.0.1 8000
R1(config)#ip nat inside source static tcp 192.168.2.4 23 13.0.0.1 9000

相关主题
相关文档
最新文档