搜档网
当前位置:搜档网 › 2011年思科内部CCNA培训资料

2011年思科内部CCNA培训资料

2011年度
CCNA培训资料

什么是
Cisco?

Cisco是
San Fransico的简称,cisco https://www.sodocs.net/doc/0a16030312.html, 是最大的网络设备公司。Cisco以
router起家,现在

revenue里面,
router占
40%,switch占 40%, service占
20%. Cisco靠着兼并正成为一个全方位提供网络设备
的公司。

什么是
CCNA?


CCNA是
Cisco Certified Network Associate的缩写。要参加
CCNA的考试,最好手头有一张
Cisco的
document CD.
如果没有,可以上网直接访问:

要取得
CCNA,只需要通过一门考试, 640-507。考过
CCNA后,还可以参加更高级的
CCNP的考试,
CCNP需要考
4
门。会比
CCNA难的多。再往上就是最值钱的
CCIE。如果你取得了
CCIE的证书,拿个几十万美金的年薪并不为奇。
CCIE有笔试和
lab两部份。其实
CCIE的笔试比
CCNP容易,而且考的许多知识大多是
4 、5年前的技术,比较旧了。

lab考试非常的难,要考两天。现在全世界就两个考点,其中一个在
San Jose.如果现在报名的话,要等
4个月才能
参加考试。


OSI Reference Model

其实
OSI model等的基本网络的概念在
MCSE考试中都已经学过了。所以我们一般建议大家参加完
MCSE的考试再来
参加
CCNA的考试,不然你的知识面会异常的狭隘。


OSI model 有
7 层,由下往上分别是:


7.application

6. presentation
5. Session
4. Transport
3. network
2. datalink (包括
LLC和
MAC两个
sublayer)
1. physical
对于
CCNA考试来说,你要知道每一层的定义、功能并有哪些特点。尤其是第
3第
4层,因为
router就工作在第
3第
4
层。并且要对下面的概念有一定的了解:
Ethernet, Token Ring, 802.3, FDDI, 如果有什么不懂的,可以去查
document CD.
要区分
physical address 和
logical address的区别。physical address 就是
MAC address, 你可以在
command
prompt 里面敲:


arp -a


来看到
MAC address. 而
logical address是
IP address或 IPX address.
physical address 工作在
datalink layer, 而
logical address work 在 network layer.
以下是一些考试中会遇到的
component和
OSI model 7 layer的对应关系。


7.application -> Telnet, SMTP, FTP


6. presentation -> ASCII, EBCDIC, QuickTime, MPEG, GIF, JPG, TIFF
5.Session -> ZIP, SCP, NFS, SQL
4. Transport -> TCP, SPX, UDP, NBP, OSI transport protocol
3. network -> IP, IPX ,BGP, OSPF, RIP
2. datalink -> MAC address
1. physical
MAC address, 48 bits = 12 hexadecimal digits ,敲
arp -a 看你
network card的
MAC address
前面
6个
hexadecimal digits是
Organizational Unique Identifier (OUI).跟厂家有关。但一个厂家可以有多个
OUI,

Cisco就有
100多个
OUI.但相同的
OUI肯定来自同一个厂家。后面的 6个
hexadecimal

digits是由厂家指定的。
这样保证在全世界不可能有两个相同的
MAC address.

Connection oriented 和
connectionless的区别


connection oriented是在连接前先建立
connection, 这样保证了数据传输的
reliability. 而
connectionless是不建立
连接就传输。所以
connectionless有更少的
overhead,但不能保证数据的
reliablity. 所以我们传
E-mail要用
connection oriented的
protocol, 而网上听歌,因为速度更重要,丢几个
packets没关系,可以用
connectionless的
protocol.

在常见的
protocol里面, TCP是
connection-oriented, UDP是
connectionless.


MCSE考试里面, packets和
frame是不分的,但在
cisco的考试中间,有下面的对应情况:


7.application

6. presentation
5. Session
4. Transport -> Segments
3. network -> Packets/datagrams
2. datalink -> Frames
1. physical -> bits ( 0 or 1)
Flow control是比较难掌握的概念。有三种控制模式:


1. buffer,是最常用的,其实你在网上传数据,一般都是先写到
buffer里面,然后再传送的。如果你会
winsocket编程,
你会发觉其实写个
network的
application还是很简单的。只要懂得如何往
buffer里面写东西就好了,其它的全由
system
来做了。:
P
2. Source quench,就是接收方让发送方减慢传输速度。
3. Windowing, 如果学过
networking或
MCSE, 对
sliding window应该有所了解。其实
windowing 就是你发
n个
packets后返回一个信息,告诉发送方这几个
packets已经收到了,如果到一定时候没有收到这
return的
message,那
n个
packets就要重发。
Hierarchical vs. Flat Address Space

MAC address是
Flat Address domain name, IP address都是 hierarchical address router

这是
cisco考试中间最重要的概念,没事的时候,可以上网
search "router" 多看看
router到底是干什么的:
P

1. router肯定有多个
network interface,一般一个
network card有一个
network interface
2. 连接多个不同的
subnet
3. router通过
routing table来决定
packets往哪边传,永远不可能往两个
interface上传。万一遇到这种情况,会把
packet drop 掉。
4. routing table可以人工加,在
command prompt里面,用
route add就可以加
routing table,但更常见的是安装
routing protocol如
RIP或
OSPF。
5. router工作在
OSI 3 layer上。
IOS (Internetwork Operating System)

正如
Microsoft的
operating system叫
Windows, Cisco的
operating system叫
IOS。其实
Cisco router里面的
chip都很便宜的,大多数也就是
486的水平,现在的
Pentium computer也就卖几百美金,为什么这个小小的
router
就敢卖好几千的美金。就是应该这个
IOS。如果说
Microsoft是靠
Windows垄断了市场,那么说
Cisco

是靠 IOS来垄
断了市场,真是一点都不为过。


configure a cisco router,首先要熟悉
cisco的 port,看 Cisco 2524的图,你要知道下面的
port.


console port: 其实就是
serial port,你要用
console cable (Cisco的原装
cable是蓝色的),一头连在
console port
上,一头连在你
PC的
serial port上,然后用
HyperTerminal 进行控制。一般
Cisco的
router都是用
console port
进行
configure的。


auxiliary port: 是辅助
port的意思。一般是远程调试的时候用
modem连接的。用处不是很大,在某些
cisco的
router
里面都没有这
auxilary port.

