贼牛逼,3万字把华为HCIA知识点全部总结了!

01 功能记录

1.1 路由器

网络边源使用路由器,因为大部分交换机无法做NAT

1.2 网络

1.2.1 广域网(WAN) 和互联网的区别

互联网开放,而广域网不开放

1.2.2 受传输距离限制怎么传到那么远的地方

使用远距离传输介质,如光设备(传输网)

1.2.3 衡量网络的主要指标

· 带宽(bandwidth) -- 单位 bps

· 延迟(delay)

· 可用性(Availability)

· 扩展性(Scalability)

· 可靠性(Reliability)

1.2.4 以太网

是一种应用最普遍的局域网技术

1.2.5 为何交换机接口无法配置IP地址?

因为华为的VRP(华为网络操作系统)端口分了Route Port 和 Switch Port, 交换端口Switch Port无法配置IP地址

1.3 物理层

1.3.1 单模光纤和多模光纤的区别

· 单模光纤的英文标识为SF(黄色):传输距离远(数十千米),速率快

· 多模光纤的英文标识为MF(桔色):传输距离近(千米内),速率慢,容许不同模式的光

1.3.2 光模块

· SFP 小型可插拔型封装

· eSFP 增强型SFP

· SFP+ 速率提升

· XFP X罗马数字10 , 10G光模块

· QSFP+ 四通道小型可热插拔光模块。

· CFP 高速可热插拔,支持数据通信和电信传输两大应用的新型光模块标准

1.3.3 光衰

一般指光通量,允许光衰最大值-40DB,不能大于-25DB

1.4 经验

1.4.1 排错

在排除网络错误时只看配置没有用,要结合拓扑和日志综合分析

02 网络基础笔记

2.1 数据链路层

2.1.1 OSI七层模型

个人理解:这个模型是一个抽象的概念,相当于一个设计图纸,蓝图;如同汽车的一个设计图纸,便于批量生产,只不过网络根据这来设计一些层次上的东西

2.1.2 以太2型帧和802.3帧的区别

以太2型(Ethrnet_II) 通常用于业务数据,里面包含了上层网络层传输层的信息,如type字段有0x0800--ip,0806--ARP

IEEE802.3 用于交换机之间一些控制协议,如CDP(思科发现协议),生成树的BPDU

2.1.3 交换机转发机制(行为)

· 泛洪:

· 接收到广播帧(目的MAC地址为十六进制的FFFFFFFFFFFF) ------------------ 会触发泛洪

○ 未知单播帧(即在MAC地址表查找不到目的MAC,然后将会泛洪出去) ------------------ 会触发泛洪

○ 向所有接口转发

· 转发

· 丢弃

2.1.4 MAC地址表形成

可以通过源MAC地址学习并绑定端口而自动建立

可以手动配置

2.1.5 MAC地址表震荡(漂移)

· 本质:一个终端的MAC地址同一个时间只能从一个接口学习到

· 过程:若是从其他接口也学习到,后学习到的将会覆盖原有的表项,甚至出现反复,造成震荡

· 诱因:出现环路,形成广播风暴

2.1.6 链路层发现协议

LLDP 用于发现其他设备

思科默认开启CDP(只能发现思科的设备)

2.1.7 帧校验序列(FCS)

俗名:帧尾

用来校验帧,在抓包工具中无法看到

2.2 网络层

三层无广播风暴

2.2.1 IP地址

2.2.1.1 子网划分

为解决地址划分产生的地址浪费而生

· 以子网掩码为中心,根据每个子网的主机数目来确定主机的位数

○ 1 代表网络位(二进制形式)

○ 0 代表主机位(二进制形式)

· 公式:

子网数目 = 2的M次方(M代表子网位数) // 即二进制网络位1的个数

主机数目 = 2的N次方-2(N代表主机位数) // 减掉的是网络地址和广播地址

主机位为全1的地址是广播地址

主机位为全0的地址是网络地址

· 运算例子:

202.100.1.5/30

5 0000 0101 其主机位全部换成0:0000 0100=4

其主机位全部换成1:0000 0111=7

故而网络地址是:202.100.1.4/30

广播地址是:202.100.1.7/30

可用子网:

子网掩码 30 网络位 30 - 24 = 6 2^6 = 64

故 64 个可用子网

可用主机位:

32 - 30 = 2 2^2-2 = 2

故 2 个可用主机

2.2.1.2 ABC 类默认掩码

/8 /16 /24

拓展:D 类 是组播地址 E 类 作为保留

2.2.1.3 常用特殊ip地址

0.0.0.0/0 代表所有网络,常用于指定默认路由

子网掩码 /32 的地址是主机地址

子网掩码 /31 的地址可以在地址匮乏的情况下配置在环回接口或者点到点接口

2.2.1.4 可变长子网掩码(VLSM Variable Length Subnet Mask)

通过扩展子网掩码的网络位来减少主机位,以便减少地址资源浪费

2.2.2 IP报文

标准头部大小20字节

MTU(最大传输单元) 在Ethernet中为1500字节, 是二层以上(不包含二层)承载的总大小

2.2.2.1 重要字段

· Total Length IP报文头部长度 + 上一层的 总字节长度

· Identification 区分分片,相同代表同一个报文

· Flags

○ 保留位

○ DF 1--表示不分片 0--表示分片

○ MF 1--表示更多片 0--表示最后一片

· Fragment Offset 片偏移

· TTL(Time to Live) 生存时间, 三层的防环

2.3 传输层

2.3.1 常用协议端口

2.3.2 TCP

准头部大小20字节

端口大的一端主动发起请求

· 建立连接需要通过三次握手:主要参与报文的标志位 SYN ACK

SYN ------>

<--------SYN, ACK

ACK ------->

· 断开需要四次报文交互:主要参与报文标志位 FIN ACK

FIN, ACK ------->

<-----------ACK

<-----------FIN, ACK

ACK --------->

报文重要字段:

序列号(seq):丢失检测,乱序重排

2.4 交换网络

2.4.1 广播域

基于第二层,在 三层接口(Route Port) 处会被终止

网络中能接收任一设备发出的广播帧的所有设备的集合

根本就是一个网络或者一个子网中的二层区域

可以说路由器的每个接口都是一个广播域

2.4.2 VLAN

Virtual Local Area Network 虚拟局域网

逻辑上从二层进行隔离广播域

二层帧将添加上4字节的Tag

2.4.2.1 Access链路端口

独享链路,只允许唯一的VLAN ID帧通过

进入端口的帧,如果没有Tag则加上缺省VLAN Tag,若有则检查是否相同,不同则丢弃

出端口的帧,去掉Tag

2.4.2.2 Trunk链路

共享链路,允许多个VLAN在同一个链路中转发

