Skip to content

Commit dcd61cc

Browse files
committed
Started 'src/d37/MPLS.md'.
1 parent 7c8c1b3 commit dcd61cc

5 files changed

Lines changed: 385 additions & 358 deletions

File tree

src/SUMMARY.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,8 @@
295295
- [WAN 的组件](d37/components.md)
296296
- [WAN 的协议](d37/protocols.md)
297297
- [WAN 业务](d37/services.md)
298+
- [VPN 技术](d37/VPN.md)
299+
- [MPLS](d37/MPLS.md)
298300

299301

300302

src/d37/MPLS.md

Lines changed: 322 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,322 @@
1+
# MPLS
2+
3+
4+
多协议标签交换,是通过将一个标签追加到任意类型的数据包上,而运作的(Multiprotocol Label Switching(MPLS) functions by appending a label to any type of packet)。随后数据包就根据该标签的值,而非任何`Layer 3`信息,经由网络设施得以转发。给数据包打上标签,提供了非常高效的转发,且令到 MPLS 可工作在极大范围的现有技术上。通过简单地将一个标签添加到数据包头部中, MPLS 就可在许多物理与数据链路层的广域网实现中使用(The labeling of the packet provides very efficient forwarding and allows MPLS to work with a wide range of undelying technologies. By simply adding a label in the packet header, MPLS can be used in many Physical and Data Link Layer WAN implementations)。
5+
6+
MPLS的标签,是放在`Layer 2`头部与`Layer 3`头部之间的。使用 MPLS 技术,仅在数据包进入服务提供商云时,才会加入额外开销。在进入 MPLS 网络后,相比传统的`Layer 3`网络,数据包交换的完成要快得多,因为 MPLS 的包交换只是基于 MPLS 标签的交换,而不是要拆封整个的`Layer 3`头部(By using MPLS, overhead is added only when the packet enters the service provider cloud. After entering the MPLS network, packet switching is done much faster than in traditional Layer 3 networks because it is based only on swapping the MPLS label, instead of stripping the entire Layer 3 header)。
7+
8+
MPLS有两种不同样式(MPLS comes in two different flavours):
9+
10+
- 帧模式的 MPLS (Frame Mode MPLS)
11+
- (数据)单元模式的 MPLS (Cell Mode MPLS)
12+
13+
帧模式的 MPLS 是最为流行的 MPLS 类型,而在此场景中,标签是放在`Layer 2`头部与`Layer 3`头部之间的(因此 MPLS 通常被视为一种`Layer 2.5`的技术)。单元模式的 MPLS 用在`ATM`网络中,并使用`ATM`头部中的一些字段,作为标签。
14+
15+
兼容 MPLS 的路由器(MPLS-capable routers),也被叫做标签交换路由器(Label Switched Routers, LSRs),同时这些路由器也有两种样式:
16+
17+
- 边沿标签交换路由器(服务提供商边沿路由器,Edge LSR(PE<Provider Edge> routers))
18+
- 服务提供商标签交换路由器(P(Provider) LSR)
19+
20+
`PE routers`(服务提供商边沿路由器),是那些关注标签分布的服务提供商边沿设备(`PE routers` are Provider Edge devices that take care of label distribution);它们根据标签对数据包进行转发,并负责标签的插入与移除。`P routers`就是服务提供商路由器,它们的职责包括 _标签式转发_,以及基于标签的高效率包转发(`P routers` are Provider routers and their responsibility consists of _label forwarding_ and efficient packet forwarding based labels)。
21+
22+
> ****:请参考[这里](http://blog.51cto.com/sirstma/1860720)
23+
24+
## 基本的串行线路配置(Basic Serial Line Configuration)
25+
26+
在不打算改变默认的`HDLC`(High-level Data Link Control,高级数据链路控制,思科专有)封装时,那么为建立 WAN 连接,仅需完成下面的步骤:
27+
28+
1. 给接口添加一个 IP 地址
29+
2. 开启接口(以`no shutdown`命令)
30+
3. 确保在数据通信设备侧有一个时钟速率(Ensure there is a clock rate on the DCE side)
31+
32+
在连接了数据通信设备电缆时的配置如下:
33+
34+
```console
35+
Router#config t
36+
Router(config)#interface Serial0
37+
Router(config-if)#ip address 192.168.1.1 255.255.255.0
38+
Router(config-if)#clock rate 64000
39+
Router(config-if)#no shutdown
40+
Router(config-if)#^Z
41+
Router#
42+
```
43+
44+
## 以太网上的点对点协议(Point-to-Point over Ethernet, PPPoE)
45+
46+
以太网上的点对点协议,是一个用于在以太网帧内部,封装点对点协议帧的网络协议(Point-to-Point Protocol over Ethernet(PPPoE) is a network protocol used to encapsulate PPP frames inside Ethernet frames)。
47+
48+
要实现客户部署非对称数字订户线路,他们就必须支持在极大安装基数的老旧桥接的客户处设备上的点对点样式的认证与授权。`PPPoE`技术提供了将主机网络经由简单的桥接访问设备,连接到远端访问集中器,或聚合集中器的能力(As customers deploy ADSL, they must support PPP-style authentication and authorisation over a large installed base of legacy bridging customer premises equipment(CPE). PPPoE provides the ability to connect a network of hosts over a simple bridging access device to a remote access concentrator or aggregation concentrator)。在此模型下,每台主机都使用其自身的点对点协议栈,因此呈现给用户的是一个熟悉的用户界面。访问控制、计费与服务类型(type of service),可基于每名用户,而不是基于每个地点完成。
49+
50+
如同在[RFC 2516](http://man.chinaunix.net/develop/rfc/RFC2516.txt)中所指明的那样, PPPoE 有两个不同阶段:发现阶段与会话阶段(As specified in RFC 2516, PPPoE has two distinct stages: a discovery stage and a session stage)。在主机发起一个 PPPoE 会话时,其必须首先进行发现,以找到可满足客户端请求的服务器,并找到对等点的以太网 MAC 地址而建立一个 PPPoE 会话 ID 。在 PPP 定义一个对等点到对等点的关系时,发现本质上就是一个客户端服务器的关系(While PPP defines a peer-to-peer relationship, discovery is inherently a client-server relationship)。
51+
52+
### PPPoE的配置
53+
54+
下面的小节涵盖了服务器(互联网服务提供商处)与客户端 PPPoE 的配置。之所以包含此内容,是因为现在 CCNA 大纲强制要求考生知道如何配置 PPPoE 。
55+
56+
#### 服务器的配置
57+
58+
创建 PPPoE 服务器配置的第一步,是定义一个将对传入连接进行管理的宽带聚合组(broadband aggregation group, BBA group)。该宽带聚合组必须关联到某个虚拟模板:
59+
60+
```console
61+
Router(config)#bba-group pppoe GROUP
62+
Router(config-bba-group)#virtual-template 1
63+
```
64+
65+
下一步为面向客户端的接口,创建出一个虚拟模板。在虚拟模板上,需要配置一个 IP 地址以及一个可从中为客户端分配到协商地址的地址池(The next step is to create a virtual template for the customer-facing interface. On the virtual template you need to configure an IP address and a pool of address from which clients are assigned a negotiated address):
66+
67+
```console
68+
Router(config)#interface virtual-template 1
69+
Router(config-if)#ip address 10.10.10.1 255.255.255.0
70+
Router(config-if)#peer default ip address pool POOL
71+
```
72+
73+
该 IP 地址池是在全局配置模式中定义的。这与 DHCP 地址池的配置类似:
74+
75+
```console
76+
Router(config)#ip local pool POOL 10.10.10.2 10.10.10.254
77+
```
78+
79+
最后一步就是在面向客户端的接口上开启该 PPPoE 分组:
80+
81+
```console
82+
Router(config)#interface FastEthernet0/0
83+
Router(config-if)#no ip address
84+
Router(config-if)#pppoe enable group GROUP
85+
Router(config-if)#no shutdown
86+
```
87+
88+
#### 客户端的配置(Client Configuration)
89+
90+
在客户端侧上,必须创建出一个拨号器接口(On the client side a dialer interface has to be created)。拨号器接口将对 PPPoE 连接进行管理。可将手动 IP 地址分配给拨号器接口,或将其设置为从服务器请求一个 IP 地址(使用`ip address negotiated`命令):
91+
92+
```console
93+
Router(config)#interface dialer1
94+
Router(config-if)#dialer pool 1
95+
Router(config-if)#encapsulation ppp
96+
Router(config-if)#ip address negotiated
97+
Router(config)#interface FastEthernet0/0
98+
Router(config-if)#no ip address
99+
Router(config-if)#pppoe-client dial-pool-number 1
100+
Router(config-if)#no shutdown
101+
```
102+
103+
### 关于认证( Authentication )
104+
105+
为了令到 PPPoE 连接安全,可使用两种方法:
106+
107+
- 口令认证协议(Password Authentication Protocol, PAP) - 不安全的、以明文方式发送凭据(包含用户名与口令)
108+
- 询问握手协议(Challenge Handshake Authentication Protocol, CHAP) - 安全的(明文的用户名与经`MD5`散列化的口令),是首选方式
109+
110+
可如下配置`PAP`
111+
112+
_服务器侧_
113+
114+
```console
115+
Server(config)#username Client password Password
116+
Server(config)#interface virtual-template 1
117+
Server(config-if)#ppp authentication pap
118+
Server(config-if)#ppp pap sent-username Server password Password
119+
```
120+
121+
_客户端_
122+
123+
```console
124+
Client(config)#username Server password Password
125+
Client(config)#interface dialer 1
126+
Client(config-if)#ppp authentication pap
127+
Client(config-if)#ppp pap sent-username Client password Password
128+
```
129+
130+
`CHAP`可如下进行配置:
131+
132+
_服务器侧_
133+
134+
```console
135+
Server(config)#username Client password Password
136+
Server(config)#interface virtual-template 1
137+
Server(config-if)#ppp authentication chap
138+
```
139+
140+
_客户端_
141+
142+
```console
143+
Client(config)#username Server password Password
144+
Client(config)#interface dialer 1
145+
Client(config-if)#ppp authentication chap
146+
```
147+
148+
### PPPoE的验证与故障排除(PPPoE Verification and Troubleshooting)
149+
150+
在 PPPoE 会话成功形成后,客户端控制台上将出现下面的消息:
151+
152+
```console
153+
%DIALER-6-BIND: Interface Vi1 bound to profile Di1
154+
%LINK-3-UPDOWN: Interface Virtual-Access1, changed state to up
155+
%LINEPROTO-5-UPDOWN: Line protocol on Interface Virtual-Access1, changed state to up
156+
```
157+
158+
在客户端路由器上使用下面的命令,可对拨号器接口,以及从 PPPoE 服务器处获取到的(协商到的) IP 地址进行检查:
159+
160+
```console
161+
Router#show ip interface brief
162+
Interface IP-Address OK? Method Status Protocol
163+
Virtual-Access1 unassigned YES unset up/up
164+
Dialer1 10.10.10.2 YES IPCP up/up
165+
```
166+
167+
在客户端路由器上可使用下面的命令,显示出 PPPoE 会话的状态:
168+
169+
```console
170+
Router#show pppoe session
171+
1 client session
172+
Uniq ID PPPoE RemMAC Port Source VA State
173+
SID LocMAC VA-st
174+
N/A 16 ca00.4843.0008 Fa0/0 Di1 Vi1 UP
175+
ca01.4843.0008 UP
176+
```
177+
178+
一些对于 PPPoE 连接进行故障排除有用的命令如下:
179+
180+
```console
181+
Router#debug ppp ?
182+
authentication CHAP and PAP authentication
183+
bap BAP protocol transactions
184+
cbcp Callback Control Protocol negotiation
185+
elog PPP ELOGs
186+
error Protocol errors and error statistics
187+
forwarding PPP layer 2 forwarding
188+
mppe MPPE Events
189+
multilink Multilink activity
190+
negotiation Protocol parameter negotiation
191+
packet Low-level PPP packet dump
192+
```
193+
194+
## WAN连接的故障排除(Troubleshooting WAN Connections)
195+
196+
在试图启动一条广域网连接(现在先不管 PPP 与帧中继连接)时,可运用开放系统互联模型:
197+
198+
`Layer 1` -- 对线缆进行检查,以确保其连接正确。其外还要检查一下有没有执行`no shutdown`命令,以及在数据通信设备侧有没有应用一个时钟速率。
199+
200+
```console
201+
RouterA#show controllers serial 0
202+
HD unit 0, idb = 0x1AE828, driver structure at 0x1B4BA0
203+
buffer size 1524 HD unit 0, V.35 DTE cable
204+
205+
RouterA#show ip interface brief
206+
Interface IP-Address OK? Method Status Protocol
207+
Serial0 11.0.0.1 YES unset administratively down down
208+
Ethernet0 10.0.0.1 YES unset up up
209+
```
210+
211+
`Layer 2` -- 检查以确保对接口应用了正确的封装。确保链路的另一侧有着同样的封装类型。
212+
213+
```console
214+
RouterB#show interface Serial0
215+
Serial1 is down, line protocol is down
216+
Hardware is HD64570
217+
Internet address is 12.0.0.1/24
218+
MTU 1500 bytes, BW 1544 Kbit, DLY 1000 usec, rely 255/255, load 1/255
219+
Encapsulation HDLC, loopback not set, keepalive set (10 sec)
220+
```
221+
222+
`Layer 3` -- IP地址与子网掩码对不对,子网掩码与另一侧是不是匹配。
223+
224+
```console
225+
RouterB#show interface Serial0
226+
Serial1 is down, line protocol is down
227+
Hardware is HD64570
228+
Internet address is 12.0.0.1/24
229+
MTU 1500 bytes, BW 1544 Kbit, DLY 1000 usec, rely 255/255, load 1/255
230+
Encapsulation HDLC, loopback not set, keepalive set (10 sec)
231+
```
232+
233+
## 第 41 天问题
234+
235+
1. Name at least three WAN categories.
236+
2. The need for NBMA appears when there is no native `_______` support for a group of systems that want to communicate over the same network.
237+
3. In NBMA environments you still need to bind the Layer 3 address (IP address) to the Layer 2 address (DLCI). This can be done in an automated fashion, using a technology called Inverse ARP. True or false?
238+
4. Name 2 NBMA interface types.
239+
5. `_______` requires DTE and DCE and is the default encapsulation type on Cisco routers.
240+
6. `_______` technologies involve the use of carrier Ethernet in Metropolitan Area Networks (MANs).
241+
7. T1 is a standard often used in what geographical regions?
242+
8. What are the two flavours of ISDN?
243+
9. `_______` is the most common form of DSL connection that functions over standard telephone lines. It offers unequal download and upload throughput, with the download rate being higher than the upload rate.
244+
10. `_______` functions by appending a label to any type of packet.
245+
246+
247+
## 第 41 天答案
248+
249+
1. Circuit-switched, cell-switched, broadband, leased-line, and packet-switched.
250+
2. Broadcast.
251+
3. True.
252+
4. Multipoint and Point-to-Point.
253+
5. HDLC.
254+
6. Metro Ethernet.
255+
7. North America, Japan, and South Korea.
256+
8. BRI and PRI.
257+
9. ADSL.
258+
10. MPLS.
259+
260+
261+
## 第 41 天实验
262+
263+
### PPPoE实验
264+
265+
在两台路由器之间,以本课程模块中所给出的信息,配置带有 CHAP 的 PPPoE :
266+
267+
__服务器配置__
268+
269+
```console
270+
Router(config)#bba-group pppoe GROUP
271+
Router(config-bba-group)#virtual-template 1
272+
Router(config)#interface virtual-template 1
273+
Router(config-if)#ip address 10.10.10.1 255.255.255.0
274+
Router(config-if)#peer default ip address pool POOL
275+
Router(config)#ip local pool POOL 10.10.10.2 10.10.10.254
276+
Router(config)#interface FastEthernet0/0
277+
Router(config-if)#no ip address
278+
Router(config-if)#pppoe enable group GROUP
279+
Router(config-if)#no shutdown
280+
```
281+
282+
__客户端配置__:
283+
284+
```console
285+
Router(config)#interface dialer1
286+
Router(config-if)#dialer pool 1
287+
Router(config-if)#encapsulation ppp
288+
Router(config-if)#ip address negotiated
289+
Router(config)#interface FastEthernet0/0
290+
Router(config-if)#no ip address
291+
Router(config-if)#pppoe-client dial-pool-number 1
292+
Router(config-if)#no shutdown
293+
```
294+
295+
__询问握手认证协议( CHAP )配置__:
296+
297+
```console
298+
Server(config)#username Client password Password
299+
Server(config)#interface virtual-template 1
300+
Server(config-if)#ppp authentication chap
301+
Client(config)#username Server password Password
302+
Client(config)#interface dialer 1
303+
Client(config-if)#ppp authentication chap
304+
```
305+
306+
__对配置进行验证__
307+
308+
```console
309+
Router#show pppoe session
310+
1 client session
311+
Uniq ID PPPoE RemMAC Port Source VA State
312+
SID LocMAC VA-st
313+
N/A 16 ca00.4843.0008 Fa0/0 Di1 Vi1 UP
314+
ca01.4843.0008 UP
315+
```
316+
317+
请访问[www.in60days.com](http://www.in60days.com)并自由观看作者完成该实验。
318+
319+
320+
(End)
321+
322+

src/d37/VPN.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# VPN 技术
2+
3+
所谓 VPN,属于一种叠层通信网络,而给予这些通信网络业务所需的安全性与可管理性的技术。在 VPN 技术下,咱们可在享受 Internet 低成本与高可用性的同时,建立安全关系、自动连接、授权与加密等。
4+
5+
VPN 在数据通过 Internet 传输,或在公司飞地内传输时予以保护。VPN 具备多种能力,但主要功能包括以下这些:
6+
7+
- 保障数据机密性(加密)
8+
- 验证通信双方身份(认证)
9+
- 保护通信各方身份 (隧道)
10+
- 确保数据准确且为原始形式(不可否认)
11+
- 防范数据包重复发送(重放攻击防护)
12+
13+
14+
尽管 VPN 这一概念大多数时候意味着安全性,但不安全的 VPN 也存在。帧中继便是这种不安全 VPN 的一个示例,因为他提供了两地间的私有通信,但他可能并无其上的任何安全特性。咱们是否应添加安全性到 VPN 连接,取决于该连接的具体需求。
15+
16+
因为缺乏业务提供商基础设施方面的可见性,VPN 的故障排除难于进行。业务提供商通常被视为聚合了所有网络位置处连接的云。执行 VPN 故障排除时,咱们应首先确保问题未在咱们的设备处,然后才再联系业务提供商。
17+
18+
VPN 技术类型很多,包括以下这些:
19+
20+
- 站点到站点的 VPN,或内联网 VPN,例如叠层 VPN(如帧中继),或点对点 VPN(如 MPLS)。当咱们打算于公共基础设施上,连接不同地点时,咱们就会用到这些 VPN 技术。在使用对等基础设施时,咱们便可在无需担心 IP 地址重叠下,于站点间无缝通信;
21+
- 远程接入 VPN,例如虚拟专用拨号网络(VPDN),属于一种通常以安全为考量,而完成的 VPN 拨号方式;
22+
- 外部网络 VPN,适用于咱们打算连接到业务伙伴,或客户网络时;
23+
24+
当咱们使用 VPN 时,为了在某一基础设施上发送流量,咱们通常会通过隧道传输流量。有一种三层的隧道方法,称为通用路由封装(GRE)。GRE 允许咱们通过隧道传输流量,但其并未提供安全性。为了通过隧道传输流量并同时提供安全性,咱们可使用一种叫做 IP 安全(`IPSec`)的技术。这一技术属于 IPv6 的一个强制实现组件,但其并非 IPv4 的一个要求。IPSec 还可与认证、授权及计费(AAA)服务结合使用,其实现了用户活动的追踪。
25+
26+
VPN 的主要优势包括以下这些:
27+
28+
- 可扩展性(咱们可持续添加站点到 VPN)
29+
- 灵活性(咱们可运用像是 MPLS 等一些非常灵活的技术)
30+
- 开销(咱们可在太多费用下,即可在 Internet 上通过隧道发送流量)
31+
32+
33+
## 客户端 VPN
34+
35+
经由浏览 Internet,咱们肯定了解了安全套接字层(SSL)协议。每次咱们曾在线购买过什么东西时,以 https:// 开头的 Web 地址,便是咱们正利用 SSL 确保咱们的金融信息被加密及安全的一个指征。
36+
37+
SSL 同样可用于创建 VPN 会话。例如,思科的 AnyConnect 软件客户端,便可安装在任何操作系统上,允许用户建立到某一网络的安全隧道。一旦该隧道建立,用户便可如同身处同一网络上一样,访问网络资源,即他们可查看内网页面、访问电子邮件,或如同置身办公室那样,使用内部 Skype 服务器通讯。全部这些信息,在 Internet 上均被加密。
38+
39+
客户端 VPN 的 SSL 连接,通常与思科 ASA 防火墙建立。当咱们完成一天的工作后,咱们只需只需断开咱们的 VPN 会话。
40+
41+
42+
## DMVPN
43+
44+
所谓动态多点 VPN,可在不必通过总部 VPN 服务器或路由器这一传统方式下,实现站点之间的安全通行。DMVPN 节省了开支,并节约了带宽,当然还提高了速度。
45+
46+
中心分支型拓扑结构为这种连接类型所需要。分支节点将收集目标分支节点的相关信息,并与随后建立一条直连 VPN 隧道。下图 37.6 演示了这一连接类型:
47+
48+
![运作中的 DMVPN](../images/DMVPN.png)
49+
50+
**图 37.6** -- **运作中的 DMVPN**
51+
52+
53+

0 commit comments

Comments
 (0)