其它的
AUI port或 10baseT的
port应该不用介绍了吧?:
P

一般
Cisco的
router都有扩展口,你可以把
WIC (WAN interface card)插进去的。你可以根据你网络的需求,订购不
同的
WIC。

这设置
router的时候,一般用 s0 代表第一个
serial port. e0代表第一个
ethernet port. con0 代表第一个 console
port.

Cisco router的命名是按从右往左,从下往上的顺序排列的。比如你有两个
ethernet port, 左边那个就是
e1,右边那个
就是 e1.如果这两个
ethernet port是上下排列的,下面那个就是
e0,上面那个就是
e1.在有的
router里面,一个
network module solt里面会有多个
interface,这时候你可以用
e1/0, e1/1, e1/2等符号来表示。

如果是第一个
fast ethernet的话,用
fa0来表示。


Cisco router的构造还是非常的简单的。IOS image是在
flash memory里面的。flash memory和一般
memory的区
别在于一般
memory 的东西,你机器 power off后就没有了,而
flash memory里面的东西还是存在的。这
IOS image
等 router boot 起来的时候,把
image解压缩到
RAM 里面,所以以后就和
RAM 里面的
IOS打交道了。

另外
cisco的一些
configuration file是在 NVRAM里面的。 NVRAM是
Non-Volatile RAM的意思。下面是
NVRAM
的定义。


Memory that holds its content without power. ROMs, PROMs, EPROMs and flash memory are examples.
Disks and tapes may be called non-volatile memory, but they are usually considered storage devices.
Sometimes the term refers to memory that is inherently volatile, but maintains its content because it is
connected to a battery at all times.

IOS的用户界面
: Exec是
CLI (Command Line interface),象
MS-DOS, unix里面的
command line都是 CLI
的。而
Windows是
GUI (Graphic User Interface). CLI的特点是比较难学,但
configure 起来比较快。现在
Cisco也
正在做
Java 的
GUI-based configuration software, 但大家还是喜欢
CLI的。

要通过
CCNA的考试,要三台
router进行练习,如果没有条件的网友,可以找
routersim等软件进行练习。


configure router的时候,一般是用
console

cable 连到
console port上的。然后用
WIndows 下的
HyperTerminal进

configure.如果你有许多台的
router, 你也可以把他们的
serial port都连到
Cisco的
terminal server上,然后在别
的机器上用
telnet就可以访问了。第二种方案在有许多
router的情况下比较方便,但你要添置新的设备
terminal
server.

输入正确的
password后,你就可以进入
cisco router了。

你第一个可以打的命令是 ? ,来看看到底支持哪些命令。


IOS has two mode: user mode , and privileged mode

其实
user mode对
configuration 没什么太大的作用,只有
privileged mode才是 configuration的关键。不少的
router
不用
password都可以进入。而从
user mode到
privileged mode是一定要设
password的。

从 user mode到
privileged mode, 你打 enable或 en就可以了。系统会问你
password, 你敲入正确的
password
就可以进入了。


Router>enable
Router#disable
Router>|

从 privileged 到
mode user mode, 你要打 disable。

看上面的图,如果你在
user mode,提示符是
> ,而如果是 privileged mode,提示符是 #。所以你设
router的时候可
以根据前面是 >还是 #来确定自己在什么
mode.

进入
privileged mode后,你还可以敲 config terminal或 config t进入 Global Configuration Mode ,这时的
Prompt会变成: Router(config)#

退出
global configuration mode,你敲
Ctrl + Z 可以退出
global configuration mode(如果有系统信息出现,可以打
Ctrl + r to resume the session).


global configuration mode里面,敲
int s0 可以进入
Interface-Specific Configuration Mode,s0 这里是第一个
serial port.你可以把
s0换成别的
interface来 configure 别的
interface. global configuration mode前面的
Prompt
会是 Router(config-if)#


Interface-Specific Configuration Mode退出,你可以敲
exit.

下面是从
user mode -> privileged mode -> global confiuguration mode -> Interface-Specific Configuration
Mode再一步一步退出的演示。


Router>enable
Router#config t
Enter configuration commands,one per line.End with CNTL/Z.
Router(config)#int s0
Router(config-if)#exit
Router(config)#^Z
%SYS-5-CONFIG_I:Configured from console by console
Router#disable
Router>|


Cisco router里面,在
memory的
configuration 叫做 run , 在 NVRAM里面的
configuration 叫做 start.你的
所有
configuration 都先存在
memory里面。因为
memory里面的东西关机后就会消失,你可以用
copy run start命
令把 memory里面的
configuration 存盘。当然你也可以用
copy start run 命令把
NVRAM里面的东西
copy到
memory里面。大家要注意的是 copy start run 并不是把所有
memory里面的东西都去掉,只留下 NVRAM里面
configuration的东西,而只是有相同的


configuaration进行覆盖。

等你把
password设好后,可以在
priviledge mode里面敲 sh run 看你现在的
configuration. 你会发现现在的密码没
有加密,直接显示出来的,这样是很危险的。


Router#sh run
Building configuration…
Current configuration:
!
Version 11.3
Service timestamps debug uptime
Service timestamps log uptime


no service password-encryption
!
hostname Router
!
!
enable password meetchinese
!
!
interface Ethernet0
no ip address
shutdown

你可以用
enable secret来把
password encry了。然后你再敲
sh run ,就会看见 encrypted password.

如果你不想用
encrypted 的
password, 敲
no enable secret就好。


**做完所有的
configuration, 千万别忘了用
copy run start 存盘。
如果你要修改进入
console的
password, 可以用下面的命令把
password设为
meetchinese

Router>enable
password:
Router#config t
Enter configuration commands,one per line.End with CNTL/Z.
Router(config)#line con 0
Router(config-line)#login
Router(config-line)#password meetchinese
Router(config-line)#exit
%SYS-5-configured from console by console
Router#

想取消
console login的
password, 打下面的命令


no login
no password

因为一个
router可以支持 5个
telnet connections.所以你可以用下面的命令把
5个
telnet connections的
password
都设为
meetchinese

line vty 0 4
login
password meetchinese

设置
banner,也就是你
login到
router时的欢迎信息。你可以把下面的
$换成任何别的符号如 #,但如果你在
banner
motd 用了#,你在文字结束的时候也要用 #.系统才知道你什么时候这欢迎信息结束了。