· 接收帧,无Tag,若缺省VLAN在允许列表中,则加上缺省VLAN

有Tag,查看是否在可通过列表中,是放行,不是直接丢弃

· 发送帧,VLAN ID和缺省VLAN相同,且在允许列表中,则去掉Tag发送

不同且在允许列表中,则直接发送

2.4.2.3 本征VLAN(缺省VLAN PVID)

历史遗留,解决Trunk链路中Hub集线器连接的终端设备无法解析帧的问题,通过在端口设置本征vlan,帧的VLAN ID和缺省VLAN相同,且在允许通过列表中,去掉Tag,以便中间连接集线器的终端设备可以接收并解析

为防止在Trunk链路上,PVID(本征VLAN)引发的跨越VLAN攻击,一般采用使用一个没有业务的VLAN作为PVID

2.4.2.4 Hybrid链路

入方向增加一个PVID,出方向允许多个VLAN的数据帧转发并移除PVID,前提是在允许的VLAN列表中

可以运用在两个同一个局域网不同VLAN的主机要访问远端一个终端,终端可以访问这两个不同的主机

2.4.3 STP

2.4.3.1 环路引发的广播风暴

· 形成:收到目的mac地址未知的单播帧或者广播帧,然后由泛洪的行为在环路中被无限转发

MAC地址表只能一个接口绑定一个MAC地址,广播风暴会引起MAC地址表震荡

2.4.3.2 BPDU 桥协议数据单元

Bridge Protocol Data Unit

在桥之间交互,从而保证设备完成生成树计算过程

· 包含

○ 根桥ID(RootID): 桥优先级(BridgePriority)+桥mac地址(背板mac,不是端口mac); 桥优先级小的成为根桥,也可以修改优先级来自己决定根桥

○ 根路径开销(RootPathCost)

○ 指定桥ID(DesignatedBridgeID)

○ 指定端口ID(DesignatedPortID)

2.4.3.3 角色

· 根桥: 交换网络会选举一个根桥

· 根端口(RP):每个非根交换机选举一个根端口

· 指定端口(DP):每个条链路选举一个指定端口

阻塞非根、非指定端口(AP)

2.4.2.4 五种端口状态

· 失效(disabled) :不收发任何报文

· **阻塞(blocking/ DISCARDING)**:不接收转发数据报文,只收BPDU却不能发,不进行地址学习

· 监听(listening) :不接收转发数据报文,不地址学习,接收和发送BPDU

· 学习(learning) : 不接收转发数据报文,开始地址学习,接收处理发送BPDU

· 转发(forwarding) :接收转发数据,开始地址学习,接收并发送BPDU

Disabled --> blocking( DISCARDING) --> listening --> learning --> forwarding

2.4.3.5 工作原理

各端口在初始都会生成自己是根桥(Root Bridge)的配置信息(BPDU),并向外发送

收敛后,只有选举出来的根设备发送配置信息(BPDU)

2.4.3.6 思科设备PVST

思科是每个vlan一棵树 ;在802.1D(初级生成树)中 PVST(CISCO特有解决方案)

2.4.3.7 根端口选举

注意:在非根交换机选,按顺序来比较,相同比较下一个,数值越小越优先

· 根路径开销:报文所经链路开销的总和

· 对端BID(桥ID):优先级+背板mac地址

· 对端PID(端口ID):优先级+端口编号

· 本端PID

2.4.3.8 指定端口选举

根交换机的接口都是指定端口(DP),非根交换机的选举根据:

· 根路径开销

· 端口所在交换机(本端)的BID(桥ID)

· 端口所在交换机(本端)的PID(端口ID)

数值小的优先

2.4.3.9 边缘端口

· 原因:端口的状态切换需要时间,这种状态的改变会引起网络震荡(mac地址表不稳定),导致用户流量中断。

所以需要配置边缘端口,解决端口参与生成树计算,加快网络拓扑收敛时间。

· 作用:接口依旧开启stp,但是可以实现快速的到达转发状态

2.4.3.10 BPDU保护

作用:防止边缘端口收到BPDU报文失去边缘端口的属性。

边缘端口收到BPDU报文会失去边缘端口的属性,为防止伪造BPDU攻击,或者保护STP的边界,可配置BPDU保护。

配置BPDU保护后,若是收到BPDU报文,边缘端口将会被error-down,边缘端口属性不变。

2.4.4 以太链路聚合(Link Aggregation)

· 作用:增加链路带宽,提高链路可靠性,在一定位置上消除STP

· 分类:

○ 静态聚合(无聚合协议来协商链路信息)

○ 动态聚合(LACP,链路聚合控制协议,基于IEEE802.3ad)

○ 思科私有PAgP协议

· 条件:

○ 接口同一类型

○ 物理接口数量、速率、双工方式、流控配置必须一致

○ 华为设备为缺省hybrid接口

2.5 路由

注意:两端要通信需要两端都有路由

2.5.1 VLAN间路由

· 作用:解决不同VLAN间不能通信的问题

· 方案:

○ 路由器的单臂路由

○ 三层交换机VLAN接口(SVI)

○ 三层路由接口(把Switch Port 转换成 Route Port, 缺点扩展性差)

2.5.2 网关

数据要到达其他网段,需先经过网关,类似于你要出国,要经过海关检查

2.5.3 VRRP虚拟路由器冗余协议

· 作用:不改变组网,将多个路由虚拟成一个,并通过配置虚拟路由的ip地址为默认网关,实现网关的备份

协议报文(Advertisement), 目的IP 224.0.0.18(组播地址), 目的mac 01-00-5e-00-00-12, 协议号:112

· Master路由器:响应arp请求,并实现转发

· Backup路由器:备胎

· 优先级(Priority): 范围:0-255 数值越大越优先,默认值100

注意:VRRP的主设备=生成树的根设备,否则会出现2层的次优转发,因为有一端链路被stp阻塞了,往没有阻塞方向走

2.5.4 路由种类

· 直连路由

· 静态路由

· 动态路由

2.5.5 路由度量值和优先级

· 度量值(Metric):线路延迟、带宽、线路使用率、线路可信度、跳数、最大传输单元

· 有优先级(AD/Preference): 越小优先级越高

2.5.6 静态路由

不需要报文支持,精准控制,缺点是不会自动调整。

目的地址、掩码、出接口+下一跳地址(对端的IP地址)

目的地址、掩码、出接口(以太网链路不要用,路由器会认为默认路由是直连方式,发送数据的时候会发送请求目的地址的ARP。适用于点到点链路)

2.5.7 ARP

Address Resolution Protocol 地址解析协议

常规动态ARP

代理ARP

免费ARP: 检查IP地址冲突/VRRP、HSRP主设备变化会发送

