CCIE总结:路由器、交换机
- bbs.spoto.net/forum--.html -----雏鹰部落
- GNS3安装
- 、安装的所有目录不能使用中文
- ISO如何操作
- securecrt如何使用建立会话:之前总是连不上的原因是没有选 telnet协议,而不是ssh协议,要注意。
- cmd如何进入GNS3模式:telnet localhost
- GNS3使用过程以及两个路由怎样连接
- 打开软件--添加镜像(c3640-jk9o3s-mz.-13a)--计算IDLE值直到出现*号选择即可,目的是降低cpu使用率在10%以下才可以--暂停双击--添加快速以太网口--add a link--两个路由连接起来
- 命令+?=查看帮助
- 用户模式:》 输入exit 可以退出
- 特权模式:# 输入enable进入特权模式
- 全局模式(router(config)#模式--更高一级):输入configure terminal特权模式
- 全局模式退出:end 到上一级,exit 到用户模式
- pc4(config)#default interface f / ------还原默认配置
- 配置console密码,下次再插console就得输入密码
- R1(config)#line console 0 ---进入接口
- R1(config)#password spoto
- R1(config-line)#login 当其他设备连接这台设备时需要密码验证
- R1(config-line)#no login
- R1(config-line)#no pas spoto
- 用户模式-特权模式 设置密码
- 到特权模式下
- R1(config)#enable secret spoto
- VTY口令-用于限制人员通过telnet访问设备,设备第一次现场调试,以后要通过远程telnet调试,
- 实验:
- R1作为被调试的设备,R2去登陆R1调试
- R1(config)#line vty 0 4 vty:虚拟通道 0-4:要开5个通道
- R1(config-line)#password spototelnet
- R1#sh ip int
- R1#sh ip int b
- R1#conf t
- R1(config)#int f /
- R1(config-if)#ip add 1.1.1.1 255.255.255.0
- R1(config-if)#no sh
- R1(config-if)#no shutdown
- R2(config)#int f /
- R2(config-if)#ip add 1.1.1.2 255.255.255.0
- R2(config-if)#no sh
- R2(config-if)#no shutdown
- R1(config-if)#ping 1.1.1.2 ---------这个模式报错--Ping测试要在特权模式下
- ^
- % Invalid input detected at '^' marker
- R1#ping 1.1.1.2
- Type escape sequence to abort.
- Sending , -byte ICMP Echos to 1.1.1.2, timeout is seconds:
- .!!!!
- Success rate is percent (/), round-trip min/avg/max = // ms
- R2#telnet 1.1.1.1 -------------注意是特权模式下
- Trying 1.1.1.1 ... Open
- User Access Verification
- Password:
- % Password: timeout expired!
- Password: spototelnet
- R1>enable
- Password:spoto
- R1#
- 查看当前所有配置
- R1#show running-config ---注意在特权模式下 --保存在内存里面 即RAM里面,重启后会清空
- start-up-config 存储在NVRA里面 现在设备都放在flash里面 保存在这里面--再重启不丢失
- 保存配置 第一种
- R1#write
- Building configuration...
- [OK]
- 保存配置 第二种
- R1#copy running-config startup-config
- Destination filename [startup-config]?
- Building configuration...
- [OK]
- 清空配置
- R1#erase startup-config 针对旧设备, 都对当前配置没有影响,重启后才生效
- R1#delete flash:config.text 现在设备 都对当前配置没有影响,重启后才生效
- 配IP步骤:
- 先进入:用户模式-》特权模式-》全局模式-》进入接口
- 接口区分:如果一台设备有两个插槽,第一个插槽编号是0,第二个插槽编号是1。第一个插槽里面只有一个接口编号是0;第二个插槽里面有两个接口编号,一个是0,一个是1,
- 一、配置以太网接口(就是以太网链路)--基于8..3标准走,用的ARP协议
- 进入普通10M以太网口
- interface ethernet / -----进入第一个插槽编号,第0个接口
- interface ethernet / -----进入第二个插槽编号,第0个接口
- interface ethernet / -----进入第二个插槽编号,第1个接口
- ethernet / 第一个0表示10M 整个意思:10M以太网口
- 进入快速以太网口
- interface fast-ethernet /
- 添加ip
- R1(config-if)#ip add 1.1.1.1 255.255.255.0
- 激活接口--------思科设备默认是关闭的
- R1(config-if)#no shutdown
- 实验:
- R1#conf terminal
- R1(config)#interface fastEthernet /
- R1(config-if)#ip address 192.168.1.1 255.255.255.0 -----提示符已变成 -if
- R1(config-if)#no shutdown
- R1(config-if)#end
- R1#
- R2#configure terminal
- R2(config)#interface f / interface s /
- R2(config-if)#ip address 192.168.1.2 255.255.255.0
- R2(config-if)#no shutdown
- R2(config-if)#end
- R2#
- Ping测试要在特权模式下
- R1#ping 192.168.1.2
- Type escape sequence to abort.
- Sending , -byte ICMP Echos to 192.168.1.2, timeout is seconds:
- .!!!! ------5个包,第一个包超时
- Success rate is percent (/), round-trip min/avg/max = // ms
- R1#ping 192.168.1.2
- Type escape sequence to abort.
- Sending , -byte ICMP Echos to 192.168.1.2, timeout is seconds:
- !!!!!
- Success rate is percent (/), round-trip min/avg/max = // ms
- 二、配置serial接口(就是串行接口) (就是串行链路)(广域网链路)
- DCE端
- R1(config)#interface serial /
- R1(config-if)#ip address 192.168.1.1 255.255.255.0
- R1(config-if)#no shutdown
- R1(config)#clock rate 在DCE端配置时钟信号。时钟信号在运营商,用户是DTE端,线缆两头分别写着DCE和DTE,做模拟实验,需要一端模拟运营商,
- DTE端不用配时钟
- R1(config)#interface serial /
- R1(config-if)#ip address 192.168.1.2 255.255.255.0
- R1(config-if)#no shutdown
- 查看具体接口配置信息
- R1#show interfaces f0/ ----------注意模式
- FastEthernet0/ is up, line protocol is up ----物理接口和协议都是up
- Hardware is AmdFE, address is cc00.0b00. (bia cc00.0b00.) ---快速以太网口和MAC地
- Internet address is 192.168.1.1/
- MTU bytes, BW Kbit, DLY usec, BW-带宽是100M, DLY--延迟
- reliability /, txload /, rxload /
- Encapsulation ARPA, loopback not set
- R1#show ip int brief ------查看哪些接口配了哪些ip
- Interface IP-Address OK? Method Status Protocol
- FastEthernet0/ 192.168.1.1 YES manual up up
- YES manual up---------是物理状态,如果连接路由器的线断了就是down了,
- Protocol up---------是协议状态,如果没有配置时钟信号,就是down
- 路由选择原理;静态路由(S),直连路由(C)
- R1#show ip route
- C 192.168.1.0/ is directly connected, FastEthernet0/
- C:表示通过什么渠道获得,比如手工配置,C是直连,。S是手工配置的静态的
- 192.168.1.0/ :表示目标地址
- FastEthernet0/ :表示从哪出去,从接口出去还是吓一跳扔给谁。
- 直连路由:路由接口配完IP后,接口激活,且双up:物理和协议都up,就会学习到紧邻路由的网络号,如:192.168.2.0/, ---C
- 静态路由:人工建表,指定去哪个网段,如果去的网段号很多,就得配好多表,--适合中小型网络。
- 动态路由:两个路由之间相互对话,从而学到远端路由所知道的,比如3.;4.0;.0等网段。
- 直连路由的获取:两端路由只能知道一侧的路由,中间的路由可以知道紧邻两侧的路由信息。
- 静态路由配置: PC->网关->目的路由->目的路由后面是公网
- 需要人工配置告诉网关去往目的地的路由信息,即网络号
- 静态路由配置两种方式
- R1(config)#ip route 192.168.1.0 255.255.255.255. 192.168.12.1 192.168..0指的是公网IP 192.168..1指的是和目的路由器相连的左边的IP.------叫做扔给对端IP
- R1(config)#ip route 192.168.1.0 255.255.255.255. serial serial 0指的是网关紧挨着右边的接口 --------叫做扔给本地接口。
- 通信是双向的,还需要配置回来的路由信息,也是这样的,
- 实验:
- PC-> R1路由->R2路由->R3目的路由->目的路由后面的公网
- -( R1路由)-S0/ 192.168.12.1/
- 192.168.12.2/ S0/-( R2路由)-S0/ 192.16823./
- 192.168.23.3/ S0/-( R3路由)
- R1(config)#ip route 192.168.23.0 255.255.255.0 192.168.12.2
- R3(config)#ip route 192.168.12.0 255.255.255.255. serial s0/
- 192.168.12.2------叫做扔给对端IP
- serial s0/0指的是网关紧挨着右边的接口 --------叫做扔给本地接口。
- 通信是双向的,还需要配置回来的路由信息,也是这样的,
- 默认路由 表示符号:S*
- 实验(紧接着上面):PC-> R1路由->R2路由--后面接着好多网段IP,有1.;2.0;3.0;4.0;多个隔离网络
- R1(config)#ip route 0.0.0.0 0.0.0.0 192.168.12.2 192.168..2相当于默认网关。
- telnet七层访问构造 客户 A---网关路由---远端路由---客户 B
- 源端口是一个随机端口,目的端口一定是23端口。
- osi七层:-5层不重要,4层把端口号封装TCP头部,然后建立三次握手连接在四层,源端口是一个随机端口,目的端口一定是23端口;3层报头加IP,源IP和目的IP;2层是帧头,加上源mac和目标网关路由mac地址(mac只能在本地LAN有效)。A要把数据发给B,必须得先发给网关,所以必须得知道网关的mac地址。
- A通过地址解析协议发送广播给网关,网关收到后再回一个给A,A就会更新它的mac表,然后加上源mac和目标网关路由mac地址,最后变成10100的字样传给网关路由,网关收到后拆到第三层漏出IP,如果发现不是给自己的,就原封不动的打包回去,但是他要帮客户送出去,但是查了查路由没有到远端的路由表,所以我们就配置静态路由的方法告诉他怎么走。到远端路由后要拆封到帧,填上自己的mac地址和客户B的mac地址,所以也要广播得到,然后送给B计算机,B也要一层层拆,拆到应用层,看是23端口号,是telnet程序,所以就丢给了telnet程序处理。
- 同理B回包的时候也得走这个过程。
- cmd里面输入 :arp -a 得到所有的mac地址。
- lookback接口是虚拟接口,是个软件接口跟物理接口一样,可以配置IP地址。当物理接口不够用时,就可以用lookback接口。所以要开启这个、
- 静态路由坏处:当有好多个路由时,基本每个路由都要配路由表,会很忙,而且有一个远端路由坏掉时 ,也不是道。
- 动态路由协议
- --------动态的更新,是一个对话。
- 静态路由坏处:当有好多个路由时,基本每个路由都要配路由表,会很忙,而且有一个远端路由坏掉时 ,也不是道。
- 动态路由坏处:需要占用一定的cpu等资源,会占用一定带宽,但对网络不会造成太大影响
- 动网路由协议分类:内部网关协议和外部网关协议。
- AS号:自治系统,-自我管理
- AS号内部---------选择内部网关协议
- 不同AS之间---------选择外部网关协议--------比如两个跨国公司之间,---比如两个农业银行之间
- 内部网关协议包括:、距离矢量协议 、链路状态协议
- 外部网关协议包括:BGP--适用于超大型网络
- 距离矢量协议
- 距离矢量协议包括:、RIPV1和RIPV2 、EIGRP
- 距离指的跳数--hop 一跳要跨越一台路由器,比如 R1要通过 R2 跨越2.0网段,这就是垮了一跳,以条数衡量一条路由的好坏,
- 矢量:R2要通告给R1,R1要经过R2,这就是方向
- 一旦两台路由之间运行协议,路由就会更新自己的路由表,进行对话,周期性的更新,
- 更新方式:采用广播, 缺点:对链路和设备造成损耗,
- 收敛完成的意思:动态路由学习完毕
- 收敛分两步:、初次路由信息交换,进一步交欢
- 度量值(Metric):衡量一条路由的好和坏 ----附图见网盘--动态路由--距离矢量路由协议。就是说路由 --------前提在同一协议中做比较A连接了两个分支路由。
- -A-B-E-1.0 ---------A到1.0经过了2跳 --------更忧 来源-RIP,网络号,viaB
- -A-C-D-E-1.0 --------A到1.0经过了3跳
- 这样以后都会走更忧的路径,但是当2跳的任何地方出了问题,就会选择3跳的路径
- 度量值(Metric):同一台路由器收到多条去往同一个目的地的路由,会比较Metric值,Metric值忧的会被装进路由表,注:Metric值有比较条数的,有比较带宽的。如果两个Metric都相同就会同时使用,这就是负载均衡,
- RIP缺点:当3跳的那条链路带宽比2跳的那条链路带宽大时,就是浪费,---附图见网盘--动态路由--距离矢量路由协议
- 冗余:自动切换链路,当有一个链路挂掉时候,而静态的路由是无法自动切换的。
- 查看度量值(Metric):show ip route ------附图见网盘--动态路由--距离矢量路由协议
- Metric:在同一协议中做比较
- 管理距离(AD值):指的是不同动态协议之间做比较选择最优路径。
- 总结:
- 一台路由器,当它从两种不同的动态路由协议选择协议中,学习到去往同一个目的地的路由,比较AD值。取信小的将路由装入路由表,进行数据转发,另一条路径,只有当优选的路径DOWN掉的时候,才会出现和使用;
- 一台路由器,当它从同种动态路由协议,但不同方向(邻居)学习 去往同一个目的地的路由,则比较metric度量值,选择忧的,装入路由表,进行数据转发。
- 依照传闻的更新方式(广播、更新路由表) -----容易被骗,容易产生环路
- 逐跳更新
- 环路的产生:-A-B-C-
- 当C右端链路断掉时。但是仍然周期性的更新,当有pc访问C时,C告诉走B,B再告诉走C,往复循环,直到跑死,------------附图见网盘--动态路由--距离矢
- 还有达到无穷大
- 量路由协议
- 消除环路的方法: A-B-C-x
- 、定义最大度量值防止计数至无穷大(最大跳数) ----这是RIP的最大上限
- 、水平分隔 --附图见网盘--动态路由--距离矢
- 、抑制计时器:抑制计时器:远端出问题时,B和C先启动计时器。观察,如果恢复,就继续使用
- 、路由中毒 ---路由无穷大--就是不可达-----泛红出去------附图见网盘--动态路由--距离矢
- 、毒性逆转 :带有路由中毒的水平分隔,:C告诉B路由不可达,B也告诉C我知道路由不可达,并等待C右边的线路好
- 、触发更新:拓扑发送变化时,路由立即发送更新消息
- RIP:适用于金融行业,
- 基于UDP,端口520的应用层协议。
- 管理距离120
- RIP实验
- R1 R2 R3
- 如果有多个路由,依次宣告自己的网络号即可
- R1#conf t
- R1(config)#interface S /
- R1(config-if)#ip address 192.168.12.1 255.255.255.0
- R1(config-if)#no sh
- R1#ping 192.168.12.2
- Type escape sequence to abort.
- Sending , -byte ICMP Echos to 192.168.12.2, timeout is seconds:
- !!!!!
- Success rate is percent (/), round-trip min/avg/max = // ms
- R1#ping 192.168.23.3
- Type escape sequence to abort.
- Sending , -byte ICMP Echos to 192.168.23.3, timeout is seconds:
- .....
- Success rate is percent (/)
- R1#conf t
- R1(config)#router rip
- R1(config-router)#network 192.168.12.0
- R1(config-router)#end
- R1#sh ip ro
- Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
- D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
- N1 - OSPF NSSA external type , N2 - OSPF NSSA external type
- E1 - OSPF external type , E2 - OSPF external type
- i - IS-IS, su - IS-IS summary, L1 - IS-IS level-, L2 - IS-IS level-
- ia - IS-IS inter area, * - candidate default, U - per-user static route
- o - ODR, P - periodic downloaded static route
- Gateway of last resort is not set
- C 192.168.12.0/ is directly connected, Serial0/
- (配置Rip后)
- R1#ping 192.168.23.3
- Type escape sequence to abort.
- Sending , -byte ICMP Echos to 192.168.23.3, timeout is seconds:
- .....
- Success rate is percent (/)
- R2#configure t
- R2(config)#int s /
- R2(config-if)#ip address 192.168.12.2 255.255.255.0
- R2(config-if)#no sh
- R2(config-if)#int s /
- R2(config-if)#ip address 192.168.23.2 255.255.255.0
- R2(config-if)#no sh
- R2(config)#end
- R2#sh ip int b
- R2#ping 192.168.23.3
- Type escape sequence to abort.
- Sending , -byte ICMP Echos to 192.168.23.3, timeout is seconds:
- !!!!!
- Success rate is percent (/), round-trip min/avg/max = // ms
- R2#conf t
- R2(config)#router rip
- R2(config-router)#net
- R2(config-router)#network 192.168.12.0
- R2(config-router)#network 192.168.23.0
- R3#conf t
- R3(config)#int s /
- R3(config-if)#ip address 192.168.23.3 255.255.255.0
- R3(config-if)#no sh
- R3(config-if)#end
- R3#conf t
- R3(config)#router rip
- R3(config-router)#network 192.168.23.0
- R3(config-router)#end
- R3#sh ip ro
- Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
- D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
- N1 - OSPF NSSA external type , N2 - OSPF NSSA external type
- E1 - OSPF external type , E2 - OSPF external type
- i - IS-IS, su - IS-IS summary, L1 - IS-IS level-, L2 - IS-IS level-
- ia - IS-IS inter area, * - candidate default, U - per-user static route
- o - ODR, P - periodic downloaded static route
- Gateway of last resort is not set
- R 192.168.12.0/ [/] via 192.168.23.2, ::, Serial0/
- C 192.168.23.0/ is directly connected, Serial0/
- R3#ping 192.168.12.1
- Type escape sequence to abort.
- Sending , -byte ICMP Echos to 192.168.12.1, timeout is seconds:
- !!!!!
- Success rate is percent (/), round-trip min/avg/max = // ms
- EIGRP
- --增强型内部网关路由协议 --思科私有---只能在思科设备上运行--前身是IGRP
- RFC文档 ----规范 www.rfc
- 特点:收敛速度比较快,减少带宽浪费,(触发性更新)--当网络拓扑发送变化时才更新,
- 支持多种网络层协议,(ip,ipx,appletalk) ---见截图
- 无类路由:可以识别不同掩码
- 高级距离矢量协议:不只只是根据跳数,也可以根据带宽。
- %无环路,---DUAL算法
- 首先形成邻居表,再进行路由信息同步,然后启用DUAL算法,查看哪个更忧。
- 三种表:邻居表,拓扑表。路由表,
- 通过组播方式泛红:224.0..10发送
- metric计算==带宽+延迟 =BW+DLY BW=(10的7次方/带宽 )*
- DLY= ((延迟(微妙)/)*
- 带宽:沿路所有数据出接口带宽最低值,且是接口的带宽,而不是链路的带宽
- 延迟:沿路所有数据出接口延迟的和
- DUAL算法:提供无环路
- 后继路由器:就是选择metric最优的那条路的下一个路由器。
- 可行距离:本地到达目标地的metric值,(FD) 本地可以是A 可以是B
- 可行后继路由器:备份的那个 (FS)
- A-B-D-
- A-C-D-
- 通告距离:C通告给A到达目的地的D右面网段的距离,(AD)
- 可行后继成立的条件:C通告给A到达目的地的D右面网段的距离,(AD)要小于 A通过B到达D右面网段的距离。(FD)
- 路由更新和数据包的方向是相反的
- K值要相等
- EIGRP的配置
- AS:域,比如一个省份就是一个域,不同的AS用不同的号码区分,
- debug:一般不要开启,开启后会出现大量调试信息,有可能把设备跑坏,
- 自动汇总:防止远端网络号down掉的反复计算DUAL值协议默认开启汇总,
- 10.1.1.0/ 这是个子网 .网段是A类地址,进行了子网划分。
- 172.16.0.0/
- 192.168.12.0 是个主类地址,
- EIGRP的配置实验
- R1#conf t
- R1(config)#interface S /
- R1(config-if)#ip address 192.168.12.1 255.255.255.0
- R1(config-if)#no sh
- R1(config-if)#router eigrp
- R1(config-router)#network 192.168.12.0
- R1(config-router)#end
- R1#sh ip route
- Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
- D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
- N1 - OSPF NSSA external type , N2 - OSPF NSSA external type
- E1 - OSPF external type , E2 - OSPF external type
- i - IS-IS, su - IS-IS summary, L1 - IS-IS level-, L2 - IS-IS level-
- ia - IS-IS inter area, * - candidate default, U - per-user static route
- o - ODR, P - periodic downloaded static route
- Gateway of last resort is not set
- C 192.168.12.0/ is directly connected, Serial0/
- R2#configure t
- R2(config)#int s /
- R2(config-if)#ip address 192.168.12.2 255.255.255.0
- R2(config-if)#no sh
- R2(config-if)#
- *Mar ::13.543: %LINK--UPDOWN: Interface Serial0/, changed state to up
- R2(config-if)#
- *Mar ::14.547: %LINEPROTO--UPDOWN: Line protocol on Interface Serial0/, changed state to up
- R2(config-if)#in
- R2(config-if)#int lo0
- R2(config-if)#
- *Mar ::40.851: %LINEPROTO--UPDOWN: Line protocol on Interface Loopback0, changed state to up
- R2(config-if)#ip add 2.2.2.2 255.255.255.0
- R2(config-if)#no sh
- R2(config-if)#no shutdown
- R2(config-if)#router eigrp
- R2(config-router)#networ
- R2(config-router)#network 192.168.12.0
- R2(config-router)#
- *Mar ::40.487: %DUAL--NBRCHANGE: IP-EIGRP() : Neighbor 192.168.12.1 (Serial0/) is up: new adjacency
- R2(config-router)#netw
- R2(config-router)#network 2.2..
- R1#sh ip route
- Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
- D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
- N1 - OSPF NSSA external type , N2 - OSPF NSSA external type
- E1 - OSPF external type , E2 - OSPF external type
- i - IS-IS, su - IS-IS summary, L1 - IS-IS level-, L2 - IS-IS level-
- ia - IS-IS inter area, * - candidate default, U - per-user static route
- o - ODR, P - periodic downloaded static route
- Gateway of last resort is not set
- C 192.168.12.0/ is directly connected, Serial0/
- D 2.0.0.0/ [/] via 192.168.12.2, ::, Serial0/
- R1#show ip eigrp neighbors
- IP-EIGRP neighbors for process
- H Address Interface Hold Uptime SRTT RTO Q Seq
- (sec) (ms) Cnt Num
- 192.168.12.2 Se0/ ::
- R1#show ip eigrp neighbors
- IP-EIGRP neighbors for process
- H Address Interface Hold Uptime SRTT RTO Q Seq
- (sec) (ms) Cnt Num
- 192.168.12.2 Se0/ ::
- R1#show ip eigrp neighbors
- IP-EIGRP neighbors for process
- H Address Interface Hold Uptime SRTT RTO Q Seq
- (sec) (ms) Cnt Num
- 192.168.12.2 Se0/ ::
- R1#
- Connected to Dynamips VM "R1" (ID , type c3600) - Console port
- Press ENTER to get the prompt.
- R1#sh
- R1#show ip
- R1#show ip eifr
- R1#show ip eigrp
- R1#show ip eigrp nei
- R1#show ip eigrp neighbors
- IP-EIGRP neighbors for process
- H Address Interface Hold Uptime SRTT RTO Q Seq
- (sec) (ms) Cnt Num
- 192.168.12.2 Se0/ ::
- R1#show ip eigrp neighbors
- IP-EIGRP neighbors for process
- H Address Interface Hold Uptime SRTT RTO Q Seq
- (sec) (ms) Cnt Num
- 192.168.12.2 Se0/ ::
- R1#conf
- R1#configure t
- Enter configuration commands, one per line. End with CNTL/Z.
- R1(config)#int s /
- R1(config-if)#shu
- R1(config-if)#shutdown
- R1(config-if)#
- *Mar ::01.555: %DUAL--NBRCHANGE: IP-EIGRP() : Neighbor 192.168.12.2 (Serial0/) is down: interface down
- R1(config-if)#
- *Mar ::03.515: %LINK--CHANGED: Interface Serial0/, changed state to administratively down
- *Mar ::04.515: %LINEPROTO--UPDOWN: Line protocol on Interface Serial0/, changed state to down
- R1(config-if)#debu
- R1(config-if)#de
- R1(config-if)#debu
- R1(config-if)#debug ip eigr
- R1(config-if)#end
- R1#d
- *Mar ::59.195: %SYS--CONFIG_I: Configured from console by console
- R1#deb
- R1#debug ip eigr
- R1#debug ip eigrp ?
- <-> Autonomous System
- neighbor IP-EIGRP neighbor debugging
- notifications IP-EIGRP event notifications
- summary IP-EIGRP summary route processing
- vrf Select a VPN Routing/Forwarding instance
- <cr>
- R1#debug ip eigrp
- IP-EIGRP Route Events debugging is on
- R1#conf
- R1#configure t
- Enter configuration commands, one per line. End with CNTL/Z.
- R1(config)#int s /
- R1(config-if)#no shu
- R1(config-if)#no shutdown
- R1(config-if)#
- *Mar ::34.855: %LINK--UPDOWN: Interface Serial0/, changed state to up
- R1(config-if)#
- *Mar ::35.859: %LINEPROTO--UPDOWN: Line protocol on Interface Serial0/, changed state to up
- R1(config-if)#
- *Mar ::44.755: %DUAL--NBRCHANGE: IP-EIGRP() : Neighbor 192.168.12.2 (Serial0/) is up: new adjacency
- *Mar ::44.915: IP-EIGRP(Default-IP-Routing-Table:): Processing incoming UPDATE packet
- *Mar ::44.919: IP-EIGRP(Default-IP-Routing-Table:): 192.168.12.0/ - do advertise out Serial0/
- *Mar ::44.987: IP-EIGRP(Default-IP-Routing-Table:): Processing incoming UPDATE packet
- *Mar ::44.991: IP-EIGRP(Default-IP-Routing-Table:): Int 2.0.0.0/ M - SM -
- *Mar ::44.991: IP-EIGRP(Default-IP-Routing-Table:): route installed for 2.0.0.0 ()
- *Mar ::44.995: IP-EIGRP(Default-IP-Routing-Table:): 192.168.12.0/ - do advertise out Serial0/
- R1(config-if)#
- *Mar ::45.083: IP-EIGRP(Default-IP-Routing-Table:): Processing incoming UPDATE packet
- *Mar ::45.087: IP-EIGRP(Default-IP-Routing-Table:): Int 2.0.0.0/ M - SM -
- R1(config-if)#end
- R1#sh
- *Mar ::41.339: %SYS--CONFIG_I: Configured from console by console
- R1#sh ip ro
- Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
- D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
- N1 - OSPF NSSA external type , N2 - OSPF NSSA external type
- E1 - OSPF external type , E2 - OSPF external type
- i - IS-IS, su - IS-IS summary, L1 - IS-IS level-, L2 - IS-IS level-
- ia - IS-IS inter area, * - candidate default, U - per-user static route
- o - ODR, P - periodic downloaded static route
- Gateway of last resort is not set
- C 192.168.12.0/ is directly connected, Serial0/
- D 2.0.0.0/ [/] via 192.168.12.2, ::, Serial0/
- R1#un all
- All possible debugging has been turned off
- R1#sh ip ro
- Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
- D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
- N1 - OSPF NSSA external type , N2 - OSPF NSSA external type
- E1 - OSPF external type , E2 - OSPF external type
- i - IS-IS, su - IS-IS summary, L1 - IS-IS level-, L2 - IS-IS level-
- ia - IS-IS inter area, * - candidate default, U - per-user static route
- o - ODR, P - periodic downloaded static route
- Gateway of last resort is not set
- C 192.168.12.0/ is directly connected, Serial0/
- D 2.0.0.0/ [/] via 192.168.12.2, ::, Serial0/ ---这个8见截图,
- R1#show ip eigrp neigh
- R1#show ip eigrp neighbors
- IP-EIGRP neighbors for process
- H Address Interface Hold Uptime SRTT RTO Q Seq
- (sec) (ms) Cnt Num
- 192.168.12.2 Se0/ ::
- R1#ping 192.168.12.2
- Type escape sequence to abort.
- Sending , -byte ICMP Echos to 192.168.12.2, timeout is seconds:
- !!!!!
- Success rate is percent (/), round-trip min/avg/max = // ms
- R1#show ip eigrp topology
- IP-EIGRP Topology Table for AS()/ID(192.168.12.1)
- Codes: P - Passive, A - Active, U - Update, Q - Query, R - Reply,
- r - reply Status, s - sia Status
- P 2.0.0.0/, successors, FD is
- via 192.168.12.2 (/), Serial0/
- P 192.168.12.0/, successors, FD is
- via Connected, Serial0/
- 实验:见截图 三个路由构成三角形。R3连接一个lookback接口
- R1#conf
- R1#configure t
- Enter configuration commands, one per line. End with CNTL/Z.
- R1(config)#int f /
- ^
- % Invalid input detected at '^' marker.
- R1(config)#int s /
- R1(config-if)#ip add 192.168.12.1 255.255.255.0
- R1(config-if)#no sh
- R1(config-if)#no shutdown
- R1(config-if)#
- *Mar ::39.935: %LINK--UPDOWN: Interface Serial0/, changed state to up
- R1(config-if)#
- *Mar ::40.939: %LINEPROTO--UPDOWN: Line protocol on Interface Serial0/, changed state to up
- R1(config-if)#int s /
- *Mar ::04.195: %LINEPROTO--UPDOWN: Line protocol on Interface Serial0/, changed state to down
- R1(config-if)#int s /
- R1(config-if)#ip add 192.168.13.1 255.255.255.0
- R1(config-if)#no sh
- R1(config-if)#no shutdown
- R1(config-if)#
- *Mar ::41.003: %LINK--UPDOWN: Interface Serial0/, changed state to up
- R1(config-if)#
- *Mar ::42.007: %LINEPROTO--UPDOWN: Line protocol on Interface Serial0/, changed state to up
- R1(config-if)#
- *Mar ::04.207: %LINEPROTO--UPDOWN: Line protocol on Interface Serial0/, changed state to down
- R1(config-if)#netw
- R1(config-if)#networ
- R1(config-if)#network 192.168.12.0
- ^
- % Invalid input detected at '^' marker.
- R1(config-if)#rout
- R1(config-if)#routing i
- ^
- % Invalid input detected at '^' marker.
- R1(config-if)#routing ei
- ^
- % Invalid input detected at '^' marker.
- R1(config-if)#route
- R1(config-if)#router ei
- R1(config-router)#netw
- R1(config-router)#network 192.168.12.0
- R1(config-router)#network 192.168.13.0
- R1(config-router)#
- *Mar ::54.179: %LINEPROTO--UPDOWN: Line protocol on Interface Serial0/, changed state to up
- R1(config-router)#
- *Mar ::51.639: %DUAL--NBRCHANGE: IP-EIGRP() : Neighbor 192.168.12.2 (Serial0/) is up: new adjacency
- R1(config-router)#
- *Mar ::24.207: %LINEPROTO--UPDOWN: Line protocol on Interface Serial0/, changed state to up
- R1(config-router)#
- *Mar ::43.699: %DUAL--NBRCHANGE: IP-EIGRP() : Neighbor 192.168.13.3 (Serial0/) is up: new adjacency
- R1(config-router)#end
- R2#conf
- R2#conf t
- Enter configuration commands, one per line. End with CNTL/Z.
- R2(config)#int s /
- R2(config-if)#ip add 192.168.12.2
- % Incomplete command.
- R2(config-if)#ip add 192.168.12.2
- R2(config-if)#ip add 192.168.12.2 255.255.255.0
- R2(config-if)#no sh
- R2(config-if)#no shutdown
- R2(config-if)#
- *Mar ::48.531: %LINK--UPDOWN: Interface Serial0/, changed state to up
- R2(config-if)#
- *Mar ::49.535: %LINEPROTO--UPDOWN: Line protocol on Interface Serial0/, changed state to up
- R2(config-if)#int s /
- R2(config-if)#ip add 192.168.23.2 255.255.255.0
- R2(config-if)#no sh
- R2(config-if)#no shutdown
- R2(config-if)#
- *Mar ::14.087: %LINK--UPDOWN: Interface Serial0/, changed state to up
- R2(config-if)#
- *Mar ::15.091: %LINEPROTO--UPDOWN: Line protocol on Interface Serial0/, changed state to up
- R2(config-if)#rout
- R2(config-if)#router ei
- R2(config-router)#netw
- R2(config-router)#network
- *Mar ::42.515: %LINEPROTO--UPDOWN: Line protocol on Interface Serial0/, changed state to down
- R2(config-router)#network 192.168.12.0
- R2(config-router)#network 192.168.12.0
- *Mar ::50.183: %DUAL--NBRCHANGE: IP-EIGRP() : Neighbor 192.168.12.1 (Serial0/) is up: new adjacency
- R2(config-router)#network 192.168.23.0
- R3#int
- R3#int
- R3#conf
- R3#configure t
- R3#configure terminal
- Enter configuration commands, one per line. End with CNTL/Z.
- R3(config)#ip add 192.168.13.3 255.255.255.0
- ^
- % Invalid input detected at '^' marker.
- R3(config)#int s /
- R3(config-if)#ip add 192.168.13.3 255.255.255.0
- R3(config-if)#no sh
- R3(config-if)#no shutdown
- R3(config-if)#
- *Mar ::18.555: %LINK--UPDOWN: Interface Serial0/, changed state to up
- R3(config-if)#
- *Mar ::19.559: %LINEPROTO--UPDOWN: Line protocol on Interface Serial0/, changed state to up
- R3(config-if)#int s /
- R3(config-if)#ip add 192.168.23.3 255.255.255.0
- R3(config-if)#no sh
- R3(config-if)#no shutdown
- R3(config)#int lo0
- R3(config-if)#
- *Mar ::14.019: %LINEPROTO--UPDOWN: Line protocol on Interface Loopback0, changed state to up
- R3(config-if)#ip add 3.3.3.3 255.255.255.0
- R3(config-if)#no sh
- R3(config-if)#no shutdown
- R3(config-router)#router ei
- R3(config-router)#network 192.168.23.0
- R3(config-router)#network 192.168.13.0
- R3(config-router)#network 3.0.0.0
- R1#show ip eigrp neighbors
- IP-EIGRP neighbors for process
- H Address Interface Hold Uptime SRTT RTO Q Seq
- (sec) (ms) Cnt Num
- 192.168.13.3 Se0/ ::
- 192.168.12.2 Se0/ ::
- R1#sho
- R1#show ip ro
- Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
- D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
- N1 - OSPF NSSA external type , N2 - OSPF NSSA external type
- E1 - OSPF external type , E2 - OSPF external type
- i - IS-IS, su - IS-IS summary, L1 - IS-IS level-, L2 - IS-IS level-
- ia - IS-IS inter area, * - candidate default, U - per-user static route
- o - ODR, P - periodic downloaded static route
- Gateway of last resort is not set
- C 192.168.12.0/ is directly connected, Serial0/
- C 192.168.13.0/ is directly connected, Serial0/
- D 3.0.0.0/ [/] via 192.168.13.3, ::, Serial0/
- D 192.168.23.0/ [/] via 192.168.13.3, ::, Serial0/
- [/] via 192.168.12.2, ::, Serial0/
- R1#sho
- R1#show ip ei
- R1#show ip eigrp to
- R1#show ip eigrp topology
- IP-EIGRP Topology Table for AS()/ID(192.168.13.1)
- Codes: P - Passive, A - Active, U - Update, Q - Query, R - Reply,
- r - reply Status, s - sia Status
- P 3.0.0.0/, successors, FD is
- via 192.168.13.3 (/), Serial0/
- P 192.168.12.0/, successors, FD is
- via Connected, Serial0/
- P 192.168.13.0/, successors, FD is
- via Connected, Serial0/
- P 192.168.23.0/, successors, FD is
- via 192.168.12.2 (/), Serial0/
- via 192.168.13.3 (/), Serial0/
- R1#show ip eigrp topology all
- R1#show ip eigrp topology all-links
- IP-EIGRP Topology Table for AS()/ID(192.168.13.1)
- Codes: P - Passive, A - Active, U - Update, Q - Query, R - Reply,
- r - reply Status, s - sia Status
- P 3.0.0.0/, successors, FD is , serno
- via 192.168.13.3 (/), Serial0/
- via 192.168.12.2 (/), Serial0/
- P 192.168.12.0/, successors, FD is , serno
- via Connected, Serial0/
- P 192.168.13.0/, successors, FD is , serno
- via Connected, Serial0/
- P 192.168.23.0/, successors, FD is , serno
- via 192.168.12.2 (/), Serial0/
- via 192.168.13.3 (/), Serial0/
- R1#show ip protocols ------ 查看全局指令
- 负载均衡
- 负载均衡:同时出现了两条路由到达目的地。并且metric值相等。提高了带宽的利用率。
- 不等价负载均衡: --见图
- 允许两条优劣路由都放在路由表里。--防止闲置带宽:同时使用两条链路,
- variance= 自定义这个数
- (+)=<[*FD=] 这个时候30这个metric值就可以作为负载路由一起使用。
- 网络工程师概念:不是机房,不是弱电,是整个路由器,交换机等设备组成的系统,上面跑了平台,又有各种协议,根据客户现场进需求行规划。变成实施方案,最终落实,
- 多和行业内人士交流。
- OSPF
- OSPF协议:链路状态路由协议(开放式最短路径优先)---用的最广泛 --SPF算法 很多园区网都在用
- O:开放 共有的 没有跳数限制
- 路由之间交流的是链路的状态而不是直接的路由信息,而距离矢量路由协议交流的直接是路由信息
- 状态:这个接口到某个路由之间的开销或邻居关系。
- 根据开销选择 路径,和带宽成反比,带宽越大,到达目的地的开销越小。
- cost=10的8次方/接口带宽 带宽=沿路入接口所有带宽之和
- OSPF报文类型 相当于婚恋过程
- HELLO:建立初步关系 ,采用组播方式,224.0.0.5,发给所有运行OSPF协议的路由器
- DBD:链路状态表 LSA:具体信息,在LSDB中 --这一步了解基本信息,LSDB在拓扑表中,
- LSR:请求详细情况--链路状态信息
- LSU:给的答复(包括了多了LSA)
- LSACK:确认报文的安全机制,对LSU中的LSA进行确认。
- OSPF区域:
- 泛红,每台路由都要装在小区内的所有信息,浪费资源,所以区域要弄小点,且区域大,不易管理,且拓扑发生变化容易发生网络抖动,
- OSPF 区域划分,以路由器为界限,
- OSPF三张表:邻居表,拓扑表,OSPF路由表。
- OSPF优势
- 几乎适应所有网络类型,包括以太网,点对点串行链路,就是运行在OS七层的第二层,比如物理层是以太网接口,在二层就会识别封装成以太网帧,如果是串行接口,就封装成HPLC的帧,接口不一样,封装时候叫的名字也不一样,然后OSPF就会根据这种不同的数据链路层进行操作,不同的数据链路就是不同的网络,
- 一共4种网络类型
- 广播型:就是以太网链路,比如在LAN中连接了多台路由器,简称BMA。
- 串行链路:就是点对点模式,一条线两头各连一个路由,只有两个
- NBMA:也是多路型网络,但是不支持广播和组播,最典型的封装方式就是 x.25和帧中
- 通配符(反掩码):用来匹配,=255.255.255.255-接口的掩码
- 实验--通配符
- R1#configure t
- Enter configuration commands, one per line. End with CNTL/Z.
- R1(config)#int f /
- ^
- % Invalid input detected at '^' marker.
- R1(config)#int s /
- R1(config-if)#ip add 192.168.12.1 255.255.255.0
- R1(config-if)#no shutdown
- R1(config-if)#
- *Mar ::55.751: %LINK--UPDOWN: Interface Serial0/, changed state to up
- R1(config-if)#
- *Mar ::56.755: %LINEPROTO--UPDOWN: Line protocol on Interface Serial0/, changed state to up
- R1(config-if)#
- *Mar ::23.955: %LINEPROTO--UPDOWN: Line protocol on Interface Serial0/, changed state to down
- R1(config-if)#rou
- R1(config-if)#router os
- R1(config-if)#ex
- R1(config)#router os
- R1(config)#router ospf
- R1(config-router)#netw
- R1(config-router)#network 192.168.12.0 0.0.0.255 ar
- R1(config-router)#network 192.168.12.0 0.0.0.255 area ---- 255.255.255.255-3个255
- R1(config-router)#
- *Mar ::03.955: %LINEPROTO--UPDOWN: Line protocol on Interface Serial0/, changed state to up
- R1(config-router)#
- *Mar ::35.611: %OSPF--ADJCHG: Process , Nbr 192.168.23.2 on Serial0/ from LOADING to FULL, Loading Done
- R2#conf
- R2#configure t
- R2#configure terminal
- Enter configuration commands, one per line. End with CNTL/Z.
- R2(config)#in
- R2(config)#interface s /
- R2(config-if)#ip add 192.168.12.2 255.255.255.0
- R2(config-if)#no sh
- R2(config-if)#no shutdown
- R2(config-if)#
- *Mar ::49.223: %LINK--UPDOWN: Interface Serial0/, changed state to up
- R2(config-if)#in
- *Mar ::50.227: %LINEPROTO--UPDOWN: Line protocol on Interface Serial0/, changed state to up
- R2(config-if)#in
- R2(config-if)#int
- R2(config-if)#ex
- R2(config)#int s /
- R2(config-if)#ip add 192.168.23.2 255.255.255.0
- R2(config-if)#no sh
- R2(config-if)#no shutdown
- R2(config-if)#
- *Mar ::47.295: %LINK--UPDOWN: Interface Serial0/, changed state to up
- R2(config-if)#
- *Mar ::48.299: %LINEPROTO--UPDOWN: Line protocol on Interface Serial0/, changed state to up
- R2(config-if)#ex
- R2(config)#rou
- R2(config)#router os
- R2(config)#router ospf
- R2(config-router)#
- *Mar ::13.151: %LINEPROTO--UPDOWN: Line protocol on Interface Serial0/, changed state to down
- R2(config-router)#netw
- R2(config-router)#network 192.168.12.0 0.0.0.255 a
- R2(config-router)#network 192.168.12.0 0.0.0.255 area
- R2(config-router)#
- *Mar ::34.371: %OSPF--ADJCHG: Process , Nbr 192.168.12.1 on Serial0/ from LOADING to FULL, Loading Done
- R2(config-router)#net
- R2(config-router)#network 192.168.23.0 0.0.0.255 ar
- R2(config-router)#network 192.168.23.0 0.0.0.255 area
- R2(config-router)#
- *Mar ::43.151: %LINEPROTO--UPDOWN: Line protocol on Interface Serial0/, changed state to up
- R3#conf
- R3#conf t
- Enter configuration commands, one per line. End with CNTL/Z.
- R3(config)#int s /
- R3(config-if)#ip add 192.168.23.3 255.255.255.0
- R3(config-if)#no sh
- R3(config-if)#no shutdown
- R3(config-if)#
- *Mar ::30.879: %LINK--UPDOWN: Interface Serial0/, changed state to up
- R3(config-if)#
- *Mar ::31.883: %LINEPROTO--UPDOWN: Line protocol on Interface Serial0/, changed state to up
- R3(config-if)#ex
- R3(config)#rou
- R3(config)#routee
- R3(config)#router os
- R3(config)#router ospf
- R3(config-router)#netw
- R3(config-router)#network 192.168.23.0 0.0.0.255 a
- R3(config-router)#
- *Mar ::48.359: %OSPF--ADJCHG: Process , Nbr 192.168.23.2 on Serial0/ from LOADING to FULL, Loading Done
- R1(config-router)#end
- R1#
- *Mar ::07.071: %SYS--CONFIG_I: Configured from console by console
- R1#sh
- R1#show ip os
- R1#show ip ospf ne
- R1#show ip ospf neighbor
- Neighbor ID Pri State Dead Time Address Interface
- 192.168.23.2 FULL/ - :: 192.168.12.2 Serial0/
- R1#sh ip ro
- Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
- D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
- N1 - OSPF NSSA external type , N2 - OSPF NSSA external type
- E1 - OSPF external type , E2 - OSPF external type
- i - IS-IS, su - IS-IS summary, L1 - IS-IS level-, L2 - IS-IS level-
- ia - IS-IS inter area, * - candidate default, U - per-user static route
- o - ODR, P - periodic downloaded static route
- Gateway of last resort is not set
- C 192.168.12.0/ is directly connected, Serial0/
- O 192.168.23.0/ [/] via 192.168.12.2, ::, Serial0/
- R1#ping 192.168.23.3
- Type escape sequence to abort.
- Sending , -byte ICMP Echos to 192.168.23.3, timeout is seconds:
- !!!!!
- Success rate is percent (/), round-trip min/avg/max = // ms
- 多区域配置:area0 area1 不一样而已。
- 二层交换基础
- VLAN概念
- TRUNK概念
- 二层交换基本配置
- 交换机对帧进行转发,如果不知道数据包的走向就会泛红,不能隔绝广播域,
- 园区网络分层结构
- 接入层:用户接入,接入安全,防止PC中毒影响整个网络,接入层VLAN,接受用户流量
- 汇聚层:流量汇聚,链路冗余,设备冗余,防止环路
- 核心层:高速转发,服务器接入,路由选择,
- 出口层:广域网接入,出口策略,带宽控制,链路备份。
- 接入层交换机---二层交换机,二层:数据链路层,定义了MAC地址,
- 作用:学习MAC地址,数据转发,帧:源和目的,还有data,环路避免,
- 交换机为什么工作在第二层:能够识别帧,转发帧。
- mac地址:硬件地址,叫做二层地址,,出厂时唯一的,
- 工作原理:刚开始寻址,泛红,之后就是针对性的
- VLAN概念
- HUB:整个是个冲突域
- 交换机:一个接口就是一个冲突域,整台是个广播域,是个LAN,比如192.168.1./,不能隔绝广播域,因为是根据MAC地址转发,
- 路由器:每个接口就是个独立的广播域,
- 交换机如何划分多个广播域
- 192.168.1.1 和192.168.1. 是一个VLAN 192.168..3H和 192.168.1.4 是另一个LAN, 这两个LAN之间不能互访,要想互访需要借助路由器配置。
- VLAN V:就是虚拟
- 不同的LAN之间不能互访,要想通信就得知道MAC,而要知道MAC就得通过广播来获得,而不同的LAN是不同的广播,所以无法获得,
- 、静态VLAN --人工配置
- 、动态VLAN --通过VSPS服务器实现,防止人员位置发生变化,MAC注册后。一直跟踪MAC,别管电脑到哪里
- 集成商:布线,强电弱电等,
- 网络工程师:调试设备,运营。个根据客户需求,上架设备。100台设备,一个下午。善用工具,myBase管理脚本--复制粘贴,大型设备都是写脚本,复制粘贴,速度很快
- trunk :一条链路需要承载多ALAN信息的时候,需要使用trunk来实现。标记不同颜色,存在于交换机之间或交换机与路由器之间。由人为手工配置,
- trunk:要配在链路上,就是干道上,交换机之间用的Trunk
- ISL:思科私有,一种封装协议,
- .1Q又叫Qus:共有协议,使用里面插入tag来做标记,
- 数据帧:又叫纯洁以太网数据帧,
- VTP模式:思科私有,在大型网络中,动态管理VLAN,在server模式,发送并更新,让其他交换机也具有,放在flash里面的vlan.dat里面。删除配置文件,他也在,client端只能学习,transparent下不学习,只转发。 --------很少用。 -在Teunk之间运行,
- vlan的基本配置
- 跨交换机配置vlan
- 等车排队的时候放些视频学习材料
- c3600模拟交换机添加的模块是 GNS3里面的倒数第二个NM-16ESW,PC分配快速以太网口,
- 路由器怎么模拟pc
- 、 no ip routing ---关掉路由功能
- 、 interface f/
- ip address xxx
- no shutdown
- 、 ip default-gateway xxxx ---指定网关
- sw1(vlan)#ex -----这种方式退出才会保存
- R1#conf
- R1#configure t
- Enter configuration commands, one per line. End with CNTL/Z.
- R1(config)#host
- R1(config)#hostname sw1
- sw1(config)#end
- sw1#
- *Mar ::10.939: %SYS--CONFIG_I: Configured from console by console
- sw1#conf t
- Enter configuration commands, one per line. End with CNTL/Z.
- sw1(config)#vlan
- ^
- % Invalid input detected at '^' marker.
- sw1(config)#end
- sw1#
- *Mar ::38.879: %SYS--CONFIG_I: Configured from console by console
- R2#conf
- R2#configure t
- Enter configuration commands, one per line. End with CNTL/Z.
- R2(config)#host
- R2(config)#hostname sw2
- sw2(config)#end
- R3#conf
- R3#configure t
- Enter configuration commands, one per line. End with CNTL/Z.
- R3(config)#hos
- R3(config)#hostname pc1
- pc1(config)#no ip rou
- pc1(config)#no ip routi
- pc1(config)#no ip routing
- pc1(config)#int f /
- pc1(config-if)#ip add 192.168.10.1 255.255.255.0
- pc1(config-if)#no sh
- pc1(config-if)#no shutdown
- pc1(config-if)#
- *Mar ::58.447: %LINK--UPDOWN: Interface FastEthernet0/, changed state to up
- *Mar ::59.447: %LINEPROTO--UPDOWN: Line protocol on Interface FastEthernet0/, changed state to up
- pc1(config-if)#ip def
- pc1(config-if)#ip defau
- pc1(config-if)#ex
- pc1(config)#ip defa
- pc1(config)#ip default-gate
- pc1(config)#ip default-gateway 192.168.10.254
- pc1(config)#end
- R4#conf
- R4#configure t
- Enter configuration commands, one per line. End with CNTL/Z.
- R4(config)#host
- R4(config)#hostname pc2
- pc2(config)#no ip rou
- pc2(config)#no ip rout
- pc2(config)#no ip routi
- pc2(config)#no ip routing
- pc2(config)#int f /
- pc2(config-if)#ip add 192.168.20.1 255.255.255.0
- pc2(config-if)#no shu
- pc2(config-if)#no shutdown
- pc2(config-if)#
- *Mar ::04.523: %LINK--UPDOWN: Interface FastEthernet0/, changed state to up
- *Mar ::05.523: %LINEPROTO--UPDOWN: Line protocol on Interface FastEthernet0/, changed state to up
- pc2(config-if)#ex
- pc2(config)#end
- R5#conf
- R5#conf t
- Enter configuration commands, one per line. End with CNTL/Z.
- R5(config)#host
- R5(config)#hostname pc3
- pc3(config)#no ip rou
- pc3(config)#no ip routti
- pc3(config)#no ip routi
- pc3(config)#no ip routing
- pc3(config)#int f /
- pc3(config-if)#ip add 192.168.10.2 255.255.255.0
- pc3(config-if)#no sh
- pc3(config-if)#no shutdown
- R6#conf
- R6#configure t
- R6#configure terminal
- Enter configuration commands, one per line. End with CNTL/Z.
- R6(config)#hostn
- R6(config)#hostname pc4
- pc4(config)#no ip rout
- pc4(config)#no ip routi
- pc4(config)#no ip routing
- pc4(config)#int f /
- pc4(config-if)#ip add 192.168.20.2 255.255.255.0
- pc4(config-if)#no sh
- pc4(config-if)#no shutdown
- pc4(config-if)#end
- sw1#vlan da
- sw1(vlan)#vlan
- VLAN added:
- Name: VLAN0010
- sw1(vlan)#vlan
- VLAN added:
- Name: VLAN0020
- sw1(vlan)#ex
- APPLY completed.
- Exiting....
- sw1#conf
- sw1#conf t
- Enter configuration commands, one per line. End with CNTL/Z.
- sw1(config)#int f /
- sw1(config-if)#swit
- sw1(config-if)#switchport mo
- sw1(config-if)#switchport mode acc
- sw1(config-if)#switchport mode access
- sw1(config-if)#swi
- sw1(config-if)#switchport ac vl
- sw1(config-if)#switchport ac vlan
- sw1(config-if)#ex
- sw1(config)#int f /
- sw1(config-if)#switchport mode access
- sw1(config-if)#switchport ac vlan
- sw1(config-if)#ex
- sw1(config)#int f /
- sw1(config-if)#sw
- sw1(config-if)#swi
- sw1(config-if)#switchport mo
- sw1(config-if)#switchport mode ac
- sw1(config-if)#sw mo
- sw1(config-if)#sw mode ac vl
- sw1(config-if)#sw mode ac vla
- sw1(config-if)#sw acc
- sw1(config-if)#sw access vl
- sw1(config-if)#sw access vlan
- sw1(config-if)#end
- sw1#
- *Mar ::44.411: %SYS--CONFIG_I: Configured from console by console
- sw1#sho
- sw1#show vl
- sw1#show vlan-s
- VLAN Name Status Ports
- ---- -------------------------------- --------- -------------------------------
- default active Fa0/, Fa0/, Fa0/, Fa0/
- Fa0/, Fa0/, Fa0/, Fa0/
- Fa0/, Fa0/, Fa0/, Fa0/
- Fa0/
- VLAN0010 active Fa0/, Fa0/
- VLAN0020 active Fa0/
- fddi-default active
- token-ring-default active
- fddinet-default active
- trnet-default active
- VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2
- ---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
- enet - - - - -
- enet - - - - -
- enet - - - - -
- fddi - - - - -
- tr - - srb
- fdnet - - ibm -
- trnet - - ibm -
- sw1#conf
- sw1#conf t
- Enter configuration commands, one per line. End with CNTL/Z.
- sw1(config)#sw
- sw1(config)#swi
- sw1(config)#int f /
- sw1(config-if)#swi
- sw1(config-if)#switchport tru
- sw1(config-if)#switchport trunk en
- sw1(config-if)#switchport trunk encapsulation ?
- dot1q Interface uses only .1q trunking encapsulation when trunking
- sw1(config-if)#switchport trunk encapsulation do
- sw1(config-if)#switchport trunk encapsulation dot1q
- sw1(config-if)#swi
- sw1(config-if)#switchport mo
- sw1(config-if)#switchport mode tru
- sw1(config-if)#switchport mode trunk
- sw1(config-if)#
- *Mar ::37.255: %DTP--TRUNKPORTON: Port Fa0/ has become dot1q trunk
- sw1(config-if)#ex
- sw1(config)#end
- sw1#
- *Mar ::58.959: %SYS--CONFIG_I: Configured from console by console
- sw1#sho
- sw1#show int
- sw1#show interfaces tru
- sw1#show interfaces trunk
- Port Mode Encapsulation Status Native vlan
- Fa0/ on .1q trunking
- Port Vlans allowed on trunk
- Fa0/ -
- Port Vlans allowed and active in management domain
- Fa0/ ,,
- Port Vlans in spanning tree forwarding state and not pruned
- Fa0/ ,,
- sw2#vlan da
- sw2(vlan)#vl
- sw2(vlan)#vlan
- VLAN added:
- Name: VLAN0010
- sw2(vlan)#vl
- sw2(vlan)#vlan
- VLAN added:
- Name: VLAN0020
- sw2(vlan)#ex
- APPLY completed.
- Exiting....
- sw2#conf t
- Enter configuration commands, one per line. End with CNTL/Z.
- sw2(config)#int f /
- sw2(config-if)#sw
- sw2(config-if)#switchport ac
- sw2(config-if)#switchport access vl
- sw2(config-if)#switchport access vlan
- sw2(config-if)#int f /
- sw2(config-if)#sw
- sw2(config-if)#switchport ac
- sw2(config-if)#switchport access vl
- sw2(config-if)#switchport access vlan
- sw2(config-if)#int f /
- sw2(config-if)#sw
- sw2(config-if)#switchport mo
- sw2(config-if)#switchport mode tru
- sw2(config-if)#switchport mode trunk
- sw2(config-if)#
- *Mar ::10.931: %DTP--TRUNKPORTON: Port Fa0/ has become dot1q trunk
- sw2(config-if)#sw
- sw2(config-if)#switchport tru
- sw2(config-if)#switchport trunk en
- sw2(config-if)#switchport trunk encapsulation do
- sw2(config-if)#switchport trunk encapsulation dot1q
- sw2(config-if)#ex
- sw2(config)#end
- sw2#sho
- *Mar ::47.155: %SYS--CONFIG_I: Configured from console by console
- sw2#sho
- sw2#show int
- sw2#show interfaces tru
- sw2#show interfaces trunk
- Port Mode Encapsulation Status Native vlan
- Fa0/ on .1q trunking
- Port Vlans allowed on trunk
- Fa0/ -
- Port Vlans allowed and active in management domain
- Fa0/ ,,
- Port Vlans in spanning tree forwarding state and not pruned
- Fa0/ ,,
- pc1#show ip it
- pc1#show ip ii
- pc1#show ip in
- pc1#show ip int
- pc1#show ip interface b
- Interface IP-Address OK? Method Status Protocol
- FastEthernet0/ 192.168.10.1 YES manual up up
- pc1#ping 192.168.10.2
- Type escape sequence to abort.
- Sending , -byte ICMP Echos to 192.168.10.2, timeout is seconds:
- .!!!!
- Success rate is percent (/), round-trip min/avg/max = // ms
- pc2#ping 192.168.20.2
- Type escape sequence to abort.
- Sending , -byte ICMP Echos to 192.168.20.2, timeout is seconds:
- .!!!!
- Success rate is percent (/), round-trip min/avg/max = // ms
- pc2#
- 不同的VLAN要访问就得借助路由器,而路由器的接口少,非常宝贵,提出了单臂,必须是快速以太网口,就是一个物理接口承载两个vlan,通过创建子接口实现。
- 单臂实验--接着上面的实验----不同的VLAN要访问---通过创建子接口实现
- 单臂路由缺点:占用带宽,链路来回占用,
- sw2#conf t
- Enter configuration commands, one per line. End with CNTL/Z.
- sw2(config)#int f /
- sw2(config-if)#no sw ac vl
- sw2(config-if)#no sw ac vlan -----------去掉vlan要改成Trunk
- sw2(config-if)#sw
- sw2(config-if)#switchport no
- sw2(config-if)#switchport mo
- sw2(config-if)#switchport mode tr
- sw2(config-if)#switchport mode trunk
- sw2(config-if)#
- *Mar ::22.583: %DTP--TRUNKPORTON: Port Fa0/ has become dot1q trunk
- sw2(config-if)#sw
- sw2(config-if)#switchport tru
- sw2(config-if)#switchport trunk en
- sw2(config-if)#switchport trunk encapsulation d
- sw2(config-if)#switchport trunk encapsulation dot1q
- sw2(config-if)#ex
- sw2(config)#end
- sw2#sh
- *Mar ::01.275: %SYS--CONFIG_I: Configured from console by console
- sw2#sh int tr
- Port Mode Encapsulation Status Native vlan
- Fa0/ on .1q trunking
- Fa0/ on .1q trunking
- Port Vlans allowed on trunk
- Fa0/ -
- Fa0/ -
- Port Vlans allowed and active in management domain
- Fa0/ ,,
- Fa0/ ,,
- Port Vlans in spanning tree forwarding state and not pruned
- Fa0/ ,,
- Fa0/ ,,
- sw2#sh ip ro
- Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
- D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
- N1 - OSPF NSSA external type , N2 - OSPF NSSA external type
- E1 - OSPF external type , E2 - OSPF external type
- i - IS-IS, su - IS-IS summary, L1 - IS-IS level-, L2 - IS-IS level-
- ia - IS-IS inter area, * - candidate default, U - per-user static route
- o - ODR, P - periodic downloaded static route
- Gateway of last resort is not set
- pc4#conf
- pc4#configure t
- Enter configuration commands, one per line. End with CNTL/Z.
- pc4(config)#ip rou
- pc4(config)#ip routi
- pc4(config)#ip routing
- pc4(config)#defau
- pc4(config)#default int
- pc4(config)#default interface f / ---------恢复默认配置
- Building configuration...
- Interface FastEthernet0/ set to default configuration
- pc4(config)#end
- pc4#
- *Mar ::57.819: %SYS--CONFIG_I: Configured from console by console
- pc4#host
- pc4#hostna
- pc4#conf t
- Enter configuration commands, one per line. End with CNTL/Z.
- pc4(config)#hostn
- pc4(config)#hostname
- pc4(config)#hostname GW
- pc4(config)#hostname GW
- GW(config)#int f /
- GW(config-if)#no shu
- GW(config-if)#no shutdown
- GW(config-if)#int f /0.10
- GW(config-subif)#enca
- GW(config-subif)#encapsulation do
- GW(config-subif)#encapsulation dot1Q
- GW(config-subif)#ip add 192.168.10.254 255.255.255.0
- GW(config-subif)#no sh
- GW(config-subif)#int f /0.20
- GW(config-subif)#en
- GW(config-subif)#encapsulation do
- GW(config-subif)#encapsulation dot1Q
- GW(config-subif)#ip add 192.168.20.254 255.255.255.0
- GW(config-subif)#no sh
- GW(config-subif)#ex
- GW(config)#end
- GW#sho
- GW#show
- *Mar ::16.787: %SYS--CONFIG_I: Configured from console by console
- GW#show ip int b
- GW#show ip int b
- Interface IP-Address OK? Method Status Protocol
- FastEthernet0/ unassigned YES TFTP up up
- FastEthernet0/0.10 192.168.10.254 YES manual up up
- FastEthernet0/0.20 192.168.20.254 YES manual up up
- pc2#configure t
- Enter configuration commands, one per line. End with CNTL/Z.
- pc2(config)#ip def
- pc2(config)#ip default-g
- pc2(config)#ip default-gateway 192.168.10.254
- pc2(config)#^Z
- pc2#
- *Mar ::01.843: %SYS--CONFIG_I: Configured from console by console
- pc2#configure t
- Enter configuration commands, one per line. End with CNTL/Z.
- pc2(config)#ip default-gateway 192.168.20.254
- pc3(config-if)#ip def
- pc3(config-if)#ip defau
- pc3(config-if)#ip defaul
- pc3(config-if)#ip default-
- pc3(config-if)#ip default-g
- pc3(config-if)#ex
- pc3(config)#ip def
- pc3(config)#ip default-ge
- pc3(config)#ip default-get
- pc3(config)#ip default-g
- pc3(config)#ip default-gateway 192.168.10.254
- pc1#sh ip int b
- pc1#sh ip int b
- Interface IP-Address OK? Method Status Protocol
- FastEthernet0/ 192.168.10.1 YES manual up up
- pc1#sh ip ro
- Default gateway is 192.168.10.254
- Host Gateway Last Use Total Uses Interface
- ICMP redirect cache is empty
- pc1#ping 192.168.20.1
- Type escape sequence to abort.
- Sending , -byte ICMP Echos to 192.168.20.1, timeout is seconds:
- ..!!!
- Success rate is percent (/), round-trip min/avg/max = // ms
- pc1#ping 192.168.20.1
- Type escape sequence to abort.
- Sending , -byte ICMP Echos to 192.168.20.1, timeout is seconds:
- !!!!!
- Success rate is percent (/), round-trip min/avg/max = // ms
- 总结:
- trunk只有在不同的vlan的时候才设置在链路上
- 纯净的数据帧只有在trunk链路中才会打上封装。
- 学会创建自己的个人笔记,要通过word来写,可以自定义格式。生成目录树。
- VTP的基本配置
- OSPF
- STP生成树---在二层
- 单点故障:、单链路,、单设备
- 冗余又容易造成环路
- 三层链路:两台路由器之间叫做三层链路,存在于广播中
- 二层链路:存在于交换机与交换机之间。通过vlan接口互联的。
- 二层还没有很好的机制避免环路,
- 环路的缺点:
- 、环路--广播风暴,资源耗尽,网络卡,ping丢包等都是这个环路造成。ping100个包,丢50个包。一旦有一台pc中毒,就会泛红产生广播风暴,、环路占用资源
- 、MAC地址表乱,带来了MAC泛红攻击,---当MAC地址表满了以后就不能再学习新的mac,
- 、造成MAC地址飘逸,--manc地址一会在这个接口一会在另一个接口,--紊乱,
- 交换机对帧进行转发,
- STP通过选举解决了环路--生成树协议 .1D标准
- 做法:
- 、选择根桥----路由---就是交换机
- 、每个非根桥选择一个根端口。DP --距离根桥交换机距离最小,cost值来衡量---ospf里面用的
- 、每一段选择一个指定端口,---距离根桥交换机距离最小
- 、选择一个非指定端口,---阻塞掉
- 通过BPDU包泛红来操作
- 刚开始所有的交换机都认为自己的根桥,不断发送BPDU包,最后达成共识,选出根桥。
- Bridge ID = 2个字节桥优先级(人为给路由器定的) + 6个字节桥MAC地址 (背板的MAC地址)
- 都要比小,适用:路径相等时,
- Bridge ID 装在BPDU报文中,BPDU泛红后,所有人达成共识,生成一个Root ID --根桥
- 1Gb/s是千兆的 cost值--- 开销值
- 10Mb/s 10M的 cost值----
- 如果路径代价相等就比较 Bridge ID
- 2.1 每个非根桥选择一个根端口 RP
- 、最低的桥ID
- 、最低的根路径代价
- 、最低发送者桥ID Bridge ID
- 、最低端口ID
- 3.1、每一段选择一个指定端口 DP
- 、最低的桥ID
- 、最低的根路径代价
- 、最低发送者桥ID Bridge ID
- 、最低端口ID
CCIE总结:路由器、交换机的更多相关文章
- Atitit undac网络设备管理法案 (路由器 交换机等) 法案编号USRr101510
Atitit undac网络设备管理法案 (路由器 交换机等) 法案编号USRr101510 1.1. 版本历史1 1.2. 密码设置规范 与原则1 1.3. 如何设置密码 ,设置一个简单又安 ...
- HCNP学习笔记之史上最全华为路由器交换机配置命令大合集
先来一张思科和华为命令的对照表: 史上最全华为路由器交换机配置命令大合集,熟练掌握下面的华为路由器交换机配置知识点,你只需花几分钟的时间就能明白华为路由器交换机配置.交换机的配置命令等等. 华为路由器 ...
- 配置路由器/交换机的Telnet登录
实验目的:给配置路由器/交换机管理IP地址.设置Telnet的登录帐号.密码. 第一步:配置路由器的名称.接口IP地址. Switch> Switch>en Switch# Switch# ...
- 路由器/交换机Console口登录密码丢失后如何恢复
Console口登录密码丢失后如何恢复 如果忘记了Console口登录密码,用户可以通过以下两种方式来设置新的Console口登录密码. 通过STelnet/Telnet登录路由器/交换机设置新的Co ...
- 新CCIE笔记-路由器的配置
CCIE重修笔记之路由器基本配置与最简单的路由. 路由器与交换机的基本配置命令 全局配置模式下有多种子模式 (华为可以跳跃切换模式) 思科命令行技巧 Tab键补全,也可以直接保留缩写 问号'?'类似l ...
- 网络拓扑_华三H3C的路由器+交换机
最近在弄公司网络,目前的拓扑图长这样:点击查看网络拓扑图 华三的路由器和交换机都可以通过Console口进行配置,如下: 用SecureCRT.或者putty.或者windows的超级终端,打开ser ...
- CCNA学习笔记(1) IOS操作系统 路由器 交换机 启动 自检 以及部分命令
注意:以下内容是以思科为学习环境 IOS操作系统启动: 路由和交换机和个人电脑启动没有区别,都会发送新号表示启动状态,也会进入系统自检.只得注意的是:1.一长两短的响声是显卡报警. 2.一声长鸣是内存 ...
- Cisco路由器交换机基础配置
交换机配置 交换机基本状态: switch: # ROM状态, 路由器是rommon> hostname> # 用户模式 hostname# # 特权模式 hostname(config) ...
- Cisco路由器交换机配置命令详解
1. 交换机支持的命令: 交换机基本状态:switch: :ROM状态, 路由器是rommon>hostname> :用户模式hostname# :特权模式hostname(config) ...
- 关于Type-C扩展坞干扰路由器交换机的解决方案
近期看到网友反馈Type-C扩展坞干扰交换机的问题,具体表现为USB Type-C扩展坞在同时插上网线和PD充电的情况下,引起路由器或交换机死机,导致局域网断开的情况.经实测分析,原因为部分电脑默认设 ...
随机推荐
- javascript中如何判断数组是数组
if (!Array.isArray) { Array.isArray = function(arg) { return Object.prototype.toString.call(arg) === ...
- jade继承
代码的复用是jade非常突出的一个设计目标,jade不仅仅通过mixin来复用代码,他在文件的组织能力上也非常突出,说白了,就是继承和包涵 block定义的方式和调用的方式 block desc ...
- 开源框架---通过Bazel编译使用tensorflow c++ API 记录
开源框架---通过Bazel编译使用tensorflow c++ API 记录 tensorflow python API,在python中借用pip安装tensorflow,真的很方便,几句指令就完 ...
- nagios安装部署及详细配置说明(转)
一.Nagios简介 Nagios是一款开源的电脑系统和网络监视工具,能有效监控Windows.Linux和Unix的主机状态,交换机路由器等网络设置,打印机等.在系统或服务状态异常时发出邮件或短信报 ...
- 从客户端中检测到有潜在危险的 request.form值
这里只说ASP.NET MVC的解决方法,ASP.NET已经不碰了. 给控制器加上[ValidateInput(false)]特性即可忽略含有HTML标记的内容. [HttpPost] [Valida ...
- jQuery匿名函数和自定义插件
https://www.cnblogs.com/joey0210/p/3408349.html (function($){ //do something; })(jQuery);
- Java8-Concurrency
import java.util.UUID; import java.util.concurrent.ConcurrentHashMap; public class Concurrency1 { pu ...
- keyup([[data],fn]) 当按钮被松开时,发生 keyup 事件。它发生在当前获得焦点的元素上。
keyup([[data],fn]) 概述 当按钮被松开时,发生 keyup 事件.它发生在当前获得焦点的元素上. 注释:如果在文档元素上进行设置,则无论元素是否获得焦点,该事件都会发生.直线电机选型 ...
- 002_C/C++笔试题_简单算法程序
(一)冒泡排序法 #include <iostream> using namespace std; void bubblesort(int a[], int m); int main(vo ...
- 关闭tomcat8080端口
netstat -ano | findstr 8080taskkill /F /PID 1234