banner motd $
Welcome!
$


重新启动
router.


#reload


把系统设为 manufatory 出厂时的状态,
#erase start



显示
IOS的
image,可以用下面的命令。
#show flash
再复习一下,我们的
flash memory里面放的是 IOS的
img.
如果你有了新的
IOS版本,你可以设一个
TFTP server,让
cisco router和
TFTP server进行通讯。


#copy tftp flash
以上命令把
TFTP server上的
IOS img load 到
Cisco router上。
对于系统管理员,你也可以用下面的命令把你
router里面的
IOS备份。
#copy flash tftp

CDP (Cisco Discovery Protocol)

你刚启动
router的时候,可能里面什么都没有设,这
CDP可以让你看你邻居的
router的情况。


Router#sh cdp neighbors

Capability codes: R - router,T – Trans Bridge,B – Source Route Bridge
S – Switch,H-Host,I – IGMP,r -Repeater

Device ID Local Intrfce Holdtme Capability Platform Port ID
RouterB Ser 0 119 R 2500 Ser 1
Router#


CCNA考试中,要分清楚下面的
devices在什么
layer工作。
Layer 3 devices: router
Layer 2 devices: S

witch, bridge
Layer 1 devices: repeater, Hub

Switching is not very important for the CCNA exam. However you need to know the basic switching
concepts.

To solve the network congestion problem

1. Create a smaller collision domain.
Ethernet uses CSMA/CD, here CD means collison detection. When two computers try to send the packet at
the same time. Collison is found in the network. So none of the packet will be sent. They wait random
period of the time to resend the packet. If computers are in the same subnet, they are in the same collision
domain. Creating a smaller collision domain means creating multiple subnets in your network.
2. increase the bandwidth, for example, upgrade your network to 100Mbps fast Ethernet.
LAN segmentation:

LAN segmentation means use bridge, router or switch to segment the network and create a smaller collision
domain.

You need to know how a bridge, router, switch works. If you don't know how they work, take the MCSE
networking essentials exam first.

Both bridge and router use the routing table to distinguish if the computer are in the same segment. (not
subnet). A bridge connects two network segments of the same subnet. A router can connect two or more
network segments of the different subnets.

For example, the subnet mask for your network is 255.255.255.0

(1.1.1.1 - 1.1.1.10)<----> Bridge <----> (1.1.1.100 - 1.1.1.120)

(1.1.1.1 - 1.1.1.10)<----> router <----> (1.1.2.1 - 1.1.2.10)
Bridge works on the MAC layer, it does not care of the upper layer protocol. You can use a bridge to connect
the network using either routable protocol (TCP/IP, IPX/SPX) or unroutable protocol. You can only use a
router to connect the network using the routable protocol(TCP/IP, IPX/SPX)

A bridge does not stop broadcasting, while using a router can prevent broadcasting.
A router supports multiple pathes, however, a bridge only supports spanning-tree.

区分 Switch & bridge

1. both layer 2 device
2. switch supports multiple ports, while bridge only supports two ports
3. bridge: hardware-optimized for speedy. concurrent switching, which reduces latency compared to
transparent bridging.
Switching mode:

** The Ethernet header is 14 bytes.


1.Store-and-Forward: Store the entire packet and forward it. You can also minimize the error by checking
CRC. Latency varies depending on frame size;
2.Cut-Through (Real-Time): Constant latency; no error checking
3.Fragment-Free: Waits 64 bytes before forwarding a frame – Constant latency (because the most possible
errors occur in the first 64 bytes)


Low-end switch only supports store-and-forward.


full-duplex Ethernet


An extension to 10BaseT Ethernet that is implemented in a switched Ethernet environment, which has a
dedicated line between the station and switch. It is built into the network adapter (NIC) and switch,
providing bi-directional transmission that boosts bandwidth from 10 to 20

Mbps.


Fast Ethernet (802.3u)


still use CSMA/CD


Gigabit Ethernet


1000BaseT (IEEE 802.3ab) : 2-pair CAT 5 UTP (100 m) UTP
1000BaseSX (IEEE 802.3z) : 2-strand multi-mode optical fiber (220-550m)
1000BaseLX (IEEE 802.3z) : 2-strand multi-mode or single-mode optical fiber (3000 m)


如果你有多个
switch的话,如果你网络设计的时候有
loop的时候,packets会一直在网络里面循环的传,产生
broadcast
storm.请比较一下用
router连的
network,因为有
TTL (time to live)这个参数,所以到一定的时候
packets就自动丢
掉了。而
switch的
network里面没有
TTL这个概念,所以如果你在
switch network里面如果有
loop的话,就会一直
传下去。


所以一般设计的时候采用
spanning -tree的结构。但是
spanning-tree没有
fault-tolernce,所以用
spanning-tree
protocol to provide layer2 redundence并解决
loop的问题。


spanning-tree protocol其实也没什么,就是只
enable一个
port, 让现在的网络只支持 spanning-tree的结构,如果
那个
port出问题的话,再
enable另外一个
port来做
fault-tolernce.


spanning-tree protocol(STP)有下面的特点:


1. IEEE 802.1d
2. prevent routing loops in a bridge or switched network
3. STP enable the port when one switch is down
STP Convergence Steps:


1.Elect one Root Bridge
2.Elect one Root Port per non-Root Bridge
3.Elect one Designated Port per segment

VLAN

create a broadcast domain (在
CCNA考试中,broadcast domain和
IP subnet是一个概念) by one or more
switches

VLAN的关键是在
switch连接支持
trunk link.Cisco的
switch支持
trunk link,但不是所有的
switch都支持的。所以
并不是所有的
switch都支持
VLAN。


Switch <== trunk link ==> switch

trunk link is a configuration in https://www.sodocs.net/doc/0a16030312.html,e Frame tagging to add VLAN ID number to the packet.

TCP/IP

familiar with the following terms:

IP, ARP, RARP, BootP, ICMP

IP address schema

IP address = network ID + subnet ID + host ID

|<------------IP address----------->|
| network ID | subnet ID | host ID |
|<----subnet mask ------>|

Class A, begin with 0, subnet mask: 255.0.0.0
class B, begin with 10, subnet mask: 255.255.0.0
class C, begin wiht 110, subnet mask: 255.255.255.0

For an IP address, first of all, check it begins with 0, 10 or 110 to see if it is a class A, class B or class C
network.

