主要用于局域网出口、广域网的骨干节点





知识点 | 核心内容 | 考试重点/易混淆点 | 难度系数 |
|---|---|---|---|
路由器接口类型 | 分为局域网接口(如以太网电口/光口)和广域网接口(如串口/SDH POS接口) | 广域网接口类型(串口/SDH POS/ISDN BRI&PRI)及速率(144k/2.048M/155M/622M/2.5G) | ⭐⭐⭐ |
广域网接口应用场景 | 串口用于DDN/帧中继等老式线路; SDH POS用于骨干网(如省厅-市局-区县层级互联) | POS接口速率记忆(155M/622M/2.5G)及现网替代趋势(以太网升级) | ⭐⭐⭐⭐ |
设备管理方式 | 命令行(Console/USB/SSH/Telnet)、图形化(HTTP/HTTPS)、网管系统(SNMP/NETCONF) | SSH与Telnet安全性对比、网管系统配置复杂度 | ⭐⭐ |
路由器与交换机区别 | 路由器支持广域网接口(如串口),交换机仅支持以太网接口; 路由器接口需不同网段 | 接口成对性(串口与以太网口无必然关联)、以太网默认点对多点特性 | ⭐⭐⭐ |
管理接口隔离功能 | 配置isolate enable限制管理口与业务口间流量转发 | 功能直译题(如“隔离”对应选项D) | ⭐ |
设备系列定位 | 华为AR系列(多功能企业级) vs. NE系列(高端骨干网,支持POS接口) | AR与NE系列适用场景对比 | ⭐⭐⭐ |
以下是一些华为路由器详细的常用配置命令:
system-viewsysname [新主机名],例如 sysname R1savedisplay version #查看设备版本信息
display current-configuration #查看当前配置
display saved-configuration #查看已保存配置
display device #查看硬件状态(CPU/内存)
display clock #显示系统时间rebootdeletereset saved-configurationset factory-configuration from defaultinterface [接口类型] [接口编号],例如 interface GigabitEthernet 0/0/1ip address [IP地址] [子网掩码],例如 ip address 192.168.1.1 24undo shutdownshutdowndescription [描述]interface [接口类型] [接口编号].[子接口编号],例如 interface GigabitEthernet 0/0/1.10dot1q termination vid [VLAN ID]arp broadcast enabledisplay interface [接口类型] [接口编号]display ip interface briefip route-static [目标网络] [子网掩码] [下一跳地址|接口编号] [reject|blackhole] ip route-static 192.168.2.0 24 10.1.1.2ip route-static 0.0.0.0 0.0.0.0 [下一跳地址]rip 1network [网络地址] network 192.168.1.0version 2ospf 1 area 0network [网络地址] [反掩码] network 192.168.1.0 0.0.0.255display ip routing-tabledisplay ospf peerlocal-user [用户名] password irreversible-cipher [密码]local-user [用户名] service-type [服务类型]local-user [用户名] privilege level [等级]super password [密码]acl [ACL编号] acl 2000rule [规则编号] {normal|special} {permit|deny} source [源地址] [源通配符] rule normal permit source 192.168.1.0 0.0.0.255traffic-filter {inbound|outbound} acl [ACL编号]user-interface vty 0 4authentication-mode passwordset authentication password cipher [密码]stelnet server enableaaa
local-user [用户名] password cipher [密码]
local-user [用户名] service-type sshssh user [用户名] authentication-type passwordnat address-group [地址池编号] [起始IP地址] [结束IP地址] nat address-group 1 202.100.1.10 202.100.1.20nat outbound [ACL编号] address-group [地址池编号]dhcp enableip pool [地址池名称]
network [网络地址]
mask [子网掩码]
gateway-list [网关地址]
dns-list [DNS服务器地址]interface [接口类型] [接口编号],然后 dhcp select globalstp enablestp disableping [IP地址]:测试网络连通性tracert [IP地址]:追踪路径2)信息诊断:
display fib:查看转发信息库display arp:查看ARP表display mac-address:查看MAC地址表3)开启/关闭调试
debugging all:开启所有调试信息(慎用,可能导致大量输出)。undo debugging all:关闭所有调试信息。debugging [module]:开启指定模块的调试(如 debugging ospf)。4)查看调试信息
terminal debugging 开启终端调试,或通过 logging buffered 将日志保存到缓冲区。进入BGP视图:
bgp [AS编号] bgp 100,进入BGP视图,AS编号用于标识自治系统。router-id [IP地址] router-id 1.1.1.1,配置BGP的Router ID,通常建议配置为LoopBack接口的IP地址。配置BGP邻居:
peer [邻居IP地址] as-number [邻居AS编号] peer 10.1.2.2 as-number 100,指定对等体的IP地址及其所属的AS编号。进入IPv4单播地址族视图:
ipv4-family unicast,进入IPv4单播地址族视图,用于配置IPv4相关的BGP路由。配置路由引入:
import-route static,配置引入静态路由到BGP中。network [网络地址] [掩码长度] network 10.1.1.0 24,将本地路由表中的路由以静态方式加入到BGP路由表中,并发布给对等体。配置路由策略:
route-policy [策略名称] permit node [节点号] route-policy admin permit node 10,配置名为admin的路由策略,其节点号为10,匹配模式为允许。if-match acl [ACL编号] if-match acl 2001,配置基于ACL的匹配规则。apply local-preference [优先级值] apply local-preference 120,配置指定BGP路由的本地优先级。apply community [团体属性值] apply community 10:1,配置指定BGP路由的BGP团体属性。peer [邻居IP地址] route-policy [策略名称] import peer 192.168.0.1 route-policy admin import,配置对来自对等体的路由指定路由策略。自动路由汇总:
summary automatic,BGP根据自然掩码对子网路由进行汇总,该命令对BGP导入的路由进行汇总,这些路由可以是直连路由、静态路由、RIP路由、OSPF路由或IS - IS路由,但对于使用网络命令导入的路由,该命令无效。手动路由汇总:
aggregate ipv4-address [IPv4地址] { mask | mask-length } aggregate 10.1.1.1 16,要广告汇总的路由和具体的路由。aggregate ipv4-address [IPv4地址] { mask | mask-length } detail-suppressed仅广告汇总的路由。aggregate ipv4-address [IPv4地址] { mask | mask-length } suppress-policy route-policy-name,广告汇总的路由和满足指定路由策略的具体路由。aggregate ipv4-address [IPv4地址] { mask | mask-length } as-set,广告汇总的路由的as_set属性有助于检测路由环路。aggregate ipv4-address [IPv4地址] { mask | mask-length } attribute-policy route-policy-name,为汇总的路由设置属性。aggregate ipv4-address [IPv4地址] { mask | mask-length } origin-policy route-policy-name,汇总满足指定路由策略的具体路由。在路由反射器上配置:
peer [客户机IP地址] reflect-client peer 10.1.3.2 reflect-client,配置RR及其客户机。创建路由策略节点并进入路由策略视图:
route-policy [策略名称] { deny | permit } node [节点号] route-policy ext-community-policy permit node 10。配置路由策略过滤条件(可选):
if-match [过滤条件],根据实际需求配置。配置BGP路由信息的扩展团体属性:
apply extcommunity { rt { as-number:nn | ipv4-address:nn } } &<1 - 16> [ additive ] apply extcommunity rt 100:1。apply extcommunity soo { site-of-origin } &<1 - 16> additive。退出路由策略视图,进入BGP视图:
bgp [AS编号]。进入BGP IPv4单播地址族视图:
ipv4-family unicast。配置出方向的路由策略:
peer [邻居IP地址] route-policy [策略名称] export peer 192.168.0.1 route-policy ext-community-policy export,将扩展团体属性传给对等体。将扩展团体属性发布给对等体:
peer [邻居IP地址] advertise-ext-community。查看BGP路由表:
display bgp routing-table,查看BGP路由表信息。display bgp routing-table [IPv4地址] [掩码长度],查看指定BGP路由的详细信息。查看BGP邻居状态:
display bgp peer,查看BGP邻居的状态信息。以下是华为路由器OSPF和RIP协议的详细配置命令:
启用OSPF进程:
[Huawei] ospf [process-id],例如 ospf 100,创建进程号为100的OSPF进程。配置区域视图:
[Huawei-ospf-100] area [area-id],例如 area 0,进入骨干区域0的配置视图。宣告网络:
[Huawei-ospf-100-area-0.0.0.0] network [ip-address] [wildcard-mask] network 192.168.1.0 0.0.0.255,宣告192.168.1.0/24网段。配置Router ID:
[Huawei] router-id [router-id] router-id 1.1.1.1,需在OSPF进程外配置,建议手动指定避免冲突。虚链路配置:
[Huawei-ospf-100-area-0.0.0.1] vlink-peer [router-id] vlink-peer 2.2.2.2,用于连接非骨干区域到骨干区域。路由汇总:
[Huawei-ospf-100-area-0.0.0.1] abr-summary [ip-address] [mask]。[Huawei-ospf-100] asbr-summary [ip-address] [mask]。区域类型配置:
[Huawei-ospf-100-area-0.0.0.1] stub。[Huawei-ospf-100-area-0.0.0.1] nssa。认证配置:
[Huawei-ospf-100-area-0.0.0.0] authentication-mode { simple | md5 } [password]。[Huawei-GigabitEthernet0/0/0] ospf authentication-mode { simple | md5 } [password]。调整接口开销:
[Huawei-GigabitEthernet0/0/0] ospf cost [value],默认值根据接口带宽自动计算。修改OSPF优先级:
[Huawei-ospf-100] preference [value],默认值10(内部路由)、150(外部路由)。默认路由注入:
[Huawei-ospf-100] default-route-advertise [always],always表示无条件发布默认路由。DR/BDR控制:
[Huawei-GigabitEthernet0/0/0] ospf dr-priority [0-255],优先级为0时接口不参与选举。查看与维护命令:
display ospf peer [brief]。display ospf routing。display ospf interface [interface-type interface-number]。debugging ospf event terminal debugging,调试完成后使用undo debugging all关闭调试。启用RIP协议:
[Huawei] rip [process-id],例如 rip 1,创建RIP实例,实例ID为1。设置RIP版本:
[Huawei-rip-1] version 2,设置RIP版本为2。配置参与RIP的网络:
[Huawei-rip-1] network [network-address] network 192.168.1.0,指定参与RIP的网络。启用RIP接口:
[Huawei] interface [interface-type] [interface-number] interface GigabitEthernet0/0/0。[Huawei-GigabitEthernet0/0/0] rip [process-id] enable,在接口上启用RIP实例。配置RIP认证:
[Huawei-GigabitEthernet0/0/0] rip authentication-mode simple cipher MyPassword。[Huawei-rip-1] authentication-mode simple。配置RIP计时器:
[Huawei-rip-1] timers [update] [invalid] [hold-down] [flush] timers 30 180 180 240,分别设置更新定时器、失效定时器、持有定时器和刷新定时器。配置RIP路由过滤:
[Huawei] acl 2000,[Huawei-acl-basic-2000] rule permit source 192.168.1.0 0.0.0.255。[Huawei] route-policy FILTER permit node 10,[Huawei-route-policy] if-match acl 2000。[Huawei-rip-1] filter-policy FILTER export。配置RIP被动接口:
[Huawei-rip-1] passive-interface GigabitEthernet0/0/1,将指定接口配置为被动接口。查看与维护命令:
display rip [process-id] routing-table。reset rip [process-id]。display rip [process-id] statistics。debugging rip packet,调试完成后使用undo debugging all关闭调试。