【网络工程师必备】华为设备网络基础配置命令总结,看过的都收藏了

频道:行业资讯 日期: 浏览:1060

今天小编来给大家讲讲华为设备网络基础配置命令吧~

【网络工程师必备】华为设备网络基础配置命令总结,看过的都收藏了

1.路由器:

dispaly version 显示系统软件版本及硬件信息

system-view 切换到系统视图

quit 返回

interface +接口 进入接口视图

ip address +IP +mask 配置IP和子网掩码

return 返回用户视图

<Ctrl+Z> 返回用户视图

sysname R1 修改路由器名称为R1

clock timezone BJ add 08:00:00 设置所在的时区为北京

clock datetime 11:23:24 2019-4-9 修改系统日期和时间为2019年4月9日11点23分24秒

header login information “hello” 设置登录时的标题文本为hello

header shell information “Welcom” 设置设备登陆成功后的标题文本信息为“Welcome”

display current-configuration 查看路由器当前配置

dispaly interface +接口 查看路由器接口的状态信息

save 保存当前配置

display ip interface brief 查看接口与IP相关摘要信息

display ip routing-table 查看路由表

2.命令行帮助:

获取该命令视图下所有的命令及其简单描述

interface ? 列出interface全部关键字或参数及其简单描述

rou? 列出以“rou”字符串开头的所有命令及其简单描述

3.telnet远程登陆配置:

user-interface vty 0 4 进入0~4前五个的VTY用户界面进行整体配置

authentication-mode password 设置验证方式为密码

user privilege level 3 设置用户登陆级别

aaa 进入aaa视图

local-user admin password cipher hello privilege level 3 在aaa视图下设置账号密码 和用户级别

local-user admin service-type telnet 配置该用户接入类型为aaa

q 退回到用户视图

user-interface vty 0 4 进入到VTY用户视图

authentication-mode aaa 设置验证方式aaa

4.配置Stelnet:

配置SSH server:rsa local-key-pair create 生成本地RSA主机密钥对

display rsa local-key-pair public 查看本地密钥对中的公钥信息

user-interface vty 0 4 进入VTY用户视图

authentication-mode aaa 设置用户验证方式为aaa授权验证方式

protocol inbound ssh 指定VTY用户只支持ssh

q 返回到系统视图

aaa 进入aaa视图

local-user huawei1 password cipher huawei1 创建用户和设置用户密码

local-user huawei1 service-type ssh 配置本地用户接入类型为ssh

q 退回到用户视图

ssh user huawei1 authentication-type password 新建ssh用户指定ssh用户认证方式为password

aaa 进入aaa视图

local-user huawei1 privilege level 3 设置huawei1用户级别为3 级别范围0~15

stelnet server enable 开启ssh功能

display ssh user-information huawei1 查看ssh用户配置信息不指定用户默认查看所有用户

display ssh server status 查看ssh服务器全局配置信息

5.配置SSH-client:

server:aaa 进入aaa视图

local-user huawei2 password cipher huawei2 设置用户名和密码

local-user huawei2 service-type ssh 配置本地用户的接入类型为ssh

local-user huawei2 privilege level 3 设置用户级别为3

local-user huawei2 ftp-directory flash: 指定FTP用户的可访问目录,如果不配置用户将无法登陆

ssh user huawei2 authentication-type password 新建ssh用户指定用户认证方式为密码

sftp server enable 开启sftp服务器功能

display ssh server status 查看ssh服务器配置信息

display ssh server session 查看ssh服务器端的当前会话连接信息

client:sftp 10.1.1.2 登陆S2

6.配置通过FTP进行文件操作

ftp 10.0.2.1 连接远程ftp服务器

ls 查看FTP服务器文件夹状态

cd +文件夹名 进入文件夹

dir 查看详细的文件属性

get +文件名 下载文件到本地

put +旧文件名 +新文件名 上传文件到FTP服务器

配置路由器为ftp Server

sys 进入系统视图

aaa 进入aaa视图