Secondly, ANDING the subnet mask, you can get the network ID.

Determine the Number of Required Network IDs
1.One for each subnet
2.One for each wide-area network connection

Cisco supports IP unumbered, so you don't need to have one network ID for each network connection. But
other vendors might not support IP unumbered.

For the CCNA exam, you need to know how to calculate the class, subnet mask and broadcast address.如何

二进制转成
10进制,10进制转成
2进制。


2进制转
10进制比较简单。

由右往左,
第一位乘以 2的
0次方,
第二位乘以 2的
1次方,
第三位乘以 2的
2次方,
第四位乘以 2的
3次方,


。。。
把所有的数字加起来就好了。


10进制转
2进制稍微麻烦一些。但一次一次的除以
2,就可以得出结果。因为老美的算术的普遍水平连国内的小学生都


比不了,(90%以上的人都不会
9 x9乘法口诀
)所以大家不用太紧张。:P

Broadcast address:

subnet ID
inverse the subnet ID 0 --> 1 , 1 -->0
IP ANDING the inversed subnet ID

Q: What is the valid IP address range in the subnet of 172.37.2.56 with 12 subnet bits?
1. 172 begin with 10, so it is a class B network.
2. -> default subnet mask is 16 bits.
3. new subnet mask = 16 bits + 12 bits = 28 bits
4. convert the 172.37.2.56 to binary
5. begin IP address: change the last 4 bits to 0001, change the last 4 bits to 1110.
Configure IP address in Cisco

Because IP address is interface specific, you need to go to interface

Router>enable
Router#config t
Router(config)#int s0
Router(config-if)#ip address 172.16.20.2 255.255.255.0
Router(config-if)#int e0
Router(config-if)#ip address 172.16.10.1 255.255.255.0
Router(config-if)#^Z


cisco router里面
ping return result 有下面几种
:

! --> OK
. --> Time out
u --> unreachable

IP routing

IP routing在
CCNA考试中是比较重要的部份,虽然在
Cisco的
router上
configure the IP routing 的命令并不多,
但中间的原理比较的多。如果你
MCSE的
TCP/IP考试复习的比较好的,对这一部份的理解应该不是很难,但是如果你
MCSE中的
T CP/IP课程没有学好,或没有参加过
MCSE考试的话,对这一部分你需要花费更多的精力。


IP routing 有两种:


static routing 和
dynamic routing


顾名思义,static routing要让你人工的
configure 所有的
routing table,虽然系统的
overhead比较少,但人总是会犯
错误的。如果你网络中间
configuration经常变化的话,用
static routing 会非常的费事。


用下面的命令
configure the static routing table
RouterA(config)#ip route 1.1.2.0 255.255.255.0 1.1.1.1


上面命令的意思是如果你要道
1.1.2.0这个
subnet(subnet mask is 255.255.255.0), 你要通过 1.1.1.1这个
IP
address. 1.1.1.1
一般是另外一台
router上的一个
interface.


dynamice routing 需要
routing protocol(象
RIP和
OSPF)的介入.

CCNA的考试中,大家要区分开 routing protocol 和
routed protocol的区别。routing protocol是帮你来建
routing
table的。不然的话,如果你使用
static routing, 你要人工
configure the routing table.而
routed protocol是指这个
network protocol 是否能
r

outable,也就是是否可以用
router来连接这个
protocol.

TCP/IP, IPX/SPX是
routed protocol(或
routable protocol). 而
NetBEUI是
unroutable protocol.


主要的
routing protocol有以下一些:



1. Interior Routing Protocols:
1.1 Distance Vector
RIP, IGRP
1.2 Link State
OSPF
1.3 Balanced Hybrid
EIGRP
2. Exterior Routing Protocols
EGP, BGP
在实际中用的最广的是
RIP和
OSPF。而
EIGRP和
IGRP是
Cisco独创的,所以只有在
Cisco的
router上才支持。


RIP

1. Updates every 30 seconds (RIP) or 90 seconds (IGRP)
2. Hop/Metric-based route selection
code:

10M 10M
R1 --------- R2 ----------R3
|____________________|
56K


如果你的
router按上面的方式连接,
R1和
R3之间有两条路径 -------和 __________的。

RIP来说,它会比较两条路径:如果走
------。中间要经过一个
router,而如果走____ 中间没有
router, 所以
RIP会
选______这条路径。虽然它并不是最快的。


CCNA考试中从
R1到
R2叫做一个
hop, 从
R2到
R3也要一个
hop. 如果走 ----,要两个
hop. 而走___,只要一个
hop. 所以
RIP永远是找
hop最少的路径。


Routing Loop

想象有下面的情况:


code:

R1 ------------R2
| |
subnet1 subnet2


如果
R1刚传出
subnet1的信息,subnet1却
down了,这个时候
R2会收到
subnet1的信息。

30秒钟后,R1上没有
subnet1的信息,但会从
R2再传回来,只是
hop加
1。
然后
R1又会把这个信息传出去,传到
R2的时候,R2会认为这个信息从
R1来的,只是
hop再加
1。一直这样下去,就
形成了
routing loop.

1. 解决的办法有下面一些,在
Cisco router里面都是支持的。
1.Counting to infinity
如果
hop到
15的时候,算成是
infinity,就不会再
advertise back了。让对方
router里面的内容
expire.

2.Split horizon
从哪个
interface来的,就不
advertise back了。

split horizon并不能解决所有的问题,因为有可能有
R3.


subnet1的信息虽然不能传会
R1,但会传到
R3, R3还会传到
R1的。


3.Hold-down
根据
invalid period, 象
90秒以后,hold-down.
When learning about a failed route, ignore any new information about
that subnet for a time equal to the hold-down timer

Three events that will reset hold-down timer:
1.Hold-down timer expires

2. The router receives a processing task proportional to the number of
links in the internetwork
3. Another update is received indicating the network status has changed
4.Route poisoning (Poison Reverse)
一般的如果
subnet1 down了的话,一般不
mention subnet1 down,但
route poisoning告诉附近的
router subnet1
down了。而不用象
hold-down, 要
90秒以后再
hold down.

5. trigged

updates
如果
R1 刚
advertise subnet1 的信息到
R2,subnet2, 对
trigged updates来说,并不用等
30秒再
advertise, 而
是立即
advertise.

用下面的命令
config RIP.

