网络设备的连接方式和基本配置_第1页
网络设备的连接方式和基本配置_第2页
网络设备的连接方式和基本配置_第3页
网络设备的连接方式和基本配置_第4页
网络设备的连接方式和基本配置_第5页
已阅读5页,还剩5页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、. .网络设备的连接方式和根本配置consol口控制台口配置口在设备上简写为conconsol线缆控制台线配置线一端为RJ-45接口,一端为DB9串口。在连接consol线时,先连接到计算机上,然后再连接网络设备,最好在断电的情况下连接。1、将控制线连接到计算机的串口上,然后另一端连接到路由器上。2、启动设备连接到设备的软件,2种超级终端和SecureCRTRouter用户模式Routerenable Router#特权模式Router#configure terminal Enter configuration mands, one per line. End with TL/Z.Route

2、r(config)#全局配置模式使用end命令或ctrl+z直接退出到特权模式Router(config)#hostname huayuhuayu(config)#路由快速配置huayu(config)#no ip domain-lookup/禁用域名解析huayu(config)#line console 0/进入控制台接口huayu(config-line)#logging synchronous /使日志同步huayu(config-line)#exec-timeout 0 0/永不超时退出enconf teno ip domain-lookline cons 0logg syncexe

3、c-time 0 0exit恢复出厂设置Switch#erase nvram: Switch#reload/重启Switch#show interfaces f0/1/查看接口的详细信息物理层信息MTU最大传输单元数据在该接口的最大值接口的通讯方式auto由双方接口自协商,然后定义通讯方式Full-duplex全双工通讯half-duplex半双工通讯Switch(config)#interface f0/1Switch(config-if)#duplex half配置交换机的管理用IP和网关给二层交换配置IP地址,主要是为了管理用,通常就是远程配置。例如telnetSwitch(config

4、)#interface vlan 1Switch(config-if)#ip address 192.168.1.1 255.255.255.0Switch(config-if)#no shutdown Switch(config-if)#exitSwitch(config)#line vty 0 Switch(config-line)#passwSwitch(config-line)#password cisco123Switch(config-line)#loginSwitch(config)#enable secret ciscowindows客户端C:telnet 192.168.1.

5、1给交换机配置网关,通常在不同网段实验或应用中使用Switch(config)#ip default-gateway 192.168.1.254 cisco的私有协议,意味着这个协议只能应用在cisco设备上。CDP用来发现邻居的。r1#show cdp neighborsIP地址:在网络层由IP协议定义的计算机的网络地址,可以实现双方的网络层通讯。由32位2进制数组成,以点分10进制的形式表示。1.1.1.1/24一个完整的网络ID,是由IP地址和子网掩码来组成。子网掩码:分为2局部,网络位和主机位,网络位用2进制数1来表示,用来代表网络编号,主机位用2进制数0来表示,用来代表主机编号。用来

6、定义IP地址的主机位和网络位。网络位通常放在左边,主机位放到右边r1#show ip int b /查看配置的ipconfig# ip route 目的网段 掩码 出接口 下一跳 管理距离r1(config)#ip route 192.168.2.0 255.255.255.0 s0/0r1(config)#ip route 2.2.2.0 255.255.255.0 s0/0 /手动配置r1#ping 192.168.2.1 source 192.168.1.1ping 192.168.2.1 指定源地址为 192.168.1.1r1#traceroute 192.168.2.1 sourc

7、e 192.168.1.1 /跟踪去往192.168.2.1的路由,非常有用,可以判断故障的位置。*浮动静态路由使用管理距离小的,优先级高的路由条目才会出现在路由表中的原理,从而实现路由条目和线路的冗余。r3#debug ip packet翻开IP数据包的调试开关多线路的负载均衡去往一样的目的地有多条线路共同使用,实现负载分担。cisco的设备中有cef快速转发特性。关闭cefr2(config)#no ip cef r2(config)#int s0/1r2(config-if)#no ip cefr2(config)#int s0/2r2(config-if)#no ip cef配置动态r

8、iprouter rip network 1.0.0.0 network 192.168.1.0r1#show ip protocols/查看当前运行的路由协议r1#debug ip rip /翻开rip调试信息r1#no debug all/关闭调试信息开关r3#clear ip route * /去除垃圾路由信息,更新路由表r1(config)#router ripr1(config-router)#version 2/版本2r1(config-router)#no auto-summary/关闭自动汇总Ripv2和很多动态路由协议默认会有自动汇总的功能。10.1.1.1/2410.2.2

9、.2/2410.0.0.0/8 1.1.1.1手动汇总在发出更新的接口上配置手动汇总。r1(config)#int s0/0r1(config-if)#ip summary-address rip 10.0.0.0 255.252.0.0Rip的(config)#key chain huayu/定义钥匙链的名字(config-keychain)#key 123/定义钥匙的编号(config-keychain-key)#key-string cisco/定义钥匙的密码#interface Ethernet0/0 /应用到接口上(config-if)#ip rip authentication k