ARP代理:对于没有配置缺省网关的计算机要和其他网络中的计算机实现通信,网关收到源计算机的 ARP 请求会使用自己的 MAC 地址与目标计算机的 IP地址对源计算机进行应答。

2.5.8 浮动静态路由

AD/优先级的运用,通过设置优先级实现链路冗余,即备胎休眠,主链路崩了,直接上备胎

2.5.9 OSPF 开放式最短路径优先

链路状态路由协议,设计上保证无环(SPF算法)

可划分区域(减少路由器LSDB规模,减少网络流量)

可提供认证功能,报文认证

多点接入需要DR(指定路由器)和BDR(备份指定路由器),DR和BDR他们是基于链路的,不是路由器;选举根据优先级,越大越优先;DR会有但是BDR不一定会有

· 基本过程:

○ 建立OSPF邻居关系

○ 自动同步LSDB(链路状态数据库)

○ 通过LSDB计算全网路由

当一个设备拥有区域0(骨干区域)一级其他区域,那么该路由器是ABR(区域边界路由器)

2.5.10 BGP

工作在应用层,着重于控制路由的传播和选择最优的路由

在AS间提供无环路的路由信息交换

2.6 其他技术

2.6.1 GRE 通用路由封装隧道

众多隧道协议的一种,也是一种vpn,默认不加密(加密需要结合IPSEC)。

它的前提是远程的两端网络可以联通,然后此隧道会进行再封装,保留发送者的源IP和目的IP,再封装一层公网IP,变成双层IP,外层是公网IP,内层是私网IP,从而实现从私网看似是点到点的通信

2.6.2 ACL

访问控制列表,定义报文匹配规则,应用于接口上

对数据进行区分的场合:接口,NAT,路由策略,qos等

思科设备默认拒绝所有,华为设备默认允许所有

2.6.2.1 通配符掩码(不是反掩码)

与子网掩码相似,含义不同

0 表示对应位要比较(比较时通配符和IP地址都为二进制)

1 表示对应位不比较(比较时通配符和IP地址都为二进制)

如:0.0.0.255 比较前24位

2.6.2.2 分类

· 华为

注:五元组是源IP地址,源端口,目的IP地址,目的端口,传输层协议

· 思科

2.6.3 NAT(网络地址转换协议)

私有地址 转换成 公有地址

部署于连接内网和外网的网关设备上

华为使用EasyIP 思科使用PAT(端口地址转换)

NAT服务器:将服务器暴露给公务访问,如提供web或ftp

03 常用命令

3.1 VRP(华为网络操作系统)

3.1.1 查看目录


<LSW1>dir

Directory of flash:/




  Idx  Attr     Size(Byte)  Date        Time       FileName 

    0  drw-              -  Aug 06 2015 21:26:42   src

    1  drw-              -  Aug 25 2020 08:14:05   compatible

    2  -rw-            588  Aug 29 2020 16:29:09   vrpcfg.zip

Attr 中 d 表示目录

3.1.2 基本操作命令

· pwd 查看当前目录

· dir 显示当前目录下文件信息

· more 查看文本文件具体内容

· cd .. 退出到上级目录

· cd 修改用户当前界面的工作目录

· mkdir 创建新的目录

· rmdir 删除目录

· copy 复制文件

· move 移动文件

· rename 重命名文件

3.2 进入用户界面视图

配置登陆设备的各个用户属性的视图

  • 华为
[AR1]user-interface ?

  INTEGER<0,129-149>   The first user terminal interface to be configured

  console              Primary user terminal interface

  current              The current user terminal interface

  maximum-vty          The maximum number of VTY users, the default value is 5

  tty                  The asynchronous serial user terminal interface 

  vty                  The virtual user terminal interface
  • 思科
R1(config)#line ?

  <0-6>    First Line number

  aux      Auxiliary line

  console  Primary terminal line

  vty      Virtual terminal

3.3 修改主机名

· 华为

sysname LS

· 思科

hostname SW1

3.4 设置Console认证

· 华为

user-interface con 0  //进入Console接口

authentication-mode password    //认证模式为密码认证

set authentication password cipher *******  // 设置密码




// 设置延长时间

[AR1]user-interface console 0

[AR1-ui-console0]idle-timeout 120




display users  // 查看是否设置成功

· 思科

line console 0 //进入本地管理接口~Console

password ****** //设置登录Console的密码

login //开关,开启登录的认证




// 设置退出时间

R1(config-line)#exec-timeout 120




// 测试

show users

3.5 设置Telnet远程连接设备

· 华为

telnet server enable  // 有些机器默认不开启,所以需要开启

user-interface vty 0 4 //进入虚拟终端线缆

authentication-mode password //认证模式为密码认证

Please configure the login password (maximum length 16):****

user privilege level 15 //给远程登录用户分配高级别权限

· 思科

enable password Aa111111  // //进入特权模式的密码

line vty 0 4 //进入虚拟终端连接

password Aa111111 //键入Telnet登录的密码

login //开关,即开启Telnet登录   

transport input telnet //允许Telnet登录本设备

3.6 设置ssh(TCP端口22)

· 华为

[AR1]aaa   // 进入aaa认证授权审计

[AR1-aaa]local-user kelliden password cipher Aa111111   // 本地创建用户kelliden以及对应密码

Info: Add a new user.

[AR1-aaa]local-user kelliden privilege level 15  // 设置用户级别15(最高级)

[AR1-aaa]local-user kelliden service-type ssh   // 该用户服务于ssh应用 from wljsghq

[AR1-aaa]quit    

[AR1]ssh user kelliden authentication-type password

 Authentication type setted, and will be in effect next time

[AR1]stelnet server enable // 开启ssh服务

Info: Succeeded in starting the STELNET server.

[AR1]user-interface vty 0 4

[AR1-ui-vty0-4]authentication-mode aaa  // 认证采用aaa,即使用本地创建的aaa账户和密码

[AR1-ui-vty0-4]protocol inbound ssh   // vty 允许 ssh 登录

[AR1-ui-vty0-4]quit

[AR1]quit

<AR1>terminal monitor  //使得远程连接可以显示日志







测试:

[AR2]ssh client first-time enable   // 路由器ssh登录需要使用

[AR2]stelnet 202.100.1.1

Please input the username:kelliden

The server is not authenticated. Continue to access it? (y/n)[n]:y  //继续登录

Save the server's public key? (y/n)[n]:y  //保存公钥

Enter password: // 输入密码

· 思科

R1(config)#ip domain-name kelliden.com  // 配置域名

R1(config)#crypto key generate rsa  //产生key

The name for the keys will be: R1.kelliden.com

...

How many bits in the modulus [512]: 768  //ssh版本2必须768位以上秘钥

% Generating 768 bit RSA keys, keys will be non-exportable...

