cisco与华为设备命令对照表
- 格式:xls
- 大小:434.00 KB
- 文档页数:6
Cisco和华为命令对比建立用户:Router(config)# username aaa password cisco[quidway]local-user aaa启动VTY验证:Router(config)#line vty 0 4[quidway]user-interface vty 0 4选择验证类型:Router(config-line)#login authentication[quidway-ui-vty0-4]authentication-modeVLAN:Switch(config)#vlan 10 name sale[quidway]vlan 10将端口加入vlan:Switch(config-if)#switchport access vlan 10[quidway-ethernet0/10]port access vlan 10将端口设置为trunk,允许所有vlan通过:Switch(config-if)#switchport mode trunkSwitch(config-if)#switchport trunk allowed vlan all[quidway-ethernet0/20]port link-type trunk[quidway-ethernet0/20]port trunk permit vlan all配置动态vlan发现协议:Switch (config)#vtp mode serverSwitch (config)#vtp domain cisco[quidway]gvrp enable配置端口汇聚:Switch(config-range)#interface range fastethernet 0/2[quidway]link-aggregation group 1 mode manual 先建立聚合组,再把端口加里面广域网协议配置:ppp的pap验证:router1(config-if)#encapsulation ppprouter1(config-if)#ppp authentication paprouter1(config-if)#ppp pap sent-username chen password cisco[quidway-serial0/1]link-protocol ppp[quidway-serial0/1] ppp authentication-mode pap[quidway-serial0/1] ppp pap local-user chen password simple cisco帧中继配置:router1(config)#frame-relay switchingrouter1(config-if)#frame-relay map ip 215.10.1.2 105 broadcastrouter1(config-if)#frame-relay lmi-type ansi[quidway]fr switching[quidway-serial0/1]fr map ip 215.10.1.1 dlci 501路由协议配置:静态路由:router1(config)#ip route 192.168.1.1 255.255.255.0 s0[quidway]ip route-static 192.168.1.1 255.255.255.0 s0RIP:router1(config)#router riprouter1(config-router)#version 2router1(config-router)#no auto-summaryrouter1(config-router)#network 192.168.1.0[quidway]rip[quidway-serial0/1]rip version 2 华为路由器是在接口模式下开启V2版本[quidway-rip]undo summary[quidway-rip] network 192.168.1.0OFPF:router1(config)#router ospf 1-65535router1(config-router)#network 192.168.1.0 0.0.0.255 area 0[quidway]ospf[quidway-ospf-1]area 0[quidway-ospf-1-area-0.0.0.0] network 192.168.1.0 0.0.0.255NAT :router1(config)#ip nat inside source static 192.168.1.1 10.1.1.1router1(config-if)#ip nat inside/outside[quidway-serial0/1]nat server protocol tcp global 202.10.1.150 inside 192.168.1.1 将内部ip转成外部ip地址访问控制列表:cisco基本访问列表数字标识:1-99,扩展访问列表是100-199;华为基本访问列表数字标识2000-2999,扩展访问列表是3000-3999基本访问列表:router1(config)#access-list 1 permit 10.1.1.0 0.0.0.255[quidway]acl number 2000[quidway-acl-2000]rule permit source 192.168.1.0 0.0.0.255扩展访问列表:router1(config)#access-list 100 permit tcp 192.168.1.0 0.0.0.255 any eq telnet[quidway]acl number 3000[quidway-acl-adv-3000]rule permit tcp source 192.168.1.0 0.0.0.255 destination any eq telnet应用访问控制列表:router1(config-if)#ip access-group 1 out/in[quidway]firewall enable 开启防火墙[quidway-serial0/1]firewall packet-filter 3000 inbound/outbound。
做弱电的人手一份!思科、华为等四大厂商的交换机配置命令全收录01 进入特权模式enableswitch>enableswitch#02 进入全局配置模式configure terminalswitch>enableswitch#configure terminalswitch(conf)#03 交换机命名hostname aptech2950以aptech2950为例switch>enableswitch#configure terminalswitch(conf)#hostname aptch-2950aptech2950(conf)#04 配置使能口令enable password cisco以cisco为例switch>enableswitch # c onfigure terminalswitch(conf)#hostname aptch2950aptech2950(conf)# enable password cisco05 配置使能密码enable secret ciscolab以cicsolab为例switch>enableswitch # c onfigure terminalswitch(conf)#hostname aptch2950aptech2950(conf)# enble secret ciscolab06 创建多个VLANswitch>enable (进入特权模式)switch#vlan data (进入VLAN配置模式)switch(vlan)#vlan 10 name IT (划分VLAN 10,名称为IT) switch(vlan)#vlan 20 name HR (划分VLAN20,名称为HR)switch(vlan)#vlan 30 name FIN (划分VLAN30,名称为FIN) switch(vlan)#vlan 40 name LOG (划分VLAN40,名称为LOG) switch(vlan)#exit07 设置VLAN 1switch>enableswitch # configure terminalswitch(conf)#hostname aptch2950aptech2950(conf)# interface vlan 1aptech2950(conf-if)#ip address 192.168.1.1 255.255.255.0配置交换机端口IP和子网掩码aptech2950(conf-if)#no shutaptech2950(conf-if)#exitaptech2950(conf)#ip default-gateway 192.168.254 设置网关地址08 进入交换机某一个端口interface fastehernet 0/17以17为例switch>enableswitch # configure terminalswitch(conf)#hostname aptch2950aptech2950(conf)# interface fastehernet 0/17aptech2950(conf-if)#09 查看命令showswitch>enableswitch# show version查看系统中的所有版本信息show interface vlan 1查看交换机有关IP协议的配置信息show running-configure查看交换机当前起作用的配置信息show interface fastethernet 0/1查看交换机1接口具体配置和统计信息show mac-address-table查看MAC地址表show mac-address-table aging-time查看MAC地址表自动老化时间10 交换机恢复出厂默认命令switch>enableswitch # erase startup-configureswitch # reload11 双工模式设置switch> enableswitch # c onfigure terminalswitch2950(conf)#hostname aptch-2950aptech2950(conf)# interface fastehernet 0/17aptech2950(conf-if)#duplex full/half/auto有 full、half、auto三个选项12 cdp相关命令switch> enableswitch# show cdp 查看设备的cdp全局配置信息show cdp interface fastethernet 0/17show cdp traffic 查看有关cdp包的统计信息show cdp nerghbors 列出与设备相连的cisco设备13 交换机telnet远程登录设置switch>enableswitch # configure terminalswitch(conf)#hostname aptech-2950aptech2950(conf)#enable password ciscoaptech2950(conf)#interface fastethernet 0/1aptech2950(conf-if)#ip address 192.168.1.1 255.255.255.0 aptech2950(conf-it)#no shutaptech2950(conf-if)#exitaptech2950(conf)line vty 0 4 设置0-4个用户可以telnet远程登录aptech2950(conf-line)#password edge 以edge为远程登录的用户密码主机设置:IP 192.168.1.2 主机的IP必须和交换机端口的地址在同一个网络段metmask 255.255.255.0gate-way 192.168.1.1 网关地址是交换机端口地址运行:telent 192.168.1.1进入telnet远程登录界面password:edgeaptech2950>enpassword:ciscoaptech#02华为交换机基础配置命令01 常用命令视图02 创建VLAN<Huawei> //用户视图,一般display命令查看信息比较多。
目录第一章VTP协议第二章 STP协议第三章三层交换机的配置第六章PPP协议第八章OSPF 基本概念及单区域配置第九章 OSPF的多区域配置第十章OSPF高级配置第十一章热备份路由协议HSRP第十二章访问控制列表ACL第十三章网络地址转换NAT第十四章IPSec VPN的配置第十五章WLAN和VoIP第十六章IPv6配置一、交换机部分二、路由器部分★华为命令集ATEN命令汇总一第一章VTP协议Switch(config)#vtp domain (name)设置VTP域名Switch(config)#vtp mode server/transparent/client设置VTP模式,服务/透明/客户/ Switch(config)#vtp password 123 设置VTP密码Switch(cofnig)#vtp pruning 设置VTP修剪Switch#show vtp status 查看VTP状态信息Switch#show vlan brief 查看VLAN信息===============================================================================================第二章 STP协议Switch(cofnig)#spanning-tree vlan 1 启用生成树Switch(config)#spanning-tree vlan 2 root primary / secondary 配置交换机为根网桥、主要的/次要的Switch(config)#spanning-tree vlan 2 priority 8192 修改交换机的优先级Switch(config-if)#spanning-tree vlan 2 cost 100/19/4/2 修改端口路径成本Switch(config-if)#spanning-tree vlan 2 port-priority 50 修改端口路径优先级(端口十进制取值0~255,默认值事128)Switch(config)#spanning-tree uplinkfast 配置上行速链路Switch(config)#interface range f0/1 - 20 (为除TRUNK链路外的接口配速端口)Switch(config-if)#spanning-tree portfast 配置速端口Switch#show spanning-tree 查看生成树信息(在小凡模拟器上show spanning-tree br) 以太网通道配置Switch(config)#interface range fasteternet 0/1 - 2 (为1、2端口配置以太网端口Switch(config-if-range)#channel-group 1 mode on (把绑在一起成为组1Switch#show etherchannel 1 summary 查看以太网通道的配置是否正确===============================================================================================第三章三层交换机的配置1、在3层交换机上启动路由,否则3层交换不具有路由功能switch(config)#ip routing2、配置VLAN的IP地址switch(config)#interface vlan 1 因为3层交换机支持各VLAN间的路由,因此每个VLAN都可以配置IP地址switch(config-if)#ip address 192.168.1.1 255.255.255.0switch(config-if)#no shutdown3、查看FIB表switch #show ip cef4、查看邻接关系表switch#show adjacency detail5、在3层交换机上配置路由接口switch(config-if)#no switchport (配置接口为3层模式,意思就是取消switch的接口)6、在3层交换机上配置静态路由或动态路由与在ROUTE上配置路由方法都是相同的7、配置DHCP中继转发switch(cofig)#interface vlan 2switch(config-if)#ip helper-address 192.168.2.100---------------------------------------------------解决实例;下面的配置命令,可以配置路由器为DHCP服务器,用以给DHCP客户端动态分配ip地址。
Cisco_H3C命令对照思科Cisco 华为3COM 功能enable system-view 进入特权模式configure terminal \ 进入配置状态show display 显示show running-config display current 显示目前的运行配置show version disp version 显示版本show start disp saved 显示已保存的配置show tech-support disp base-information 显示全面的信息no undo 取消(删除)hostname sysname 更改机器名\ lang chinese 进入中文状态user local-user 新建修改用户end return 退回到系统视图exit quit 返回上级视图exit logout telnet退出router rip rip rip动态路由router ospf ospf ospf路由router bgp bgp bgp路由write save 保存配置erase delete 删除配置0 simple 明文7 cipher 密文access-list acl 控制访问列表host ip host host和ip名字对应logging info-center 日志信息encap link-protocol 封闭链路层协议no debug all ctrl+d 取消所有debug命令vlan database vlan 进入vlan的配置vtp trunk trunk 设置成为骨干端口mode \ 模式trunk 相同主干线switchport port 接口控制access 相同访问ip dhcp dhcp 设置dhcp服务器功能思科华为命令对照表思科华为show displayshow version disp versionno undoshow run disp current-configuration username local-userend returnshow start disp saved-configuration exit quitexit logoutctrl+z quitrouter rip riprouter ospf ospfrouter bgp bgphostname sysnameaccess-list aclwrite saveerase delete0 simple7 cipherlogging info-center encapsulation link-protocol说明,华为S3026为的是思科的命令。
思科、华为、锐捷的交换机端口聚合区别思科命令行配置:CLI:SW#conf tSW(config)#interface range f1/1 -2SW(config-if)#channel-group 1 mode desirable/onSW(config-if)#swithportSW(config-if)#switchport mode trunkSW(config-if)#switchport trunk encap dot1q可以通过interface port-channel 1 进入端口通道华为端口聚合配置:华为交换机的端口聚合可以通过以下命令来实现:S3250(config)#link-aggregation port_num1 to port_num2 {ingress | ingress-egress}其中port_num1是起始端口号,port_num2是终止端口号。
ingress/ingress-egress这个参数选项一般选为ingress-egress。
在做端口聚合的时候请注意以下几点:1、每台华为交换机只支持1个聚合组2、每个聚合组最多只能聚合4个端口。
3、参加聚合的端口号必须连续。
对于聚合端口的监控可以通过以下命令来实现:S3026(config)#show link-aggregation [master_port_num]其中master_port_num是参加聚合的端口中端口号最小的那个端口。
通过这条命令可以显示聚合组中包括哪些端口等一些与端口聚合相关的参数。
锐捷端口聚合配置:Switch#configure terminalSwitch(config)#interface range fastethernet 1/1-2Switch(config-if-range)#port-group 5Switch(config-if-range)#switchport mode trunk你可以在全局配置模式下使用命令#interface aggregateport n(n为AP号) 来直接创建一个AP(如果AP n不存在)。
cisco与华为命令比较功能Cisco命令华为命令进入全局模式#configureterminal<Quidway>system显示当前配置showrunning-configdisplay current-configuration显示版本信息show version display version显示vlan信息show vlan display vlan显示接口信息show interface接口display interface接口交换机路由器命名hostname主机名sysname主机名修改特权密码enable password密码(明文)enable secret密码(密文)super password密码进入接口模式interface接口interface接口进入vlan模式interface vlanvlan号interface vlan vlan号给接口配IP ip address <ip> <掩码>ip address <ip> <掩码>配telnet密码line vty 0 4password密码login user-interface vty 0 4authentication-mode passwordset authentication-mode password simple 密码user privilege level 3激活端口no shutdown undo shutdown关闭端口shutdown shutdown退出exit quit创建VLANvlan vlan号vlan vlan号 VLAN中增port e0/1加端口port e0/2 to e0/4当前端口加入到VLAN switchportaccess vlan vlan号port access vlan vlan号设置端口工作模式switchport modetrunk|access|dynamicport link-type trunk|access|hybrid设trunk 允许的VLAN switchport trunkallowed vlanremove|add IDport trunk permit vlan ID|All指定镜像端口monitor session 1destination int接口monitor-port接口指定被镜像端口monitor session 1source int接口bothport mirror接口设置生成树启动与否spanning-treevlan vlan号(默认开启)stp enable|disable(默认关闭)端口的聚合interface rangef0/1 – 4channel-group 1mode onlink-aggregation e0/1 to e0/4ingress|bothundo link-aggregation e0/1|all设置主vlanisolate-user-vlan enable设置主vlan包括的子vlan isolate-user-vlan <x> secondary <vlan-list>显示路由信息show ip route display ip route 绑定HDLC协议默认就是link-protocol hdlc设静态路由ip route网络号掩码下一跳IP/接口ip route-static网络号掩码下一跳IP/接口启用RIP路由router rip riprip workrip inputrip output配置路由器的ID int loopback 0ip add IP地址掩码router id A.B.C.D启动OSPF协议router ospf进程号ospf enable配置OSPF区域net网络号反向掩码 area<area_id>int接口ospf enable area <area_id>标准ACL 命令格式access-list列表号 permit|deny源IP反向掩码acl <acl-number> [match-orderconfig|auto]rule [normal|special]{permit|deny}[source source-addr source-wildcard|any]扩展ACL 配置access-list列表号 permit|deny协议源IP反向掩码目的IP反向掩码eq端口号acl <acl-number> [match-orderconfig|auto]rule{normal|special}{permit|deny}{tcp|udp}source {<ip wild>|any}destination <ipwild>|any} eq服务名P PP设置encapsulationppplink-protocol pppPap认证主认证方(config)#username用户名 password密码(config)#int串口接口(config-if)#pppauthenticationpap被认证方(config)#int串主认证方local-user用户名password {simple|cipher}密码interface串口接口ppp authentication-mode pap被认证方interface串口接口ppp pap local-user用户名 password {simple|cipher}密码(config-if)#ppp papsent-username用户名 password密码Chap认证主认证方(config)#username客户端主机名password密码(config)#int串口接口(config-if)#pppauthentication(config-if)#pppchap hostname服务器主机名被认证方(config)#username服务器主机名password密码(config)#int串口接口(config-if)#pppchap hostname客户端主机名主认证方local-user对方主机名password {simple|cipher}密码interface串口接口ppp authentication-mode chapppp chap user自己主机名被认证方interface串口接口local-user对方主机名 password {simple|cipher}密码ppp chap user自己主机名静态nat (1)为内外部接口配IP并激活;(2)在接口上启用interface接口nat server global <ip> [port] inside <ip>port [protocol]内部接口:ip nat inside外部接口:ip nat outside(3)建立静态地址转换(config)#ip nat inside source static 私有IP 公网IP动态NAT (1)为内外部接口配IP并激活;(2)在接口上启用NAT;内部接口:ip natinside外部接口:ip natoutside(3)定义内网允许访问外网的ACL(config)#access-list列表号permit源IP 反向掩码(4)定义合法IP地址池(config)#ip natpool地址池名公网起始IP 公网终止IP netmask 掩码(1) 建立地址池nat address-group公网起始IP 公网终止IP pool 1(2)定义内网允许访问外网的ACLacl列表号rule permit source 源IP 反向掩码 rule deny source any(3)实现地址转换int公网接口nat outbound列表号address-group pool 1(5)实现地址转换(config)#ip natinside sourcelist列表号 pool地址池名调试命令思科:Switch#show run 显示所有配置命令Switch#show ip inter brief 显示所有接口状态Switch#show vlan brief 显示所有VLAN的信息Switch#show version 显示版本信息华为:[Quidway]dis cur 显示所有配置命令[Quidway]display interfaces 显示所有接口状态[Quidway]display vlan all 显示所有VLAN的信息[Quidway]display version 显示版本信息二、接口配置命令思科:Switch(config)#interface f0/8 进入接口视图Switch(config-if)#no shut 此命令开启接口Switch(config-if)#description to server01 端口描述Switch(config-if)#ip add 192.168.1.100 255.255.255.0 设置接口IP华为:[Quidway]interface e0/1 进入接口视图[Quidway]undo shutdown 此命令开启接口[Quidway]description to server02 端口描述[Quidway]ip add 192.168.1.102 255.255.255.0 设置接口IP三、VLAN配置命令:思科:建立和删除VLANSwitch# vlan databaseSwitch(vlan)# vlan 20 name test20Switch(vlan)# no vlan 20Switch(vlan)# exit将端口分配给一个VLANSwitch(config)# interface f0/1Switch(config-if)# switchport mode accessSwitch(config-if)# switchport access vlan 20设置VLAN TRUNKSwitch(config)# interface f0/24Switch(config-if)# switchport mode trunkSwitch(config-if)#switchport trunk allow vlan {ID|All}Switch(config-if)# switchport trunk encapsulation dot1q华为:建立和删除VLAN[Quidway]vlan 30[Quidway]undo vlan 30将端口分配给一个VLAN[Quidway]int ethernet0/1[Quidway-Ethernet0/1]port access vlan 30( port default vlan 30)或[Quidway]vlan 30[Quidway-vlan3]port ethernet 0/1 在VLAN中增加端口[Quidway-vlan3]port ethernet 0/1 to ethernet 0/4 在VLAN中增加多个连续端口设置VLAN TRUNK[Quidway]int e0/24[Quidway-Ethernet0/24] port link-type trunk[Quidway-Ethernet0/24]port trunk permit vlan {ID|All}四、端口镜像配置思科:配置镜像源端口Switch(config)#monitor session 1 source interface gigabitEthernet 0/2 –5 rx上面命令最后一个参数:both 监听双向数据,默认为bothrx 接收tx 发送配置镜像目的端口Switch(config)#monitor session 1 destination interface gigabitEthernet 0/6删除镜像端口Switch(config)#no monitor session 1华为:将端口E0/2配置为监控端口[Quidway]monitor-port Ethernet 0/2端口E0/1配置为镜像端口[Quidway]port mirror Ethernet 0/1或者直接配置监控端口和镜像端口[Quidway]port mirror Ethernet 0/1 observing-port Ethernet 0/2删除镜像[Quidway]undo monitor-port五、冗余配置思科HSRP:Switch# interface Vlan20ip address 172.29.197.33 255.255.255.248standby 20 ip 172.29.197.53standby 20 priority 105 优先级standby 20 preempt 抢占standby 20 track GigabitEthernet0/25 decrement 10 跟踪端口如果DOWN 了优先级减10华为VRRP:[Quidway]interface Vlanif30ip address 172.29.197.9 255.255.255.248vrrp vrid 30 virtual-ip 172.29.141.11vrrp vrid 30 priority 150 优先级vrrp vrid 30 preempt-mode 抢占vrrp vrid 30 track interface GigabitEthernet0/0/18 reduced 60 跟踪端口如果DOWN了优先级减60六、设置安全远程访问思科设置vty安全访问:R1(config)# access-list 1 permit 192.168.2.5R1(config)# line vty 0 4R1(config)# access-class 1 in华为设置vty安全访问:[Quidway]acl number 2000rule 1 permit source 172.29.181.150 0rule 2 deny[Quidway]user-interface vty 0 4acl 2000 inbound七、NTP配置思科:Cisco6509#show clock 显示时间Cisco6509#clock set 14:00:00 30 Sep 2011 设置时间Cisco6509(config)#ntp server 202.198.0.102 设置与其他时间服务器同步Cisco6509(config)#clock timezone beijing +8 设置时区华为:[Quidway]dis clock 显示时间[Quidway]clock datetime 23:30:00 2011/11/16 设置时间[Quidway]ntp-service unicast-server 202.198.0.102 设置与其他时间服务器同步[Quidway]clock timezone E8 add 08:00:00 设置时区八、静态路由配置思科:ip route <目的网段> <目的网段掩码><下一跳>Cisco6509# ip route 0.0.0.0 0.0.0.0 10.65.1.2 静态路由Cisco6509#ip route 0.0.0.0 0.0.0.0 192.168.3.1 150 浮动静态路由管理距离为150华为:[Quidway] ip route-static 0.0.0.0 0.0.0.0 10.65.1.2[Quidway]ip route-static 0.0.0.0 0.0.0.0192.168.3.1 preference 150九、可网管配置思科:Switch(config)#snmp-server community sunion ro 配置本交换机的只读字串为sunionSwitch(config)#snmp-server community sunion rw 配置本交换机的读写字串为sunionSwitch(config)#snmp-server enable traps 允许交换机将所有类型SNMP Trap 发送出去Switch(config)#snmp-server host 192.168.190.1 traps sunion 指定交换机SNMP Trap的接收者为192.168.190.1,发送Trap时采用sunion作为字串华为:[Quidway]snmp-agent community read datanms 配置本交换机的只读字串为datanms[Quidway]snmp-agent community write datanms 配置本交换机的读写字串为datanms[Quidway]snmp-agent sys-info location BeiJing China 设置交换机的位置信息[Quidway]snmp-agent sys-info version all 设置交换机支持所有的SNMP协议版本[Quidway]snmp-agent target-host trap address udp-domain192.168.190.121 params securityname datanms 指定交换机SNMP Trap的接收者为192.168.190.121 ,发送Trap时采用datanms作为字串。
思科、华为、锐捷的交换机端口聚合区别思科命令行配置:CLI:SW#conf tSW(config)#interface range f1/1 -2SW(config-if)#channel-group 1 mode desirable/onSW(config-if)#swithportSW(config-if)#switchport mode trunkSW(config-if)#switchport trunk encap dot1q可以通过 interface port-channel 1 进入端口通道华为端口聚合配置:华为交换机的端口聚合可以通过以下命令来实现:S3250(config)#link-aggregation port_num1 to port_num2 {ingress | ingress-egress}其中port_num1是起始端口号,port_num2是终止端口号。
ingress/ingress-egress这个参数选项一般选为ingress-egress。
在做端口聚合的时候请注意以下几点:1、每台华为交换机只支持1个聚合组2、每个聚合组最多只能聚合4个端口。
3、参加聚合的端口号必须连续。
对于聚合端口的监控可以通过以下命令来实现:S3026(config)#show link-aggregation [master_port_num]其中master_port_num是参加聚合的端口中端口号最小的那个端口。
通过这条命令可以显示聚合组中包括哪些端口等一些与端口聚合相关的参数。
锐捷端口聚合配置:Switch#configure terminalSwitch(config)#interface range fastethernet 1/1-2Switch(config-if-range)#port-group 5Switch(config-if-range)#switchport mode trunk你可以在全局配置模式下使用命令#interface aggregateport n(n为AP号) 来直接创建一个AP(如果AP n不存在)。
不同路由协议的优先级路由协议的优先级(Preference,即管理距离Administrative Distance)一般为一个0到255之间的数字,数字越大则优先级越低。
表一是通常情况下各路由协议的优先级规定:表一:一般路由协议优先级各产品厂商可能对路由协议的优先级有不同的规定,表二、表三分别列出了华为、思科路由器路由优先级列表:表三:思科路由器路由协议优先级路由的优先级的概念是优先级高的新路由协议可替代优先级低的同信宿路由,反之,则不然。
需要区别的是路由开销(metric)和路由优先级(preference)这两个概念。
metric是针对同一种路由协议而言,对不同的路由协议,由于代表的含义不同,比较不同协议的metric 是无意义的,所以要在两条不同协议的同信宿路由中作出选择,只能比较路由协议的优先级。
相反,preference是针对不同路由协议而言,同协议的路由的preference优先级是一般情况下一样的,这时metric是在两条同信宿路由中作出选择的标准。
总结:路由优先级在不同协议时候,比较preference的大小,而在路由协议相同时候由于preference相同,则再比较metric的大小,进而确定最终选择的路由。
一般在ip route命令中静态路由中的参数“Distance metric for this route“都是指metric 参数,而Administrative Distance在使用不同路由协议间比较时候,都使用默认值,如上表。
一般Administrative Distance值不单独写出来,除非要更改其默认值。
PS:对于小规模的网络,使用静态路由方式很合适,以下为cisco的静态路由配置命令:Static Routing静态路由:手动填加路由线路到路由表中,优点是:1.没有额外的router的CPU负担2.节约带宽3.增加安全性缺点是:1.网络管理员必须了解网络的整个拓扑结构2.如果网络拓扑发生变化,管理员要在所有的routers上手动修改路由表3.不适合在大型网络中静态路由的配置命令:ip route [dest-network] [mask] [next-hop address或exit interface][ad ministrative distance] [permanent]ip route:创建静态路由dest-network:决定放入路由表的路由表mask:掩码next-hop address:下1跳的router地址exit interface:如果你愿意的话可以拿这个来替换next-hop address,但是这个是用于点对点(poi nt-to-point)连接上,比如广域网(WAN)连接,这个命令不会工作在LAN上administrative distance:默认情况下,静态路由的管理距离是1,如果你用exit interface代替next -hop address,那么管理距离是0 (不同协议是AD,但是对于相同路由协议时候,是指metric)permanent:如果接口被shutdown了或者router不能和下1跳router通信,这条路由线路将自动从路由表中被删除.使用这个参数保证即使出现上述情况,这条路线仍然保持在路由表中。
华为和思科路由器的互联配置三、配置文件说明思科路由器配置文件(部分):Current configuration:!version 12.1service timestamps debug uptimeservice timestamps log uptimeservice password-encryption!hostname Cisco //定义路由器主机名!enable secret 5 $QB$O1nBb A1olUQ JU1JQRUxNe$oHa0 //enable密码!no ip domain-lookup!interface Loopback0ip address 192.168.0.1 255.255.255.0 //定义Loopback地址,也可以不定义!interface Ethernet1/0description zhongxinip address 172.16.1.1 255.255.255.0!interface Serial2/0description connect to Huaweiencapsulation ppp //缺省的封装是HDLCip address 192.168.1.1 255.255.255.252!router ospf 10network 172.16.1.0 0.0.0.255 area 0 //定义area 0network 192.168.1.0 0.0.0.3 area 0 //定义area 0network 192.168.0.0 0.0.0.255 area 0 //如果没有定义Loopback地址,或者不希望//Loopback地址可OSPF路由,可以不需要!ip classlessno ip http server!line con 0transport input noneline aux 0line vty 0 4password 7 00450CB01A564A 1A0B //telnet密码,加密显示login!end华为路由器配置文件(部分):Current configuration!version 1.74local-user hw service-type administrator password cipher @'E8P0>+S>'-LGXJQ<%DJQ!!//定义用户hw,Adminstrator用户是路由器的管理员身份用户,拥有路由器所有命//令的执行权限,cipher方式下密码密文存放,simple方式下密码明文存放。
BFD 配置示例注:不同型号设备或者不同系统版本配置命令会有出入,请详查操作手册。
1.1 Cisco 设备1.1.1 BFD 配置语法说明:配置步骤 1. enable2. configure terminal3. interface type number4. bfd interval milliseconds min_rx milliseconds multiplier intervalmultiplier5. end1.1.2 BFD For Static Route1. enable2. configure terminal3. interface type number4. ip address ip-address mask5. bfd interval milliseconds min_rx milliseconds multiplierinterval-multiplier 6. exit7. ip route static bfd interface-type interface-number ip-address [ group group-name [ passive ]] 8. ip route [ vrf vrf-name ] prefix mask {ip-address | interface-type interface-number [ip-address ]} [dhcp ] [distance ] [name next-hop-name ] [permanent | track number ] [tag tag ] 9. exit10.show ip static route 11.show ip static route bfd 12. exitRouter Aconfigure terminalinterface Serial 2/0ip address 10.201.201.1 255.255.255.0bfd interval 500 min_rx 500 multiplier 5ip route static bfd Serial 2/0 10.201.201.2ip route 10.0.0.0 255.0.0.0 Serial 2/0 10.201.201.2 Router Bconfigure terminalinterface Serial 2/0ip address 10.201.201.2 255.255.255.0bfd interval 500 min_rx 500 multiplier 5ip route static bfd Serial 2/0 10.201.201.1ip route 10.1.1.1 255.255.255.255 Serial 2/0 10.201.201.1 1.1.3BFD For RIP暂无。
思科华为show displayshow version disp versionno undoshow run disp current-configurationusername local-userend returnshow start disp saved-configurationexit quitexit logoutctrl+z quitrouter rip riprouter ospf ospfrouter bgp bgphostname sysnameaccess-list aclwrite saveerase delete0 simple7 cipherlogging info-centerencapsulation link-protocol例子:sysname Huawei-R2831 \\设置主机名interface Ethernet 0/0 进入接口模式de.ion T0 Switch-A \\接口描述ip address 192.168.10.222 255.255.255.0 \\配置接口IP地址undo shutdown \\启用接口local-user huawei \\建立用户名huaweipassword simple huawei \\设置密码为huaweiservice-type telnet \\服务类型为telnetuser-interface vty 0 4 \\进入telnet通道,设置5个用户可以同时登陆authentication-mode scheme \\设置telnet的模式为本地用户名与密码登陆user-interface console 0 设置console密码authentication-mode password 密码认证set authentication password simple huaweisuper password simple huawei \\设置super密码,display version \\查看VRP软件版本display current-configuration \\查看当前运行的配置display saved-configuration \\查看已保存过的配置display interface Ethernet 0/0 \\查看接品参数display brief interface \\查看接口基本状态delete flash:/config.cfg \\删除用SAVE保存过的配置delete flash:/main.bin \\删除VRP的映像文件(谨慎操作)save \\保存配置display 和ping 命令在任何视图下都可执行,不必切换到全局配置视图dis curdisplay current-configuration ;显示当前配置display interfaces ;显示接口display vlan all ;显示路由信息display version ;显示版本信息super password ;修改特权用户密码sysname ;交换机命名interface ethernet 0/1 ;进入接口视图interface vlan x ;进入接口视图ip address 10.65.1.1 255.255.0.0 ;配置VLAN的IP地址route-static 0.0.0.0 0.0.0.0 10.65.1.2 ;静态路由=网关]rip ;三层交换支持local-user ftpuser-interface vty 0 4 ;进入虚拟终端authentication-mode password ;设置口令模式set authentication-mode password simple 222 ;设置口令(simple简单的)ser privilege level 3 ;用户级别(当用户远程登陆时,其默认级别为1,不能作任何设置,3为最高级别,可以作修改)interface ethernet 0/1 ;进入端口模式int e0/1 ;进入端口模式duplex {half|full|auto} ;配置端口工作状态(端口聚合时是全双工,而CISCO 的为半双工)speed {10|100|auto} ;配置端口工作速率flow-control ;配置端口流控mdi {across|auto|normal} ;配置端口平接扭接port link-type {trunk|access|hybrid} ;设置端口工作模式port access vlan 3 ;当前端口加入到VLANport trunk permit vlan {ID|All} ;设trunk允许的VLANport trunk pvid vlan 3 ;设置trunk端口的PVIDundo shutdown ;激活端口shutdown ;关闭端口quit ;返回vlan 3 ;创建VLANport ethernet 0/1 ;在VLAN中增加端口port e0/1 ;简写方式port ethernet 0/1 to ethernet 0/4 ;在VLAN中增加端口port e0/1 to e0/4 ;简写方式description string ;指定VLAN描述字符description ;删除VLAN描述字符display vlan [vlan_id] ;查看VLAN设置stp {enable|disable} ;设置生成树,默认关闭(思科是打开的)stp priority 4096 ;设置交换机的优先级stp root {primary|secondary} ;设置为根或根的备份stp cost 200 ;设置交换机端口的花费link-aggregation e0/1 to e0/4 ingress|both ;端口的聚合undo link-aggregation e0/1|all ; 始端口为通道号[SwitchA-vlanx]isolate-user-vlan enable ;设置主v lan[SwitchA]isolate-user-vlan <x> secondary <list> ;设置主vlan包括的子vlan作用为隔离主子VLAN间的主机访问,在同一网段下,主子VLAN可以访问,但是子VLAN间是不能访问的,这是华为的一个突色[switcha]port-iaolate enable 这是隔离同一VLAN下的主机相互访问,isolate(隔离) port hybrid pvid vlan <id> ;设置vlan的pvidport hybrid pvid ;删除vlan的pvidport hybrid vlan vlan_id_list untagged ;设置无标识的vlan如果包的vlan id与PVId一致,则去掉vlan信息. 默认PVID=1。
思科、华为、H3C交换机巡检命令大全01思科交换机巡检命令1、show interface stats:查看交换机所有接口当前接口流量2、show running-config:查看当前设备配置3、show version:查看IOS版本信息及设备正常运行时间4、show clock:查看设备时钟信息5、show vtp status:查看交换机vtp配置模式6、show vtp password:查看交换机vtp配置口令7、show env all:查看设备温度,电源和风扇运转参数及是否报警8、show inventory:调取设备内部板卡出厂模块型号及序列号9、show spanning-tree root:查看交换机生成树根位置10、show cdp neighbors:查看邻接cisco设备基本信息11、show cdp neighbors detail:查看邻接cisco设备详细信息12、show interface status:查看交换机接口状态是否存在errordisable接口disable接口13、show interface summary:查看交换机所有接口当前接口流量14、show interface |ierrors|FastEthernet|GigabitEthernet:查看接口是否存在大量input或output errors包错误15、show processes cpu:查看设备cpu负载16、show processes mem:查看设备mem负载17、show access-list:查看访问控制列表配置及匹配数据包数量18、show logging:查看本机内部日志记录情况19、show ip route:查看路由表20、show firewall:检查防火墙的工作模式21、show conn count:检查防火墙并发数22、show xlate count:检查防火墙nat工作状态02华为/H3C交换机常用巡检命令system-view #进入系统视图user-interface vty 0 4 #vty就是用telnet/ssh远程进入交换机的界面(虚拟界面)screen-length 0 #指定要在屏幕上显示行数,0默认是没有分页(全部显示)01 硬件状态、IOS版本信息检查display clock #系统时间display version #查看版本信息,最近一次重新启动的时间display enviroment #设备温度display device #单板运行状态display device manuinfor #查看设备序列号display power #查看电源状况display fan #查看风扇状况display cpu-usage #查看cpu最近5S、1m、5m占用率display cpu history #查看cpu使用记录display cpu-usage task #查看CPU利用率display memory #查看内存大小和占用率display logbuffer #日志缓冲区dir flash: #查看flashdis boot-loader #显示软件映像文件display arp #查看arp表(目的IP与目的MAC的映射关系)display mac-address #查看mac地址表(二层转发通过mac地址表)display ntp status #ntp状态信息reset counters interface #清除接口统计信息,方便下次巡检查看接口错误包是否增加display elabel #路由器设备命令—查看电子标签信息(华为)改用display device manuinfodisplay ndp #路由器设备命令—华三V5版本支持,现在改用display lldp neighbor-informationdisplay diagnostic-information #故障信息收集02 系统运行配置状态检查display interface #接口流量、链路状态dis current-configuration inter #地址分配dis current-configuration |include ospf #路由扩散display ip routing-table #路由信息display ip interface #显示 vlan 端口统计数据display saved-configuration #保存配置文件display logbuffer #日志信息display port trunk #查看参与 trunk 的端口03 STP 信息检查display stp root #查看 stp 根情况display stp brief #查看 stp 简单信息display stp abnormal-port #查看是否有非正常端口display stp region-configuration #生成树区域配置display lldp neighbor-information #查看链路层邻居发现协议(邻居信息)display tcp status #路由器设备命令—tcp统计数据display tcp statistics #交换机设备命令—tcp统计数据04 vrrp 和端口聚合检查display vrrp #查看虚拟路由冗余协议display vrrp statistics #查看主备用状态display link-aggregation summary #查看链路聚合组的情况。