10、ey-chain huayu(config-if)#ip rip authentication mode md5 /md5加密r2(config-router)#passive-interface e0/0 /在b的e0/0配置被动接口r2(config-router)#neighbor 192.1.1.2 /b和c薄弱更新。r3(config-if)#no ip split-horizon /关闭水平分隔,这样a也能学习到b的,但是不会知道b里面的拓扑。运行EIGRP的路由器中包含3X表1、邻居表:存放着邻居的信息2、拓扑表:存放根据从邻居那更新来的拓扑信息而描述的网络拓扑构造3、路由表:就

11、是描述通过扩散更新算法计算后得出最优路径。r1(config)#router ei 100 /100是表示自治系统r1(config-router)#no auto-summary r1(config-router)#net 0.0.0.0 /宣告所有接口r2#show ip eigrp topology /查看eigrp的拓扑表 邻居表neighbor tabler1(config-if)#ip summary-address eigrp 100 10.1.0.0 255.255.252.0eigrp自己学习自己的手动汇总。 关闭自动汇总 Router (config-router)# no

12、 auto-summary EIGRP的手动汇总Router (config-if)# ip summary-address eigrp 1 1.1.0.0 255.255.0.0 链路状态:主要是以带宽来衡量的本钱:也成为代价或开销 cost 其实就是度量area 0:骨干区域area 1:非骨干区域DR:指定路由器BDR:备份指定路由器DRother:非指定路由器邻居数据库:记录着ospf的邻居信息拓扑数据库:根据链路状态数据库产生的网络拓扑数据RIDRouter ID:路由器ID,可以理解为路由器的编号路由器ID的选择最优先选择回环接口的地址,如果有多个地址,选择数值最大的其次选择物理接

13、口的IP地址,如果有多个,就选择数值最大的r1(config)#router ospf 100/启用ospf进程,100为进程号r1(config-router)#router-id 192.168.1.1/定义RIDr1(config-router)#network 192.168.1.1 0.0.0.255 area 0/宣告网络r1(config-router)#network 1.1.1.1 0.0.0.255 area 0r3(config-router)#network 0.0.0.0 0.0.0.0 area 0/宣告所有r2#show ip ospf neighbor /查看o

14、spf的邻居r2(config)#int s0/0r2(config-if)#ip ospf network point-to-point /指定ospf的网络类型r1#clear ip ospf process /重启ospf进程Reset ALL OSPF processes no: yesr1#debug ip ospf hello /翻开ospf的hello调试r2(config)#router ospf 100r2(config-router)#neighbor 192.168.1.1/手动指定邻居在NBMA网络中应用r2(config-router)#neighbor 192.16

15、8.3.1show ip protocols /查看拓扑数据,看RID,DR 和BDRshow ip route 显示学习来的路由条目,确定本地与网络之间的连接show ip ospf interface 检验配置的接口在哪个区域,邻接关系clear ip ospf process 刷新路由协议的进程,如重新选举DR、BDRShow ip ospf neighbor /查看邻居信息。 设置s0接口的优先级 Router(config)# interface f0/0 Router(config-if)# ip ospf priority 100显示接口的优先级信息 Router# show i

16、p ospf interface s0 上图配置如下;1, 配置末梢区域,在区域中所有路由器上配置 RT(config-router)# area stubr2(config)#router ospf 10r2(config-router)#area 1 stubr3(config)#router ospf 10r3(config-router)#area 1 stub在末梢区域的根底上配置完全末梢区域,在ABR上配置r2(config)#router ospf 10 r2(config-router)#area 1 stub no-summaryO*IA 0.0.0.0/0 110/65 v

17、ia 192.168.2.1, 00:01:13, Serial0/0结果1、减少了LSA泛洪,只承受1、2类型的LSA,减少了带宽的占用2、减少了路由条目,提高查询速度2,RIP重分布到OSPF 在ASBR上配置r5(config)#router ospf 10r5(config-router)#redistribute rip metric 20 subnetsOSPF重分布到RIP 在ASBR上配置r5(config)#router ripr5(config-router)#redistribute ospf 10 metric 3 /3代表条数NSSA区域ABRr1(config)#r

18、outer ospf 10r1(config-router)#area 2 nssaIRr4(config)#router os 10r4(config-router)#area 2 nssaASBRr5(config)#router ospf 10r5(config-router)#area 2 nssa给NSSA区域添加默认路由r1(config-router)#area 2 nssa default-information-originate /非末梢区域和内部连接的路由上做。给NSSA区域的内部减少域间路由条目,阻止LSA3的更新r1(config-router)#area 2 nss

19、a no-summaryOSPF的汇总外部路由的汇总ASBRr5(config)#router ospf 10r5(config-router)#summary-address 2.2.0.0 255.255.252.0ospf内部的区域路由汇总,在ABR上做r2(config)#router ospf 10r2(config-router)#area 1 range 1.1.0.0 255.255.252.0路由重分配,具体操作如下1, 配上相应的ip地址,和为每台路由器配置会换接口地址2, R2的具体配置interface Loopback0 ip address 2.2.2.2 255.