Router#config t
Router(config)#router rip
RouterA(config-router)#network 1.1.1.0
RouterA(config-router)#^Z
RouterA#sh ip route

用下面的命令
config IGRP

Router#config t
RouterA(config)#no router rip
RouterA(config)#router igrp 99
RouterA(config-router)#network 1.1.1.0
RouterA(config-router)#^Z

因为无法比较
source的
reliability.
IOS Default Administrative Distances
Directly Connected 0
Static Route 1
IGRP 100
OSPF 110
RIP 120
Unkown 255

上次讲了
TCP/IP,今天来谈谈
Novell 的
IPX/SPX. 其实在考
MCSE的时候有许多和
Novell有关的题目,但大多数是

NT或
2000如何给
NetWare client 提供
service的。而许多人考过
MCSE以后,对
Novell内部的工作还不是很清
楚。

我们可以先来比较一下
IPX/SPX, 和
TCP/IP。


IPX和
IP类似,工作在
network layer.
SPX和
TCP类似,工作在
transport layer.


IPX/SPX 和
TCP/IP的用法就很有意思,我觉得
TCP/IP的说法比较直观,因为
TCP在
transport layer, IP在
network layer, transport layer在
network layer上面,所以用
TCP/IP, TCP 在
IP的上面。而
IPX/SPX却正好相
反,明明
SPX在
IPX的上面,写的时候
IPX反而在
SPX上面。很没有道理。

其实
IPX/SPX这也就是
Novell自己一家做的
protocol了,所以怎么订都有它自己来订。不象
TCP/IP是业界的标准。
而从历史上来看,不开放的系统是没有前途的。Apple就是一个活生生的例子。而
Novell也犯了同样的错误。所以现在


只能惨淡经营了。


SAP 是一个
IPX的
protocol.让
server间每
60秒交换一下信息,知道别的
server上有什么
resources. 每个计算机都
有个
SAP table. SAP有
SAP identifier ( 4 == file server, 7 = printer server)



TCP/IP 相比,这种每个
server上都有
SAP table的模式不是很
scalable.无法扩建很大的网路。
RIP是 distance-vector protocol
NLSP Netware Link Service Protocol,是
link-state routing protocol


当一台
client要访问一个
network resource, 它会发出一个
IPX broadcast GNS (GetNearestServer) request。The
server responds with a GNS response


当你在一台
router上安装
IPX后,在
router上也产生了一个
SAP table.因为
router连接的是两个网络,所以
router上

SAP table包括所连接网络的信息。而
router也每隔
60秒发送
SAP table到所有的
network. 这样可以连接所有的
资源。


没有
global的
IPX addressing,所以
IP address不用象
IP address,有不够用的情况。


IPX address = IPX network number + n

ode number


IPX network number是固定的
32位的。
node number也是固定的,48位的。一般是用
MAC address,这样保证没有相同的号码。


因为
IPX中的 IPX network number 和 node number的位数都是固定的,所以在
IPX中,你不用做
subnetting.


在设置
router的时候,对于一些
serial port,因为没有
MAC address,你可以用
router上
ethernet的
MAC address,
虽然
serial port和
ethernet的
MAC address是一样的,但是前面的
IPX network number是不一样的。所以整个的
IPX address还是不重复的。


如果对一个
interface想加
multiple IP address
IP address 1.1.1.1 255.255.255.0 sec
如果要去掉
no ip address 1.1.1.1 255.255.255.0


IPX encapsualtion有下面几种。
Ethernet:
Ethernet_802.3 novell-ether (Default)
Ethernet_802.2 sap
Ethernet_II arpa
Ethernet_snap snap
Token Ring:
Token-Ring sap (default)
Token-Ring_snap snap
FDDI:
Fddi_snap snap (default)
Fddi_802.2 sap
Fddi_Raw novell-fddi
Serial (WAN)
HDLC (Default)


如果要
enable the IPX routing,用下面的命令:


Router(config)#ipx routing


如果用下面的命令:


Router(config)#ipx routing 0200.aaaa.aaaa

因为
WAN interface没有
MAC address, 这里就告诉
router用
0200.aaaa.aaaa作为
WAN interfaces的
IPX node
address.

如果你要在两个
interface上设不同的
network IPX number


Router(config)#int e0
Router(config-if)#ipx network 8010
Router(config-if)#int s0
Router(config-if)#ipx network 8020
Router(config-if)#^Z

你也可以在一个
interface上加两个
network IPX number, 这样在最后加
sec就可以了。这和
IP address的
configuration是一样的,如果你想要给一个
interface放两个
IP address, 也是在最后加
sec. 如果想取消
IP address,

no ip address....

Router(config)#int e0
Router(config-if)#ipx network 8010
Router(config-if)#ipx network 9010 encapsulation sap sec
Router(config-if)#^Z

Cisco的
security主要指下面的两个概念:


traffic shapping和
traffic filtering,traffic
shapping是比较高深的技术,在
CCNA中,只要知道
traffic filtering就可以了。
traffic shapping : 改变
traffic的走向. QoS
traffic filtering: 控制某个
interface能否通过什么样的
traffic

对于
traffic filtering, 你要设 access list. 对于
access
list的设置,要作两步的工作,先设置
access list, 然后再
apply到不同的
interface.
对于
interface 来说,还分为
inbound (进入)和
outband(出去)的
traffic. 对于
inbound
traffic 和
outbound traffic,可以
apply 不同的
access list.

对于
CCNA考试来说:
INBOUND是指
from the network into the router
OUTBOUND是指
from the router to the network

如果在一个
interface的同一个
direction(INBOU

ND或
OUTBOND), 你可以
apply
多个
access-list. 但是只能对于相同的
access-list type,只能有一个
.

Router(config)#access-list ?
<1-99> IP standard access list
<100-199> IP extended access list
<1000-1099> IPX SAP access list
<800-899> IPX standard access list
<900-999> IPX extended access list


apply的
access-list永远是放到
access-list的最下面,如果你要把
access-list插到中间,一般要把所有的
access-list
delete掉以后,再重新写。 Cisco router处理有关的
traffic的时候,如果发现第一个有关的
access-list,就
apply到
router。如果在
access-list里面没有任何有关的定义,就
deny. 有人也许会问,怎么可能
deny?
我如果没有设
access-list的时候,应该是所有
traffic都可以走才对。
其实这个
deny要这么理解,如果你没有
apply access-list,就不对
traffic进行控制。而如果有任何一个
access-list apply
到有关的
interface,Cisco从
security上面考虑,任何没有定义的
traffic都
deny.