local-user ftp password cipher huawei 设置用户名ftp和密码huawei

local-user ftp ftp-directory flash: 指定FTP用户的可访问目录,如果不配置用户将无法登陆

local-user ftp service-type ftp 设置服务类型为ftp

local-user ftp privilege level 15 设置用户优先级为15

7.配置交换机双工模式

interface +接口 进入到某一接口

undo negotiation auto 命令关掉自协商功能

duplex full 指定双工模式为全双工

speed 10 配置接口速率为10Mbit/s

arp static 10.1.2.3 5489-9827-0ECD 配置静态arp表

arp-proxy enable 开启arp代理功能具体到接口

8.划分vlan

vlan 10 划分Vlan10

vlan batch 30 40 同时创建vlan30和40

dispaly vlan 查看vlan信息

int e0/0/1 进入某一个接口

port link-type access 配置接口类型为access

port default vlan 10 配置接口加入相应的vlan

int e0/0/1 进入某一个接口

port link-type trunk 配置接口类型为trunk

port trunk allow-pass vlan 10 20 允许vlan 10 20 的数据通过

port trunk allow-pass vlan all 允许所有vlan通过

int e0/0/1

undo port default vlan 恢复接口默认vlan

port link-type hybrid 修改接口类型为hybrid

port hybrid untagged vlan 20 命令交换机在该接口转发VLAN 20的帧时,剥离掉相应的VLAN Tag 20,以Untagged的方式发送给PC

port hybrid pvid vlan 20 设置hybrid接口的默认VLAN ID

port hybrid tagged vlan 10 20 设置该链路仅接收带有VLAN Tag 10 和 20 的帧

9.配置路由器子接口封装VLAN

interface GigabitEthernet 0/0/1.1 路由器上创建子接口

dot1q termination vid 10 配置子接口对一层tag报文的终结功能

arp broadcast enable 开启子接口的arp广播功能

10.三层交换机实现VLAN间路由

vlan batch 10 20 创建VLAN 10 20

int g0/0/1

port link-type access 设置接口类型

port default vlan 10 划分接口g0/0/1到vlan 10

interface Vlanif 10 创建Vlanif接口设置其对应接口ID为10

ip address 192.168.1.254 24 设置其Vlanif 接口ip地址

【网络工程师必备】华为设备网络基础配置命令总结,看过的都收藏了

11.STP配置和选路规则

stp enable 在交换机上启用STP

stp mode stp

dis stp 查看stp配置

dis stp brief 查看接口摘要信息

stp priority 4096 修改交换机优先级为4096

stp root primary 设置交换机为主根交换机

stp root secondary 命令配置备份交换机

display stp interface Ethernet 0/0/2 查看e0/0/2接口的开销值

int e0/0/2

stp cost 2000 配置接口e0/0/2的带价值为2000

stp timer forward-delay 3000 修改STP的Forward Delay时间为3000cs也就是30s

stp bridge-diameter 3 命令设置网络的直径为3

stp mode rstp 启用RSTP使用RSTP可以缩短收敛时间

int e0/0/1

stp edged-port enable 配置接口e0/0/1为边缘端口不参与生成树的计算

12.配置MSTP多实例

stp region-configuration 进入MST域视图

region-name huawei 配置MST域名为huawei

revision-level 1 配置MSTP的修订级别为1

instance 1 vlan 10 指定VLAN 10映射到MSTI 1

active region-configuration 激活MST域配置

display stp region-configuration 查看交换机上当前生效的MST域配置信息

dis stp instance 0 brief 查看实例0中的生成树状态和统计的摘要信息

stp instance 2 priority 0 配置交换机成位实例2中的根交换机

13.GVRP基础配置

int G0/0/1

port link-type trunk 配置接口类型为trunk

port trunk allow-pass vlan all 允许所有VLAN通过

int e0/0/1

port link-type access 配置接口类型为access

port default vlan 10 将接口e0/0/1划入VLAN 10

grvp 交换机上开启GVRP功能