20、255.255.0! interface Serial0/0 ip address 192.168.1.2 255.255.255.0 serial restart-delay 0! interface Serial0/1 ip address 192.168.2.1 255.255.255.0 serial restart-delay 0! interface Serial0/2 ip address 192.168.4.1 255.255.255.0 serial restart-delay 0! interface Serial0/3 ip address 192.168.5.1 255

21、.255.255.0 serial restart-delay 0! router eigrp 100 network 192.168.4.0 auto-summary! router ospf 10 log-adjacency-changes network 192.168.2.0 0.0.0.255 area 0! router rip version 2 network 2.0.0.0 network 192.168.1.0 no auto-summary! ip serverno ip secure-server! ip route 6.6.6.0 255.255.255.0 192.

22、168.5.22, ASBR上做路由重分配r2上做具体如下:重分布路由到ripr2(config)#router ripEIGRP-RIPr2(config-router)#redistribute eigrp 100 metric 2OSPF-RIPr2(config-router)#redistribute ospf 11 metric 3直连-RIPr2(config-router)#redistribute connected metric 4静态-RIPr2(config-router)#redistribute static metric 5重分布路由到EIGRPr2(config

23、)#router eigrp 100 RIP-EIGRPr2(config-router)#redistribute rip metric 10000 100 255 1 1500 OSPF-EIGRPr2(config-router)#redistribute ospf 11 metric 10000 100 255 1 1500 直连到-EIGRPr2(config-router)#redistribute connected metric 10000 100 255 1 1500静态-EIGRPr2(config-router)#redistribute static metric 10

24、000 100 255 1 1500重分布路由到ospfrip-ospf默认的类型2r2(config-router)#redistribute rip subnets 类型1r2(config-router)#redistribute rip subnets metric-type 1如果不指定度量,默认为20eigrp-ospfr2(config-router)#redistribute eigrp 100 subnets metric-type 1直连和静态到ospfr2(config-router)#redistribute connected subnets metric-type

25、1r2(config-router)#redistribute static subnets metric-type 1 实验10 BGP路由协议原理、配置与排错实验10.1 实验内容l BGP的根本配置;l BGP的聚合;l BGP属性简单应用;l BGP路由反射器的作用;l 基于aspath的路由策略。说明:本文所有实验环境共用一个组网图。在不支持loopback的软件版本中,建议使用dialer口替代loopback口。在本实验中,所有的实验都是沿用前面的配置,在进展下一个实验前请不要修改前面已完成的配置。软件版本:Version 1.74 Release 0006。10.2 BGP根本

26、配置10.2.1 实验目的l 掌握配置BGP的根本配置命令;l 邻居关系的建立;l 路由的引入,观察实验结果。10.2.2 实验环境l Quidway 26 系列或更高性能路由器 4台,穿插网线2根,V35或V24 DTE/DCE 线缆 2 对。10.2.3 实验组网图图10-1 实验组网图10.2.4 实验步骤1. 配置建立路由器RouterA RouterB RouterC 邻居关系RouterA:配置路由器A的接口地址,启动BGP协议,设置BGP邻居。/配置路由器A的接口地址RouterA-Serial0 ip address 11.1.1.1 255.255.0.0 RouterA-E

27、thernet0 ip address 11.2.1.1 255.255.0.0 RouterA-LoopBack1 ip address 10.1.1.1 255.0.0.0RouterA-LoopBack2 ip address 1.1.1.1 255.0.0.0/启动BGP协议RouterAbgp 100 /设置BGP邻居RouterA-bgppeer 11.1.1.2 as-number 200 RouterA-bgppeer 11.2.1.2 as-number 200 RouterA save配置路由器C:RouterC-LoopBack1 ip address 3.3.3.3 2

28、55.0.0.0RouterC-Ethernet0 ip address 11.2.1.2 255.255.0.0 RouterC bgp 200 RouterC-bgppeer 11.2.1.1 as-number 100 RouterC save配置路由器B:RouterB-Serial0 ip address 11.1.1.1 255.255.0.0 RouterB bgp 200 RouterB-bgppeer 11.1.1.2 as-number 100 RouterB save在路由器A上执行:RouterAdisplay bgp summaryNeighbor V AS MsgR

29、cvd MsgSent OutQ Up/Down State11.1.1.2 4 200 2 3 0 00:00:09 Established11.2.1.2 4 200 11 12 0 00:09:23 Established两EBGP邻居已经建立。1、引入路由问题1:为什么没有任何BGP路由 BGP本身不会产生路由,只能转发引入的路由,需要引入引入10.0.0.0网段的路由:RouterA-bgpnetwork 10.0.0.0RouterA-bgpdisplay bgpBGP local router ID is 11.1.1.2Status codes: s suppressed, d damped, h history, * valid, best, i internalOrigin codes: i - IGP, e - EGP, - inplete Network Next Hop Metric LocPrf Path* 10.0.0.0 11.1.1.1 100 iRouterBdisplay bgpBGP local router ID is 11.1.1.2Status codes: s suppressed, d damped, h h

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论