[OK] (elapsed time was 0 seconds)

*Aug 27 13:47:10.680: %SSH-5-ENABLED: SSH 1.99 has been enabled

R1(config)#username kelliden password Aa111111

R1(config)#line vty 0 4

R1(config-line)#login local   // 通过本地认证登录

R1(config-line)#transport  input ssh  // 允许ssh登录vty

R1(config-line)#













测试:

Internet#ssh -l kelliden 202.100.1.1

R1#show users

    Line       User       Host(s)              Idle       Location

   0 con 0                idle                 00:00:58   

*  2 vty 0     kelliden   idle                 00:00:00 202.100.1.2

3.7 设置FTP

· 华为

常用于升级和备份VRP(华为网络操作系统)

端口20 用于传输数据

端口21 用于传输控制协议

// 1. 开启ftp

[LSW1]ftp server enable 




// 2. 创建ftp登录用户和认证密码

[LSW1]aaa

// privilege 设置权限等级

// ftp-directory  指定ftp目录   flash: 为本机目录

[LSW1-aaa]local-user kelliden password cipher Aa111111 privilege level 15 ftp-directory flash:

[LSW1-aaa]local-user kelliden service-type ftp   // 设置服务类型







// 测试

<AR1>ftp 10.1.11.2

Trying 10.1.11.2 ...

Connected to 10.1.11.2.

220 FTP service ready.

User(10.1.11.2:(none)):kelliden

331 Password required for kelliden.

Enter password:

230 User logged in.

3.8 VLAN配置

3.8.1 创建VLAN

· 华为

[LSW3]vlan batch 8 to 12 99

· 思科

SW3(config)#vlan 8,9,10,11,12,99

3.8.2 配置access接口并设置VLAN

· 华为

interface GigabitEthernet0/0/10

port link-type access

port default vlan 10

· 思科

int e0/0

switchport access vlan 10

switchport mode access   




// 批量配置

SW3(config)#int range e0/0 - 1

SW3(config-if-range)# switchport access vlan 10

SW3(config-if-range)# switchport mode access


3.8.3 查看端口VLAN

· 华为

[LSW3]display port vlan active 

T=TAG U=UNTAG

-------------------------------------------------------------------------------

Port                Link Type    PVID    VLAN List

-------------------------------------------------------------------------------

GE0/0/1             hybrid       1       U: 1

GE0/0/2             hybrid       1       U: 1
· 思科
SW3#show vlan brief 




VLAN Name                             Status    Ports

---- -------------------------------- --------- -------------------------------

1    default                          active    Et0/2, Et0/3, Et1/0, Et1/1

Et1/2, Et1/3

8    VLAN0008                         active    

9    VLAN0009                         active   

3.8.4 配置Trunk端口

· 华为

[LSW3]int GigabitEthernet 0/0/3

[LSW3-GigabitEthernet0/0/3]port link-type trunk 

[LSW3-GigabitEthernet0/0/3]port trunk allow-pass vlan all  // 允许所有vlan通过

· 思科

思科默认允许所有vlan通过

SW1(config)#int e0/3

SW1(config-if)#switchport trunk encapsulation dot1q   // 封装

SW1(config-if)#switchport mode trunk 







SW1# show int trunk 




Port        Mode             Encapsulation  Status        Native vlan

Et0/3       on               802.1q         trunking      1

3.8.5 设置本征VLAN(缺省VLAN PVID)

· 华为

interface GigabitEthernet0/0/3 

port trunk pvid vlan 99

· 思科

interface Ethernet0/3

 switchport trunk native vlan 8

3.8.6 Hybrid(混杂模式)配置

interface GigabitEthernet0/0/1

   port hybrid untagged vlan 10 to 11  // 在发送的时候去掉tag




interface GigabitEthernet0/0/11

   port hybrid pvid vlan 11   // 设置缺省vlan

   port hybrid tagged vlan 11   // 在发送的时候不去掉tag

· 设置缺省vlan -- port hybrid pvid vlan

○ 接口接收到不带VLAN Tag的报文时,打上缺省的VLAN ID。当缺省VLAN ID在允许通过的VLAN ID列表里时,接收该报文并打上缺省VLAN的Tag;当缺省VLAN ID不在允许通过的VLAN ID列表里时,丢弃该报文。

○ 接口接收到带VLAN Tag的报文时,当VLAN ID在接口允许通过的VLAN ID列表里时,接收该报文,当VLAN ID不在接口允许通过的VLAN ID列表里时,丢弃该报文。

○ **接口发送报文时,如果VLAN ID是该接口允许通过的VLAN ID时,发送该报文,可以配置发送报文时 是否携带Tag。**

· 设置不去掉Tag

配置以Tagged形式将Hybrid类型接口加入VLAN后,接口在发送帧时不将帧中的VLAN Tag去掉。

· 设置去掉Tag

配置以Untagged形式将Hybrid类型接口加入VLAN后,接口在发送帧时将帧中的VLAN Tag去掉。

3.9 保存配置

· 华为

<LSW3>save

· 思科

R1# write 

Building configuration...

3.10 清空端口记录

· 华为

华为有些设备不支持

 clear configuration interface g0/0/3 //清除某个接口的配置

· 思科

SW1(config)#default interface e1/2  // 恢复默认设置

3.11 STP

3.11.1 设置主副跟设备

· 思科

// 思科设备一个vlan一棵生成树,所以可以使用vlan来设置,华为不行但可以用MSTP来解决




SW1(config)#spanning-tree mode pvst 

SW1(config)#spanning-tree vlan 8,10,11 root primary // 设置为主

SW1(config)#spanning-tree vlan 1,9,12,99 root secondary // 设置为副

· 华为

[LSW1]stp mode stp  // 802.1D

[LSW1]stp priority 0 // 设置优先级,从而确定为根交换机







[LSW2]stp mode stp  // 802.1D

[LSW2]stp priority 4096 // 另一个交换机设置为副,备胎

3.11.2 配置边缘端口

· 思科

// 作用于端口的命令

SW3(config)#int e0/0

SW3(config-if)#spanning-tree portfast edge 

// 作用于trunk干道,其对端不能是交换机,必须是单独PC、服务器

SW3(config-if)#spanning-tree portfast edge trunk




// 作用域全局的access端口

SW3(config)#spanning-tree portfast edge default

· 华为

// 作用于端口的命令

[LSW3]int g0/0/10

[LSW3-GigabitEthernet0/0/10]stp edged-port enable 







//全局 包括access、trunk、hybrid

[LSW3]stp edged-port default

3.11.3 配置BPDU保护

· 思科

// 端口方式

SW3(config)#int e0/0 

SW3(config-if)#spanning-tree bpduguard enable




// 全局

SW3(config)#spanning-tree portfast edge bpduguard default