int g0/0/1

gvrp 在接口g0/0/1开启gGVRP功能

还需在某个交换机的右侧接口手动配置VLAN实现双向注册GVRP

14.配置Eth-Trunk 1聚合链路

interface Eth-Trunk 1 创建Eth-Trunk 1 接口

mode manual load-balance 指定为手工负载分担模式

int g0/0/1 进入接口

eth-trunk 1 将接口g0/0/1加入到Eth-Trunk 1接口

display eth-trunk 1 查看Eth-Trunk 1接口状态

int g0/0/1 进入接口

undo eth-trunk 删除聚合链路接口下的g0/0/1

mode lacp-static 将工作模式改为静态LACP

然后将所有接口加入到聚合链路Eth-trunk 1

lacp priority 100 修改交换机优先级为一百 (值越低优先级越高)

interface Eth-Trunk 1

max active-linknumber 2 设置活动接口的上限阈值

接下来修改聚合链路中接口g0/0/1和g0/0/2的优先级

15.配置浮动静态路由实现路由备份(网络冗余)

ip route-static 192.168.20.0 24 10.0.12.2 preference 100 设置备份路由并将优先级设置为100

display ip routing-table protocol static 查看静态路由的路由信息

16.RIP路由协议配置

rip 创建开启协议进程

network + ip 对指定网段接口使能RIP功能IP地址是与路由器直连的网段

debugging rip 1 查看RIP定期更新情况

terminal debugging

terminal monitor 在屏幕上显示debug信息

undo debugging rip 1undo debug all 命令关闭debug调试功能

在上面的配置基础上配置RIP2

rip 进入子视图模式

version 2 配置版本

或者直接配置

rip 1

version 2

network + ip

rip简单认证

rip authentication-mode simple huawei 在需要的路由器上配置密码要相同

17.配置RIPv2 MD5 密文验证

rip authentication-mode md5 usual huawei 方式使用MD5密文验证,使用通用报文格式,两端报文格式必须一致

dis default-parameter rip 查看RIP配置信息

18.配置RIPv2自动汇总路由(默认关闭)

方法1:

rip 1

version 2

summary always

方法2:

int + 接口

undo rip split-horizon 关闭水平分割功能

19.配置RIPv2手动汇总

(需停止RIPv2自动汇总功能)

int +接口

rip summary-address 3.3.0.0 255.255.252.0 手动汇总ip+掩码

配置RIP版本兼容

rip version 2 broadcast 命令路由器以广播的形式发送RIPv2报文

rip version 2 multicast 命令路由器以组播的形式发送RIPv2报文

20.配置RIP定时器,优先级

int + 接口

undo rip output 让路由器停止发送RIP路由更新

display rip 1 database 检查RIP发布数据库中的所有路由激活

rip

timers rip 20 120 60 设置更新报文时间为20s,超时计时器为120s,垃圾收集计时器为60s

preference 90 修改RIP协议优先级为90

21.配置抑制接口

(只接受RIP更新报文,不发送更新报文)

rip 1

silent-interface GigabitEthernet 0/0/0 设置要抑制的接口

配置RIP单播更新(由于配置了抑制接口,接口无法以广播或者组播的方式发送RIP更新报文)

rip 1

peer 172.16.1.100 IP地址为邻居路由器的IP地址

另一种方法(删除上面的配置)

undo rip output 禁止这个接口发送RIP报文

undo rip input 禁止这个接口接收RIP报文

22.RIP与不连续子网(解决不连续子网问题)

方法1给接口配置第二个IP地址,应该取配置网段的子网,适合小型网络

ip address 10.0.23.2 sub

方法2使用RIPv2,关闭自动汇总

rip

version 2

undo summary

undo rip split-horizon 关闭水平分割功能(进入接口)

rip split-horizon 开启水平分割功能

rip poison-reverse 开启毒性逆转功能

增加度量值(进入接口)

rip metricin 2 增加度量值2端口出去的跳数

rip metricout 2 增加度量值2端口进来的跳数

