1、CCNA 知识点什么是 Cisco? (一) Cisco 是 San Fransico 的简称,cisco http:/ 是最大的网络设备公司。Cisco 以 router 起家,现在的 revenue 里面,router 占 40%,switch 占 40%, service 占 20%. Cisco 靠着兼并正成为一个全方位提供网络设备的公司。 什么是 CCNA? CCNA 是 Cisco Certified Network Associate 的缩写。要参加 CCNA 的考试,最好手头有一张 Cisco 的document CD.如果没有,可以上网直接访问:http:/ 考过 CCNA
2、后,还可以参加更高级的 CCNP 的考试,CCNP 需要考 4 门。会比 CCNA 难的多。再往上就是最值钱的 CCIE。 如果你取得了 CCIE 的证书,拿个几十万美金的年薪并不为奇。CCIE 有笔试和 lab 两部份。其实 CCIE 的笔试比 CCNP 容易,而且考的许多知识大多是 4 、5 年前的技术,比较旧了。但 lab 考试非常的难,要考两天。现在全世界就两个考点,其中一个在 San Jose. 如果现在报名的话,要等 4 个月才能参加考试。 OSI Reference Model 其实 OSI model 等的基本网络的概念在 MCSE 考试中都已经学过了。所以我们一般建议大家参加
3、完 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
4、, 如果有什么不懂的,可以去查 document CD. 要区分 physical address 和 logical address 的区别。physical address 就是 MAC address, 你可以在command prompt 里面敲: arp -a 纯吹組 AC address. 而 logical address 是 IP address 或 IPX address. physical address 工作在 datalink layer, 而 logical address work 在 network layer. 以下是一些考试中会遇到的 component 和
5、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
6、, 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 和 connect
7、ionless 的区别 connection oriented 是在连接前先建立 connection, 这样保证了数据传输的 reliability. 而 connectionless是不建立 连接就传输。所以 connectionless 有更少的 overhead,但不能保证数据的 reliablity. 所以我们传 E-mail 要用 connection oriented 的 protocol, 而网上听歌,因为速度更重要,丢几个 packets 没关系,可以用 connectionless 的protocol. 在常见的 protocol 里面, TCP 是 connection-
8、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, 是最常用的,其实你在网上传数据,一般都是
9、先写到 buffer 里面,然后再传送的。如果你会winsocket 编程, 你会发觉其实写个 network 的 application 还是很简单的。只要懂得如何往 buffer 里面写东西就好了,其它的全由 system 来做 了。 :P 2. Source quench, 就是接收方让发送方减慢传输速度。 3. Windowing, 如果学过 networking 或 MCSE, 对 sliding window 应该有所了解。其实 windowing 就是你发 n 个 packets 后返回一个信息,告诉发送方这几个 packets 已经收到了,如果到一定时候没有收到这return
10、的 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. 连接多
11、个不同的 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 上。 (二) Microsoft 的 operating system 叫 Windows, Cisco 的
12、 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: 其实就是
13、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
14、 应该不用介绍了吧? :P 一般 Cisco 的 router 都有扩展口, 你可以把 WIC (WAN interface card)插进去的。你可以根据你网络的需求,订购不同的 WIC。 这设置 router 的时候,一般用 s0 代表 第一个 serial port. e0 代表第一个 ethernet port. con0 代表第一个 console port. Cisco router 的命名是按从右往左,从下往上的顺序排列的。比如你有两个 ethernet port, 左边那个就是e1, 右边那个就是 e0. 如果这两个 ethernet port 是上下排列的,下面那个就是 e0
15、, 上面那个就是 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
16、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
17、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
18、 Interface). CLI 的特点是比较难学,但 configure 起来比较快。现在 Cisco 也正在做 Java 的 GUI-based configuration software, 但大家还是喜欢 CLI 的。 要通过 CCNA 的考试,要三台 router 进行练习,如果没有条件的网友,可以找 routersim 等软件进行练习。configure router 的时候,一般是用 console cable 连到 console port 上的。然后用 WIndows 下的HyperTerminal 进行 configure. 如果你有许多台的 router, 你也可以把他们
19、的 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 才是 c
20、onfiguration 的关键。不少的 router 不用 password 都可以进入。而从 user mode 到 privileged mode 是一定要设 password 的。从 user mode 到 privileged mode, 你打 enable 或 en 就可以了。系统会问你 password, 你敲入正确的password 就可以进入了。 从 privileged 到 mode user mode, 你要打 disable。 看上面的图,如果你在 user mode, 提示符是 ,而如果是 privileged mode, 提示符是 #。 所以你设router 的时候
21、可以根据前面是 还是 #来确定自己在什么 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
22、 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 - Int
23、erface-Specific Configuration Mode 再一步一步退出的演示。 login 到 router 后,大家可以先练习一下如果修改 password, 但一定要注意的是 因为你可以通过不同的方式连到 cisco router 上,所以大家一定要区分开你改的是哪个的 password. 下面的命令把你的 privileged mode 的 password 改成了 meetchinese. 在 Cisco router 里面,在 memory 的 configuration 叫做 run , 在 NVRAM 里面的 configuration 叫做 start.你的所有
24、configuration 都先存在 memory 里面。 因为 memory 里面的东西关机后就会消失,你可以用 copy run start 命令把 memory 里面的 configuration 存盘。当然你也可以用 copy start run 命令把NVRAM 里面的东西 copy 到 memory 里面。大家要注意的是 copy start run 并不是把所有 memory 里面的东西都去掉,只留下 NVRAM 里面 configuration 的东西,而只是有相同的 configuaration 进行覆盖。 等你把 password 设好后,可以在 priviledge mo
25、de 里面敲 sh run 看你现在的 configuration. 你会发现现在的密码没有加密,直接显示出来的,这样是很危险的。 你可以用 enable secret 来把 password encry 了。然后你再敲 sh run ,就会看见 encrypted password. 如果你不想用 encrypted 的 password, 敲 no enable secret 就好。 *做完所有的 configuration, 千万别忘了用 copy run start 存盘。 如果你要修改进入 console 的 password, 可以用蟧 router 和 TFTP server 进
26、行通讯。 #copy tftp flash 以上命令把 TFTP server 上的 IOS img load 到 Cisco router 上。 对于系统管理员,你也可以 用下面的命令把你 router 里面的 IOS 备份。 #copy flash tftp CDP (Cisco Discovery Protocol) 你刚启动 router 的时候,可能里面什么都没有设, 这 CDP 可以让你看你邻居的 router 的情况。 / (三) 在 CCNA 考试中,要分清楚下面的 devices 在什么 layer 工作。 Layer 3 devices: router Layer 2 de
27、vices: Switch, 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 t
28、wo 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
29、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,
30、 switch works. If you dont 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 mor
31、e 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
32、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 m
33、ultiple pathes, however, a bridge only supports spanning-tree. 区分 Switch 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 suppor
34、ts 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 band
35、width 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) 如果你有多个
36、 switch 的话,如果你网络设计的时候有 loop 的时候,packets 会一直在网络里面循环的传,产生 broadcast storm.请比较一下用 router 连的 network, 因为有 TTL (time to live)这个参数,所以到一定的时候 packets 就自动丢掉了。而 switch 的 network 里面没有 TTL 这个概念,所以如果你在 switch network 里面如果有 loop 的话,就会一直传下去。 所以一般设计的时候采用 spanning -tree 的结构。但是 spanning-tree 没有 fault-tolernce, 所以用spa
37、nning-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 networ
38、k 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 连
39、接支持 trunk link.Cisco 的 switch 支持 trunk link,但不是所有的 switch 都支持的。所以并不是所有的 switch 都支持 VLAN。 Switch switch trunk link is a configuration in switch.use 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 = ne
40、twork ID + subnet ID + host ID | | network ID | subnet ID | host ID | | 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 i
41、s 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 dont need to have one network ID for each network
42、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 进
43、制转 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
44、 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 spec
45、ific, you need to go to interface Routernable 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
46、 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 要让你
47、人工的 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 addres
48、s. 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
49、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