· 华为

// 华为多数设备无接口直接开启,只能开启全局(仅对边缘端口生效)

[LSW3]stp bpdu-protection 




// 需要在上行接口关闭边缘端口,否则会因接收到bpdu报文而自动关闭端口

[LSW3]int g0/0/3

[LSW3-GigabitEthernet0/0/3]stp edged-port disable 

[LSW3-GigabitEthernet0/0/3]undo shutdown

3.12 ping发送多个包

· 华为

[AR1]ping -c 1000 10.1.10.1

3.13 配置以太链路聚合

· 思科

SW2(config)#int rang e1/2 - 3

SW2(config-if-range)#channel-group 12 mode on




// 检查

SW2(config)#do show etherchannel summary 

Group  Port-channel  Protocol    Ports

------+-------------+-----------+-----------------------------------------------

12     Po12(SU)         -        Et1/2(P)    Et1/3(P)

· 华为

[LSW2]int Eth-Trunk 12

[LSW2-Eth-Trunk12]trunkport GigabitEthernet 0/0/5 to 0/0/6

3.14 配置单臂路由

· 华为

interface GigabitEthernet0/0/0.20

dot1q termination vid 20

ip address 10.1.20.30 255.255.255.224 

arp broadcast enable // 三层隔绝广播,所以开启arp让两个不同广播域交互相应arp的广播请求

· 思科

interface Ethernet0/0.20

 encapsulation dot1Q 20

 ip address 10.1.20.30 255.255.255.224

3.15 思科路由器模拟PC

S2(config)#no ip routing // 关掉路由,不然他会查路由表,没设置路由协议,到达不了S2(config)#ip default-gateway 10.1.30.30 // 设置默认网关

3.16 配置VLANIF

· 华为

interface Vlanif8

ip address 10.1.10.12 255.255.255.240

· 思科

interface Vlan8ip address 10.1.10.13 255.255.255.240

3.17 配置三层路由接口

· 华为(某些阉割版的交换机无法配置ip地址)

interface Ethernet0/0/1

 undo portswitch

 ip address 1.1.1.1 255.255.254.0

· 思科

interface Ethernet0/1

no switchport

 ip address 10.1.11.1 255.255.255.248

3.18 配置VRRP

· 思科

interface Vlan8

vrrp 8 ip 10.1.10.14

vrrp 8 priority 110




interface Vlan9

vrrp 9 ip 10.1.10.30




interface Vlan10

vrrp 10 ip 10.1.10.46

vrrp 10 priority 110







// 验证

SW2(config)#do show vrrp brief 

Interface          Grp Pri Time  Own Pre State   Master addr     Group addr

Vl8                8   100 3609       Y  Backup  10.1.10.13      10.1.10.14     

Vl9                9   110 3570       Y  Master  10.1.10.29      10.1.10.30     

Vl10               10  100 3609       Y  Backup  10.1.10.45      10.1.10.46 

· 华为

[LSW1]int vlan 8

[LSW1-Vlanif8]vrrp vrid 8 virtual-ip 10.1.10.14 

[LSW1-Vlanif8]vrrp vrid 8 priority 110

// 追踪上行链路,当链路出现问题通过降低优先级进行主备切换

[LSW1-Vlanif8]vrrp vrid 8 track interface g0/0/1 reduced 20







// 验证

[LSW1]dis vrrp brief 

VRID  State        Interface                Type     Virtual IP     

----------------------------------------------------------------

8     Master       Vlanif8                  Normal   10.1.10.14     

9     Master       Vlanif9                  Normal   10.1.10.30     

10    Master       Vlanif10                 Normal   10.1.10.46     

----------------------------------------------------------------

Total:3     Master:3     Backup:0     Non-active:0  

3.19 配置静态路由

· 思科

目的地址 掩码 下一跳地址

R1(config)#ip route 8.8.8.8 255.255.255.255 202.100.1.2

· 华为

[AR1]ip route-static 8.8.8.8 32 202.100.1.2  

3.20 配置浮动静态路由

修改优先级实现链路冗余

· 华为

[AR1]ip route-static 0.0.0.0 0.0.0.0 Serial1/0/0 preference 80

· 思科

R1(config)#ip route 0.0.0.0 0.0.0.0 serial 1/0 80

3.21 配置OSPF

· 思科

R1(config)#router ospf 100  // 启动ospf

R1(config-router)#router-id 1.1.1.1  // 标识区域内唯一身份,确保唯一




R1(config)#int lo0

R1(config-if)#ip add 11.1.1.1 255.255.255.255 

R1(config-if)#ip ospf 100 area 0  // 设置进程号100,该接口启动ospf,运行在区域0中,该接口网络可以通过ospf通告给其他路由器




R1(config)#int e0/1

R1(config-if)#ip add 10.1.11.1 255.255.255.248

R1(config-if)#ip ospf 100 area  1







SW1(config-router)#passive-interface vlan 8 // 抑制接口上的路由更新,不影响路由传递

· 华为

[AR1]ospf 110 router-id 0.0.0.2 // 标识区域内唯一身份,确保唯一

[AR1-ospf-1]area 0   // 创建区域

[AR1-ospf-1-area-0.0.0.0]area 1  // 创建区域

[AR1-ospf-1-area-0.0.0.1]int lo 0

[AR1-LoopBack0]ip add 11.1.1.1 32

[AR1-LoopBack0]ospf enable 110 area 0  // 启用区域0,进程号为110

[AR1-LoopBack0]int g0/0/1

[AR1-GigabitEthernet0/0/1]ospf enable 110 area 1







[LSW1-ospf-1]silent-interface Vlanif 9   // 抑制接口上的路由更新,不影响路由传递




// 控制默认信息的分布,可以将默认路由下发到ospf中

[AR1-ospf-1]default-route-advertise

3.22 重置ospf进程

· 华为

<AR1>reset ospf process

3.23 配置GRE隧道

· 华为

interface Tunnel0/0/0

 ip address 10.1.13.1 255.255.255.252

 tunnel-protocol gre

 source 202.100.1.1   // 本端ip

 destination 202.100.1.5  // 远端ip

· 思科

R3(config)#int tunnel 0

R3(config-if)#ip add 10.1.13.2 255.255.255.252

R3(config-if)#tunnel source 202.100.1.5

R3(config-if)#tunnel destination 202.100.1.1

3.24 配置BGP

· 思科

R1(config)#router bgp 1  // 配置自治系统号为1 

R1(config-router)#neighbor 10.1.13.2 remote-as 2  //BGP都是通过单播手工去配置邻居

R1(config-router)#redistribute ospf 100  // 重发布 ospf




R3(config-router)#network 10.1.30.0 mask 255.255.255.224 // 宣告指定网段 