Rip路由引入(需保证被引入的路由条目已经存在于当前设备中)

rip

import-route direct 直连路由,一般是本地接口的地址

rip

import-route static 静态路由,是引入的你在设备上配置的静态路由。

23.OSPF单区域配置

ospf 1 进入ospf视图1代表进程号

area 0 创建区域并进入OSPF区域视图,输入要创建的区域ID,骨干区域即区域0

network +IP +匹配码

display ospf interface 命令查看OSPF接口通告是否正确、

display ospf peer 查看OSPF邻居状态

display ip routing-table protocol ospf 查看OSPF路由表

24.配置OSPF区域明文认证

ospf 1

area 1

authentication-mode simple plain huawei plain是口令以明文方式显示

authentication-mode md5 1 huawei 配置区域密文认证

25.配置链路认证

int g0/0/1

ospf authentication-mode md5 1 huawei 在一条链路中的两个接口配置要相同

26.配置抑制接口

ospf 1

silent-interface GigabitEthernet 0/0/1 禁止接口g0/0/1接收和发送ospf报文

技巧对多个接口配置接口抑制

ospf 1

silent-interface all 抑制所有接口

un

display ip routing-table 10.0.1.1 查看10.0.1.1所在网段的路由条目

基于接口修改

int g0/0/0

ospf network-type p2mp 修改ospf的网络类型为多到多点

ospf network-type broadcast 修改ospf的网络类型为广播

ospf dr-priority 100 修改g0/0/0接口的DR优先级为100

reset ospf process 重启ospf进程

ospf cost 1000 修改ospf的开销值为1000

ospf timer hello 20 修改HELLO计时器为20s

ospf timer dead 80 修改dead计时器为80s

ospf 1

preference 110 修改ospf优先级为110 值越大优先级越低

27.路由引入:

ospf 1

import-route rip 1 在ospf进程中引入rip

default-route-advertise always 在ospf进程中引入默认路由

rip

import-route ospf 1 在rip进程中引入ospf

import-route ospf cost 3 ospf 引入rip时配置开销值

default-route originate 在RIP进程中发布默认路由

28.vrrp(虚拟路由器冗余协议)基本配置

int g0/0/0

vrrp vrid 1 virtual-ip 172.16.1.254 创建VRRP备份组,备份组号为1,配置虚拟IP为172.16.1.254

vrrp vrid 1 priority 120 修改优先级为120

display vrrp 查看vrrp信息

display vrrp brief

display vrrp interface g0/0/0 查看VRRP的工作状态

29.配置VRRP多备份组

int g0/0/0

vrrp vrid 1 virtual-ip 172.16.1.254 创建VRRP备份组,备份组号为1,配置虚拟IP为172.16.1.254

vrrp vrid 1 priority 120 修改优先级为120

vrrp vrid 2 virtual-ip 172.16.1.253 创建VRRP备份组,备份组号为2,配置虚拟IP为172.16.1.253

int g0/0/0

vrrp vrid 1 virtual-ip 172.16.1.254 创建VRRP备份组,备份组号为1,配置虚拟IP为172.16.1.254

vrrp vrid 2 virtual-ip 172.16.1.253 创建VRRP备份组,备份组号为2,配置虚拟IP为172.16.1.253

vrrp vrid 2 priority 120 修改优先级为120

vrrp vrid 2 preempt-mode disable 开启非抢占方式

30.配置VRRP的跟踪接口及认证

int g0/0/1

vrrp vrid 1 track interface GigabitEthernet 0/0/0 reduced 50 监视上行接口G0/0/0,当此接口断掉时,裁减优先级50,使优先级为70

vrrp vrid 1 authentication-mode md5 huawei 认证配置

小编今天就写到这里吧 看到这里了 不给小编动动你们发财的小手点个赞嘛!!!另外欢迎大家关注我~

贴心的小编为大家整理了网工必备的题库视频 大家评论学习自行获取噢

0 留言

评论

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。
验证码