不知道为什么
Cisco要用
Wildcat mask来控制
access-list. 其实本来用
subnet mask就挺好的。 wildcat mask 就
是把所有
subnet mask中的
1变成
0,把所有的
0变成
1。在
CCNA考试中,可以用下面的方法算 wildcat mask.

255.255.255.255 - subnet mask = wildcat mask
比如说如果你的
subnet mask是 255.255.192.0, 所以你的 wildcat mask 是


255.255.255.255
- 255.255.192.0
0.0.62.255

wildcat mask 的意思就是可以不管最后
n位的
IP address.


设置
stand IP access list
access-list [number] [permit or deny] [source address]
这里的
source address 有三种方式:


1. ip address,如 1.1.1.1
2. 一个
subnet,提供 network ID和
wildcat mask , 比如 1.1.1.0
0.0.0.255

3. any: 所有的
traffic
Example:
Router(config)#access-list 10 permit 1.1.1.1
Router(config)#int s0

Router(config-if)#ip access-group 10 in
Router(config-if)#^Z
这样设以后,只有从
1.1.1.1来的
traffic才能到
router.其他任何的
IP

traffic都不能过了,但如果是
IPX的
traffic还是可以过的。
取消
access-list 10 ,用
no access-list 10
如果你想
deny 1.1.1.2的
access inbound access.
你要用两个命令:


access-list 11 deny 1.1.1.2
access-list 11 permit any

如果你不用第二行,我们说过, by default, 会
deny 任何的
traffic, 所以必须加第二行。另外如果是
define the
access-list, 不用管 inbound 或
outbound. 只是在
apply access-list的时候,才要用
inbound或 outbound.

再来看看一个更有趣的问题,如果你按下面设置的话:


access-list 11 permit any
access-list 11 deny 1.1.1.2

那么你还是没有
deny 1.1.1.2的
traffic, 因为
Cisco router只看第一行,找到了
match, 它就

不管下一行了。
如果你现在想让
1.1.1.0 subnet里面除
1.1.1.3的机器外都通过的话,要用下面的命令


access-list 12 deny 1.1.1.3
access-list 12 deny 1.1.1.0 0.0.0.255

Show access-list有下面一些:
RouterC#sh access-lists


RouterC#sh ip access-lists
RouterC#sh ip int s0 //看是否被
apply到不同的
interface
设置
extended IP access list
access-list [number] [permit or deny] [protocol] [source] [destination]


[port]
protocol 有下面一些选择:
IP, IPX, UDP, ICMP



Router(config)#access-list 110 permit tcp host 1.1.1.2 1.1.5.0

0.0.0.255 eq www
www就是
80。是指 http的
traffic,我们访问
webserver的
port default是 80,但一般我们都不打,其实,你完全可
以用 https://www.sodocs.net/doc/0a16030312.html,:80来访问 https://www.sodocs.net/doc/0a16030312.html,的
homepage,这里的
80就是
port number.上
面的语句就是让
1.1.1.2的机器可以访问 1.1.5.0 subnet里面的
web server.

eq外,还可以用
gt (greater than) , lt (less than) .如果你要管理所有大于
1000的
port number,可以用 gt 1000。


Router(config)#access-list 110 permit icmp host 1.1.1.2 1.1.5.0

0.0.0.255

上面的语句就是让
1.1.1.2的机器可以接收
1.1.5.0 subnet的
ICMP的
message,
也就是
1.1.1.2可以
ping 1.1.5.0的
subnet.

RouterC(config)#int s0
RouterC(config-if)#ip access-group 110 in
RouterC(config-if)#^Z

上面的语句就
apply access-list到
interface s0 inbound的
traffic

下面的命令在
configure的时候会常用到的:


sh access-list
sh ip access-list
sh log
clear access-list counter
sh ip interface
sh run

Standard IPX Access Lists

access-list [number] [permit or deny] [source] [destination]

Router(config)#access-list 888 permit 8020 –1
Router(config)#access-list 888 deny -1 –1
Router(config)#int s0
Router(config-if) #ipx access-group 888 in
Router(config-if)#^Z

这里用-1代表
any

Extended IPX Access Lists

access-list [number] [permit or deny] [protocol] [source] [socket]
[destination] [socket]

IPX里面的
socket和
IP里面的
port number类似。一般都用
all 来做
configuration.

RouterA(config)#access-list 999 permit any 8020 all 8020 all

8020 是 IPX network number.
any是指所有的
protocol.

RouterA(config)#access-list 999 deny any 8040 all any all
RouterA(config)#int s0 RouterA(config-if)#ipx access-group 999 in
RouterC(config-if)#^Z

而在
extended IPX access lists是用
any, 不是用 -1.

HDLC (High-Level Data Link Control)

serial port的
default encryption 就是
HDLC。


你可以用下面的命令看你
s0的
encapsulation HDLC is derived from SDLC and specifies an encapsulation
method of data on synchronous serial data links.

Router#sh int s0

如果要设置
HDLC,直接敲下面的命令。


encapsulation HDLC

由于


HDLC没有
addressing
的功能,所以设置非常的简单。你也只能用
HDLC连接两个
serial port而已。由于没有
addressing,所以不可能用
HDLC
连接
3个
serial ports.

Frame Relay

Frame Relay就是把
frame直接
relay(传递)过去。不象
X.25, 有很多的
error correction等的功能。因为现在的
line
都比较稳定,所以没有必要做那么多的
error correction。因为简单,所以更
efficient.

Frame Relay 是工作在第二层的
protocol.
所以你可以在
ISDN,T1,ADSL等的
network上设置
frame relay.

下面是典型的
frame relay 连接图。
code:

Local Loop Local Loop
Router1----- Centrol Office------Frame Relay Cloud ----- Centrol Office ------Router2
T1 T1

如果公司要连接
San Francisco和
New York的
Office,直接用
T1连接费用非常的高。如果用
Frame Relay,你只要在
你公司的
router和
Frame Relay的
local centrol office连接。而中间走
Frame relay的
network.


Frame Relay中最关键的概念是
CIR(Commited Info Rate):
CIR是你申请的保证最低的
transmission rate. 这是指保证给你你最低的
transmission rate.
而你的
network一般都会工作在更高的速度上。