router ospf 100

 router-id 1.1.1.1

default-information originate  // 控制默认信息的分发,分发默认路由;可以将获取到对端BGP的路由加入进ospf中

· 华为

[AR1]bgp 1

[AR1-bgp]peer 10.1.13.2 as-number 2 // 远端邻居的端口ip,对端自治系统号2

// 引入ospf的路由进bgp,可以分发到远端,1是ospf的进程号

[AR1-bgp]import-route ospf 1







[R3-bgp]network 10.1.20.0 27 // 手动添加网段

[R3-bgp]network 10.1.30.0 27




[AR1]ospf

// 控制默认信息的分布,可以将获取到对端BGP的路由加入进ospf中

[AR1-ospf-1]default-route-advertise

3.25 配置基本ACL

· 思科

R1(config)#ip access-list standard 1R1(config-std-nacl)#5 permit 10.1.10.0 0.0.0.15 //仅仅允许10.1.10.0/28来访问vtyR1(config)#line vty 0 4R1(config-line)#access-class 1 in  // 绑定ACL 1// 测试SW1#telnet 11.1.1.1 /source-interface vlan 8Trying 11.1.1.1 ... % Connection refused by remote hostSW1#

· 华为

[AR1]acl 2000

[AR1-acl-basic-2000]rule 5 deny source 10.1.10.0 0.0.0.15

[AR1-acl-basic-2000]rule 10 permit




[AR1]user-interface vty 0 4

[AR1-ui-vty0-4]acl 2000 inbound // 应用







// 测试




<LSW1>telnet -a 10.1.10.13 11.1.1.1

Trying 11.1.1.1 ...

Press CTRL+K to abort

Error: Failed to connect to the remote host.

<LSW1>

3.26 配置扩展ACL

· 思科

SW1(config)#ip access-list extended 100

SW1(config-ext-nacl)#deny icmp host 10.1.10.1 host 10.1.10.14  // 拒绝10.1.10.1 ping 10.1.10.14

SW1(config-ext-nacl)#permit ip any any   







SW1(config)#int vlan 8

SW1(config-if)#ip access-group 100 in  // 应用

· 华为

[LSW1]acl 3000[LSW1-acl-adv-3000]rule 10 deny tcp destination 10.1.10.14 0 destination-port eq telnet // 拒绝telnet到10.1.10.14[LSW1-acl-adv-3000]rule 20 permit ip [LSW1]user-interface vty  0 4[LSW1-ui-vty0-4]acl 3000 inbound // 应用[LSW1-ui-vty0-4]set authentication password simple 111111// 测试<AR1>telnet 10.1.10.14  Press CTRL_] to quit telnet mode  Trying 10.1.10.14 ...Error: Can't connect to the remote host

3.27 配置NAT

· 华为(EasyIP)

[AR1]acl name nat // 起别名 nat

[AR1-acl-adv-nat]rule 10 permit ip source 10.1.10.0 0.0.0.15

[AR1-acl-adv-nat]rule 15 permit ip source 10.1.10.16 0.0.0.15




[AR1]int g0/0/0

[AR1-GigabitEthernet0/0/0]nat outbound 3999







[AR1]ospf

[AR1-ospf-1]default-route-advertise  // 控制默认信息的分布,将默认路由加入到ospf中

· 思科(PAT端口地址转换)

R1(config)#int range e0/1,e0/2R1(config-if-range)#ip nat inside // 私网要进入公网入方向端口R1(config)#int e0/0R1(config-if)#ip nat outside // 连接公网端口R1(config)#ip access-list standard NAT // 起别名R1(config-std-nacl)#permit 10.1.10.0 0.0.0.15R1(config-std-nacl)#permit 10.1.10.16 0.0.0.15R1(config)#ip nat inside source list NAT interface e0/0 overload --------------------------------------------NAT 便是 起的那个别名overload  过载

3.28 配置NAT服务器/静态端口转换

将服务器暴露给公务访问,如提供web或ftp,这时可以使用NAT服务器

· 华为

// 连接公网的端口,绑定10.1.10.14 23,允许外网telnet进入10.1.10.14

[AR1-GigabitEthernet0/0/0]nat server protocol tcp global current-interface 5555 inside 10.1.10.14 23

· 思科

R1(config)#ip nat inside source static tcp  10.1.10.14 23 202.100.1.1 5555

注意:需要先配置好NAT,上面两条命令才有

3.29 配置aaa认证

· 华为

[LSW3-aaa]

// 账号名是a  密码111111

[LSW3-aaa]local-user a password cipher 111111




// 应用

[LSW3]user-interface vty 0 4

[LSW3-ui-vty0-4]authentication-mode aaa

3.30 配置端口安全

· 华为

[LSW3]port-group port-security  // 端口批量配置的自定义名称:port-security

// 配置端口成员

[LSW3-port-group-port-security]group-member g0/0/10 to g0/0/12




// 开启端口安全

[LSW3-port-group-port-security]port-security enable 

// 最多允许两台连接

[LSW3-GigabitEthernet0/0/12]port-security max-mac-num 2

// 使用粘性绑定mac地址

[LSW3-GigabitEthernet0/0/12]port-security mac-address sticky 










// 验证

[LSW3]disp mac-address

MAC address table of slot 0:

-------------------------------------------------------------------------------

MAC Address    VLAN/       PEVLAN CEVLAN Port            Type      LSP/LSR-ID  

               VSI/SI                                              MAC-Tunnel  

-------------------------------------------------------------------------------

5489-98b1-7b52 8           -      -      GE0/0/10        sticky    -           

-------------------------------------------------------------------------------




端口绑定mac地址,若是跟换直接无法通信

3.31 多端口配置

· 华为

// 端口批量配置的自定义名称:port-security

[LSW3]port-group port-security  

// 配置端口成员

[LSW3-port-group-port-security]group-member g0/0/10 to g0/0/12

// 开启端口安全

[LSW3-port-group-port-security]port-security enable 

[LSW3-GigabitEthernet0/0/10]port-security enable 

[LSW3-GigabitEthernet0/0/11]port-security enable 

[LSW3-GigabitEthernet0/0/12]port-security enable

· 思科

R1(config)#int range e0/1,e0/2

R1(config-if-range)#ip nat inside // 私网要进入公网入方向端口

3.32 远程管理显示管理日志

· 华为

// 远程登录后开启当前终端监视器

<LSW3>terminal monitor

04 查询命令

4.1 查看MAC地址

· 华为

display mac-address

· 思科

show mac address-table

4.2 查看用户

· 华为


<LSW1>display users

User-Intf    Delay    Type   Network Address     AuthenStatus    AuthorcmdFlag

+ 0   CON 0   00:00:00                                             no        Username : Unspecified

· 思科

