华为路由常用命令大全

更新时间:2024-01-13 23:29:01 阅读量: 教育文库 文档下载

说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。

华为路由常用命令大全

dis cur

display 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 ftp

user-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 ;当前端口加入到VLAN port trunk permit vlan {ID|All} ;设trunk允许的VLAN port trunk pvid vlan 3 ;设置trunk端口的PVID undo shutdown ;激活端口 shutdown ;关闭端口 quit ;返回

vlan 3 ;创建VLAN port 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 ;设置主vlan

[SwitchA]isolate-user-vlan secondary ;设置主vlan包括的子vlan 作用为隔离主子VLAN间的主机访问,在同一网段下,主子VLAN可以访问,但是子VLAN间是不能访问的,这是华为的一个突色

[switcha]port-iaolate enable 这是隔离同一VLAN下的主机相互访问, isolate(隔离) port hybrid pvid vlan ;设置vlan的pvid port hybrid pvid ;删除vlan的pvid port hybrid vlan vlan_id_list untagged ;设置无标识的vlan

如果包的vlan id与PVId一致,则去掉vlan信息. 默认PVID=1。 所以设置PVID为所属vlan id, 设置可以互通的vlan为unta

display version ;显示版本信息 display current-configuration ;显示当前配置 display interfaces ;显示接口信息 display ip route ;显示路由信息 sysname ;更改主机名 super passwrod ;设置口令

interface serial0 ;进入接口 ip address ;配置端口IP地址 []undo shutdown ;激活端口

link-protocol hdlc ;绑定hdlc协议 ]user-interface vty 0 4

authentication-mode password

set authentication-mode password simple 222 user privilege level 3 quit

hdlc all serial0 ;显示所有信息

debugging hdlc event serial0 ;调试事件信息 debugging hdlc packet serial0 ;显示包的信息 静态路由:

ip route-static {interface number|nexthop}[value][reject|blackhole]

动态路由:

rip ;设置动态路由 ]rip work ;设置工作允许 rip input ;设置入口允许 rip output ;设置出口允许 network 1.0.0.0 ;设置交换路由网络 network all ;设置与所有网络交换

peer ip-address ;

rip version 1 ;设置工作在版本1 rip version 2 multicast ;设版本2,多播方式 rip split-horizon ;水平分隔

router id ;配置路由器的ID

ospf enable ;启动OSPF协议 import-route direct ;引入直联路由

[Quidway-Serial0]ospf enable area ;配置OSPF区域 标准访问列表命令格式如下:

acl [match-order config|auto] ;默认前者顺序匹配。 rule [normal|special]{permit|deny} [source source-addr source-wildcard|any]

扩展访问控制列表配置命令

配置TCP/UDP协议的扩展访问列表:

rule {normal|special}{permit|deny}{tcp|udp}source {|any}destination |any} [operate]

配置ICMP协议的扩展访问列表:

rule {normal|special}{permit|deny}icmp source {|any]destination {|any] [icmp-code] [logging]

扩展访问控制列表操作符的含义

equal portnumber ;等于

greater-than portnumber ;大于 less-than portnumber ;小于 not-equal portnumber ;不等 range portnumber1 portnumber2 ;区间 PPP设置:

[Quidway-s0]link-protocol ppp ;默认的协议 启动ftp服务:

local-user ftp password {simple|cipher} aaa service-type ftp ftp server enable

本文来源:https://www.bwwdw.com/article/dc1o.html

Top