其实现在更好的办法是把你公司的网络连到
Internet Serivce Provider.
然后中间走
Internet.你再在两边
router上设
VPN(Virtual Private Network).
随着
Internet越来越普及,所以
Frame Relay的生意将会越来越萧条。


Frame Relay的设备有两种: DTE和
DCE。


DTE(Data terminal equipment)是用户的节点。比如
terminals, personal computers, routers, and bridges.


DTE(Data circuit-terminating equipment)是提供
frame relay 传输的公司的设备。一般来说,
packet switches会

DTE. (虽然
routers 或其他的设备也可以设成
DCE)。


DTE and DCE devices are logical entities. That is, DTE devices initiate
a communications exchange, and DCE devices respond


code:


Digital Phone line frame relay Cloud
Router--DSU/CSU--------------------------CO-------//-------CO
|


Router --DSU/CSU --------------

CO: Central Office,离你最近的提供
frame relay的
office
DSU/CSU 是作为
T1的
layer 1 device
Demarcation(demarc): 就是提供
Frame
relay的公司的线路和你公司自己的线路的交接点。

demarc point 到
center office那一段叫做
local loop. 从
demarc point
到自己的网络里面的所有的
device都叫做
CPE(Customer Premise Equipment)
DLCI(Data Link Connection Identifier),类似于
MAC address, 是
frame relay里面用的
address.

Frame Relay Virtual Circuits(VC)

实际上就是两个
DTE之间
logical connection. 它是
connection-oriented.


DLCI number在
Cisco router里面支持的是从
16-1007。


Global DLCI number. global DLCI

number就象你自己家的电话号码。
Local DLCI number, 就是你要
call的
DLCI number, 这也是你在
router上设
VC时候要
confiugre的
number.


RouterA ----------- RouterB
20 21
假设你
routerA的
global DLCI number是
20。 routerB的
global DLCI number是
21。
如果你在
routerA上面要和
router B连接,你要建立一个
VC.这个时候,你要
dial router B

DLCI number, 也就是
21。所以这
21就是
routerA的
local DLCI number.


DLCI number是
work 在
layer 2的。而
IP address是
work

layer3的,所以可以用下面的
mapping 把
IP address map 到
DLCI number.



router设置的时候,只要设置
local DLCI number,而
global DLCI number是
frame relay company 控制的。你

router上不用设置。


code:


RouterA ----------------- RouterB
20 21

1.1.1.1 1.1.1.2

routerA按下面的方式设置:


RouterA(config-if)#frame-relay map 1.1.1.2 21


你也可以让
Local Management Interface (LMI) 来自动进行
layer3到
layer2的转换。


LMI是由
Cisco Systems, StrataCom, Northern Telecom, and Digital Equipment Corporation四家公司制度的。


Frame relay有两种
encapsulation types: Cisco (default) and IETF如果你连接两台
Cisco router,可以用
Cisco,
而如果和其它方的
router连接,要用
IETF。


RouterB(config)#int s0/0
RouterB(config-if)
#encapsulation frame-relay ?
ieft Use RFC1490 encapsulation



LMI type有下面几种,在新的
IOS里面,都是自动
detect的。所以没有必要设置。


RouterB(config-if)#frame-relay lmi-type ?
cisco ansi q933a

RouterB(config)#int s0/0
RouterB(config-if)#encapsulation frame-relay
RouterB(config-if)#frame-relay interface-dlci 51
RouterB(config-fr-dlci)#exit
RouterB(config)#^Z

由于用了
DLCI,所以不用做人工
mapping了。


PPP

PPP实际上是用了
HDLC的
encapsulation. 然后加上了
LCP和
NCP的支持。
Link Control Protocol (LCP) -- An extensible LCP is used to establish, configure, and test the data link
connection

- Authentication using either PAP (Password Authentication Protocol) or CHAP (Challenge-Handshake
Authentication Protocol)
- Data compression
Network Control Protocols (NCPs) -- A family of NCPs are used to establish and configure different network
layer protocols.

RouterA --- RouterB

RouterA(config)#int s0
RouterA(config-if)#encapsulation ppp
RouterA(config-if)#ppp authentication chap
RouterA(config-if)#exit
RouterA(config)#username RouterB password meetchinese
RouterA(config)#^z

这里的
user password 两边必须是一样的。
这里的
RouterB是对方的
router的名字。


ISDN

2B +D channel. B channel 是
64K。 D channel 是
16K。
ISDN可以用
PPP, HDLC or LAPD 作为 encapsulation protocol

TE

2 + TA = TE1

ISDN reference points有下面几种:


R reference point
S reference point
T reference point
U reference point
从左往右是按
RSTU字母排列的。
code:

TE1 --- NT2 --- NT1 -- ISDN network -- NT1 -- NT2 --TE1
| | |
S T U

TE2 -- TA---NT2 --- NT1 ---ISDN network -- NT1 -- NT2 --TA--TE2
| | | |
R S T U

ISDN Protocol有下面三种


E protocols apply to ISDN on an existing telephone network
I protocols deal with concepts, terminology, and services
Q protocols deal with switching and signaling

ISDN configuration:

Router(config)#isdn switch-type dms-100
Router(config)#int bri
Router(config-if)#encapsulation ppp
Router(config-if)#isdn spid1 555555111101
Router(config-if)#isdn spid2 555555222202
Router(config-if)#exit
Router(config)#^z

Password recovery

其实在
CCNA的考试里面相关的题目很少,但是因为也许大家在实际的
configuration里面会碰到,所以顺便讲一讲。


Configuration register是一个
16位的
register. register是寄存器,里面可以放计算机的指令或数据。寄存器根据你
operating system的不同,会是
8位,16位,32位,或
64位的。在
Cisco的
router里面,是
16位的。对于
password
recovery 来说,比较关键的是最右边的四位,这四位也叫做
boot field.
0x0:
Use ROM Monitor Mode
0x1:
Boot from ROM (IOS subset)
0x2-0xF:Examine NVRM (start-config) for 'boot system' commands

如果你有
boot system command, 你可以用下面的命令从不同的地方
boot起来。


boot system flash
boot system tftp ...

如果你在
config t 里面敲上面的命令,
^Z出来后,
copy run start, 你下次启动的时候就会从你希望的
device boot起
来。如果你在
config t里面没有指定
boot system, by default, 那么系统就会
boot system flash.