SW1>show users

Line       User       Host(s)              Idle       Location

*  0 con 0                idle                 00:00:00




Interface    User               Mode         Idle     Peer Address

4.3 查看相连接的设备信息

· 华为(通过LLDP协议)

链路层发现协议(Link Layer Discovery Protocol,LLDP)

lldp enable 


display lldp neighbor brief  // 简短信息
display lldp neighbor  // 详细信息

· 思科

lldp run

lldp enable 




show lldp neighbors

思科还有私有的发现协议CDP,可以用来查看对端的IP

R1> show cdp neighbors detail

4.4 查看配置

· 华为

display current-configuration  // 查看所有配置

display this  // 查看当前配置

· 思科

在配置终端模式 要使用do 即 do show ...

show running-config  // 查看所有配置

show running-config | section ....  //  section 过滤输出的一部分

4.4.1 查看某个接口下的配置

· 思科

SW1# show run int e0/3

· 华为

[LSW1]disp current-configuration int g0/0/1

#

interface GigabitEthernet0/0/1

port hybrid pvid vlan 8

port hybrid untagged vlan 8 10 to 11

4.5 查看TCP

· 华为

[LSW3]disp tcp status 

TCPCB    Tid/Soid Local Add:port        Foreign Add:port      VPNID  State

17075cc0 77 /1    0.0.0.0:23            0.0.0.0:0  -1     Listening           

· 思科

R1#show tcp brief

TCB       Local Address               Foreign Address             (state)

E1BAFA80  202.100.1.1.23             202.100.1.2.49356           TIMEWAIT

4.6 查看历史命令记录

· 华为

[AR1] display history-command

· 思科

R1# show history

4.7 查看stp

· 华为

<LSW3>disp stp brief 

MSTID  Port                        Role  STP State     Protection

0    GigabitEthernet0/0/1        ROOT  FORWARDING      NONE

0    GigabitEthernet0/0/3        ALTE  DISCARDING      NONE

0    GigabitEthernet0/0/10       DESI  FORWARDING      NONE

0    GigabitEthernet0/0/11       DESI  FORWARDING      NONE

0    GigabitEthernet0/0/12       DESI  FORWARDING      NONE    

· 思科

// 注意:在思科中是一个vlan一棵树,思科通过在桥优先级处加上vlan号来区分不同的vlan

SW3#show spanning-tree vlan 10

4.7.1 查看端口有关stp详细信息

· 华为

[LSW3]disp stp  interface g0/0/3

-------[CIST Global Info][Mode MSTP]-------

CIST Bridge         :32768.4c1f-ccbd-35ba

Config Times        :Hello 2s MaxAge 20s FwDly 15s MaxHop 20

Active Times        :Hello 2s MaxAge 20s FwDly 15s MaxHop 20

...

· 思科

SW3#show spanning-tree int e0/3




Vlan                Role Sts Cost      Prio.Nbr Type

------------------- ---- --- --------- -------- --------------------------------

VLAN0001            Altn BLK 100       128.4    Shr 

VLAN0008            Root FWD 100       128.4    Shr 

VLAN0009            Altn BLK 100       128.4    Shr 

VLAN0010            Root FWD 100       128.4    Shr 

VLAN0011            Root FWD 100       128.4    Shr 

VLAN0012            Altn BLK 100       128.4    Shr 

VLAN0099            Altn BLK 100       128.4    Shr

4.7.2 查看边缘端口

· 思科

SW3(config)#do show spanning-tree vlan 10 int e0/1 detail 

 Port 2 (Ethernet0/1) of VLAN0010 is designated forwarding 

   Port path cost 100, Port priority 128, Port Identifier 128.2.

   Designated root has priority 24586, address aabb.cc00.4000

   Designated bridge has priority 32778, address aabb.cc00.6000

   Designated port id is 128.2, designated path cost 100

   Timers: message age 0, forward delay 0, hold 0

   Number of transitions to forwarding state: 1

   The port is in the portfast edge mode by default

   Link type is shared by default

   BPDU: sent 25667, received 0




// The port is in the portfast edge mode by default

· 华为

[LSW3]disp stp int g0/0/10

......

----[Port10(GigabitEthernet0/0/10)][FORWARDING]----

......

 Port Edged          :Config=enabled / Active=enabled

4.7.3 查看是否配置BPDU保护

· 思科

Bpdu guard is enabled guard : n. 守卫;警戒;护卫队;防护装置

W3(config)#do show spanning-tree vlan 10 int e0/0 detail 

Port 1 (Ethernet0/0) of VLAN0010 is designated forwarding 

Port path cost 100, Port priority 128, Port Identifier 128.1.

Designated root has priority 24586, address aabb.cc00.4000

Designated bridge has priority 32778, address aabb.cc00.6000

Designated port id is 128.1, designated path cost 100

Timers: message age 0, forward delay 0, hold 0

Number of transitions to forwarding state: 1

The port is in the portfast edge mode

Link type is shared by default

Bpdu guard is enabled

BPDU: sent 30292, received 0

· 华为

[LSW3]disp stp int g0/0/10

-------[CIST Global Info][Mode STP]-------

......

BPDU-Protection     :Enabled

4.8 查看以太聚合链路

· 思科

show interfaces port-channel 12 // 相当于直接查看聚合端口信息

show etherchannel summary // 查看聚合端口的状态

show spanning-tree int port-channel 12 //查看stp信息

· 华为

[LSW2]dis eth-trunk 12

Eth-Trunk12's state information is:

WorkingMode: NORMAL         Hash arithmetic: According to SIP-XOR-DIP         

Least Active-linknumber: 1  Max Bandwidth-affected-linknumber: 8              

Operate status: up          Number Of Up Port In Trunk: 2                     

--------------------------------------------------------------------------------

PortName                      Status      Weight 

GigabitEthernet0/0/5          Up          1      

GigabitEthernet0/0/6          Up          1    

4.9 查接口状态

· 华为

[LSW1]disp ip int brief

· 思科

SW2#show ip int b

4.10 查看vrrp信息

· 华为

[LSW1]dis vrrp brief

VRID  State        Interface                Type     Virtual IP

----------------------------------------------------------------

8     Master       Vlanif8                  Normal   10.1.10.14

9     Master       Vlanif9                  Normal   10.1.10.30

10    Master       Vlanif10                 Normal   10.1.10.46

----------------------------------------------------------------

Total:3     Master:3     Backup:0     Non-active:0 

· 思科

SW2(config)#do show vrrp brief

Interface          Grp Pri Time  Own Pre State   Master addr     Group addr

Vl8                8   100 3609       Y  Backup  10.1.10.13      10.1.10.14

Vl9                9   110 3570       Y  Master  10.1.10.29      10.1.10.30

Vl10               10  100 3609       Y  Backup  10.1.10.45      10.1.10.46

4.11 查看指定路由

· 思科

R1(config)#do show  ip route 8.8.8.8

Routing entry for 8.8.8.8/32

Known via "static", distance 1, metric 0

Routing Descriptor Blocks:

  * 202.100.1.2

Route metric is 0, traffic share count is 1

· 华为

[AR1]dis ip routing-table 8.8.8.8

Route Flags: R - relay, D - download to fib

------------------------------------------------------------------------------

Routing Table : Public

Summary Count : 1

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface




8.8.8.8/32  Static  60   0        RD   202.100.1.2     GigabitEthernet0/0/0  

4.12 根据指定协议查看路由

· 华为

<AR1>disp ip routing-table protocol static

Route Flags: R - relay, D - download to fib

------------------------------------------------------------------------------

Public routing table : Static

         Destinations : 1        Routes : 1        Configured Routes : 1




Static routing table status : <Active>

         Destinations : 1        Routes : 1




Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface




        0.0.0.0/0   Static  60   0      RD   202.100.1.2     GigabitEthernet0/0/0    

· 思科

R1(config)#do show ip route static

....

Gateway of last resort is 0.0.0.0 to network 0.0.0.0




S*    0.0.0.0/0 is directly connected, Serial1/0

4.13 查看ospf邻居

· 思科

R1(config)#do show ip ospf neighbor




Neighbor ID     Pri   State           Dead Time   Address         Interface

10.1.12.2         1   FULL/BDR        00:00:36    10.1.12.2       Ethernet0/2

2.2.2.2           1   FULL/DR         00:00:33    10.1.11.2       Ethernet0/1

· 华为

[AR1]disp ospf peer brief

Sep  8 2020 22:14:26-08:00 AR1 %%01OSPF/4/NBR_CHANGE_E(l)[4]:Neighbor changes event: neighbor status changed. (ProcessId=256, NeighborAddress=2.12.1.10, NeighborEvent=LoadingDone, NeighborPreviousState=Loading, NeighborCurrentState=Full) 

[AR1]disp ospf peer brief




         OSPF Process 1 with Router ID 1.1.1.1

                  Peer Statistic Information

----------------------------------------------------------------------------

 Area Id          Interface                        Neighbor id      State    

0.0.0.1          GigabitEthernet0/0/1             2.2.2.2          Full

0.0.0.1          GigabitEthernet0/0/2             3.3.3.3          Full

----------------------------------------------------------------------------

4.14 查看ospf接口

· 华为

[LSW1]dis ospf interface Vlanif 8




OSPF Process 1 with Router ID 2.2.2.2

Interfaces







Interface: 10.1.10.13 (Vlanif8)

Cost: 1       State: DR        Type: Broadcast    MTU: 1500  

Priority: 1

Designated Router: 10.1.10.13

Backup Designated Router: 0.0.0.0

Timers: Hello 10 , Dead 40 , Poll  120 , Retransmit 5 , Transmit Delay 1 

Silent interface, No hellos







--------------------------------------------

Type: Broadcast   网络类型是广播

State: DR    指定路由

4.15 查看BGP邻居

· 思科

R3#show ip bgp summary 

BGP router identifier 202.100.1.5, local AS number 2

BGP table version is 1, main routing table version 1




Neighbor        V           AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd

10.1.13.1       4            1       4       4        1    0    0 00:00:48        0

· 华为

[R3]dis bgp peer




BGP local router ID : 10.1.20.30

Local AS number : 2

Total number of peers : 1                Peers in established state : 1




Peer            V          AS  MsgRcvd  MsgSent  OutQ  Up/Down       State PrefRcv




10.1.13.1       4           1        3        3     0 00:01:20 Estab lished       0

4.16 查看BGP路由表

· 华为

[AR1]dis bgp routing-table 




BGP Local router ID is 202.100.1.1 

Status codes: * - valid, > - best, d - damped,

h - history,  i - internal, s - suppressed, S - Stale

Origin : i - IGP, e - EGP, ? - incomplete







Total Number of Routes: 11

Network            NextHop        MED        LocPrf    PrefVal Path/Ogn




*>   10.1.10.0/28       0.0.0.0         2                     0      ?

*>   10.1.10.14/32      0.0.0.0         2                     0      ?

*>   10.1.10.16/28      0.0.0.0         2                     0      ?

*>   10.1.10.30/32      0.0.0.0         2                     0      ?

*>   10.1.10.32/28      0.0.0.0         2                     0      ?

*>   10.1.10.46/32      0.0.0.0         2                     0      ?

*>   10.1.11.0/29       0.0.0.0         0                     0      ?

*>   10.1.12.0/29       0.0.0.0         0                     0      ?

*>   10.1.20.0/27       10.1.13.2       0                     0      2i

*>   10.1.30.0/27       10.1.13.2       0                     0      2i

*>   11.1.1.1/32        0.0.0.0         0                     0      ?







----------------------------------------

2i : i即internal,内嵌的,土著,BGP自身的,远端通过network配置

2 是 AS号码

4.17 查看ACL

· 思科

R1#show access-lists

Standard IP access list 1

    10 deny   10.1.10.0, wildcard bits 0.0.0.15 (1 match)

    15 permit any (2 matches)

· 华为

[AR1]disp acl all 

Total quantity of nonempty ACL number is 1 




Basic ACL 2000, 1 rule

Acl's step is 5

rule 5 deny source 10.1.10.0 0.0.0.15 (2 matches)

4.18 查看NAT转换

· 思科

R1#show ip nat translations

Pro Inside global      Inside local       Outside local      Outside global

icmp 202.100.1.1:30    10.1.10.1:30       8.8.8.8:30    8.8.8.8:30     

· 华为

<AR1>dis nat outbound 
NAT Outbound Information:
--------------------------------------------------------------------------
Interface                     Acl     Address-group/IP/Interface      Type
--------------------------------------------------------------------------
GigabitEthernet0/0/0         3999                    202.100.1.1    easyip  
--------------------------------------------------------------------------
  Total : 1
 
 

05 设备操作常用快捷键

06 Windows操作

mstsc 打开远程桌面连接

nslookup www.baidu.com

想获取更多『 华为 | 思科 | 华三 | 红帽 | Oracle | K8s | 软考 | PMP | OCP | CAISP | CISP | CISSP | ITIL® | ITSS | 微软云 | 阿里云 | AWS | 腾讯云 | 麒麟认证 | 工信部认证 | 信创认证 』、『 考证咨询 | 认证真题 | 职业规划 | 岗位内推 』,请关注公众号:HCIE考证研究所

猜你喜欢

转载自blog.csdn.net/HCIE_SPOTO/article/details/143157145
今日推荐