要看
config register里面的内容,敲下面的命令:


router>sh version

最后一行:


configuration register is 0x2102

因为我们要看最右边的四位,boot field, 在上面的例子来看: boot field 是
2。那么就会从
start-config boot. 如果你

config 里面没有设定,就会从
flash里面启动。

如果你要改变
config register的
setting, 你要敲
'config-register 0x2102' in Global Config Mode.

2500 password recovery

1. 必须有
console connection.
2. sh version ,一般会是
0x2102 或
0x102
3. reboot the router
4. 60秒内按一下 Break Key (有些键盘会是
SHIFT-Break, Ctrl-Break) 进入
ROM monitor mode.
5. 我们最后的目的是要到
globle config 里面修改
password, 但首先要让
router skip the start-up config.要实行这
点,就要把
config register的第
7位从
0变成
1。
6. 在'>' prompt,type 'o/r 0x42' to boot from flash or 'o/r 0x41' to boot from ROM.
7. Type 'i' to reboot

the router.
8. Because the Config Register is now 0x2142, it will load the IOS only and bypass the startup
configuration file. Once it boots up, answer N to all the Setup questions.
9. Type 'enable' at the 'Router>' to enter the Priviliged Mode 'Router#'.
10. View the password setting in the startup-config file. You can change it in the Global Configuration mode.
Save the change by 'copy run start'.
11. Use 'config-register 0x2102' in Global Config Mode to change the setting of the Config Register back to

its original value.

12. Use 'reload' to reboot the router.
其实每个系统的
password recovery都不一样的,在
1600,2600 下的
password recovery的过程是这样的。大家在具

configure的时候,多看看手册就好了,没有必要死记下面的步骤。但是如果把原理搞懂后再看步骤,多想想每一步在
干什么,

对你还是会有许多的帮助的。

在进入
ROM monitor mode后


1. Type 'confreg' at the 'rommon>' prompt.
2. Answer Y to the question 'Do you wish to change configuration [y/n]?'.
3. Answer N to all configuration change questions, except 'ignore system config info [y/n]?', to which you
should answer Y.
4. Save your change by answering the last question 'change boot characteristics [y/n]?' by Y.
5. At the 'enter to boot:' prompt, type '2' followed by a carriage return. Type '1' if Flash is erased.
6. A configuration summary is printed. Answer N to the question 'Do you wish to change configuration
[y/n]?'.
7. Type 'reset' to reboot your router.
8. Because the Config Register is now 0x2142, it will load the IOS only and bypass the startup
configuration file. Once it boots up, answer N to all the Setup questions.
9. Type 'enable' at the 'Router>' to enter the Priviliged Mode 'Router#'.
10. View the password setting in the startup-config file. You can change it in the Global Configuration mode.
Save the change by 'copy run start'.
11. Use 'config-register 0x2102' in Global Config Mode to change the setting of the Config Register back to
its original value.
12. Use 'reload' to reboot the router.
CCNA 2.0 培训扎记 (一到七)虽然已经覆盖了
70-80%的考试内容,但如果要参加考试,建议大家还是要根据培训札记的
内容,扩展开去,多看看书,多练习练习。另外
CCNA考试的标准答案是基于
IOS 12.0的,如果你的
router还是低的
版本,最好能更新到
12.0

当然如果要通过考试,做题还是需要的,下面是一些如何边做题,边提高自己技术水平的一些技巧。

一、一定要多动手,不要盲从书本。有的时候,写书的人只在
IOS的低版本上做过实验,即使
CCNA升级到 2.0,他们
把以前的东西就拿过来,作为
2.0的内容。这样他提供的答案很有可能是错的,所以希望大家在有可能的情况下,尽量多
动手实验实验。

比如说下面

这题:


Which command configures a router to load system image "beta" from a
TFTP server?

A) boot system tftp 139.2.3.4 beta
B) boot ios tftp beta 139.2.3.4
C) boot system tftp beta 139.2.3.4
D) boot ios tftp 139.2.3.4 beta
ANSWER: C
In IOS 12.0 , the answer should be C. Some text book provided A as the correct answer. it is wrong.所以一定

要自己动手做实验才行。

二、不仅要知道为什么答案是对的,更要清楚卫生答案是错的。这样才能真正学到东西。而且可以起到举一反三的作用。


Which statement is true about presentation layer?

A) It does addressing
B) It accesses physical media
C) It is responsible for initiating, maintaining and terminating
sessions
D) It provides a common representation of application information
while the information is in transit between two cooperating computer
systems


ANSWER: D
如果你不仅能够知道
D是标准答案,还能知道
ABC对应于什么
layer,那你做其它类似的问题就会更加得心应手了。


A-->Network layer or datalink layer
B-->datalink layer
C-->session layer

再举个例子:


What is the function of ICMP protocol? (Choose two answers)


A) To map IP address to Ethernet address
B) To map common names to network address
C) To forward SNMP alerts to management consoles
D) To generate an echo reply in response to a ping test
E) To send a host or port unreachable message from a router to the
source of an undeliverable packet


ANSWER: DE
ARP maps IP address to Ethernet address, answer A is wrong.
DNS maps common names to network address, answer B is wrong.
ICMP has nothing to do with the SNMP, answer C is wrong.


如果你能对每一道题都能这样认真对待的话,考试通过不会成问题。

三、区分考试和复习

考试中间是需要做的越快越好,而在复习的时候,要越仔细越好。除了能找到标准答案外,还要把问题里面涉及的所有的
概念都弄清楚。比如说下面这题:


Which of the following statment is true?

A) never connect a router with a U interface into an NT1
B) always connect a router with a U interface into an NT1
C) if you see a connector labeled BRI, your router is a TE1
D) if you see a connector labeled BRI, your router is a TE2
ANSWER:A
If you already have a U interface, NT1 is built in the router, you need to directly connect the router to the
ISDN switch.

如果不是很清楚的话,可以再看看培训札记(六)以及有关的教程。


[现在还没有决定是否还会写(八),也许会再写一些考试中会遇到的,但培训札记里面没有提到的东西。但有的时候为了一
道题目,可能涉及的内容会非常的多,所以还没决定是否会继续写下去。同时也谢谢大家对培训札记的鼓励和意见。反正
不管怎么样,我会常来
C isco论坛,和大

家一起学习,一起进步的。]



相关主题