【软考网工】华为交换机命令
目录
- 1、华为交换机命令行的三种视图
- 2、修改交换机名称
- 3、关闭和开启信息中心
- 4、vlan
- 附录:
交换机型号:S5700
1、华为交换机命令行的三种视图
<Huaweu> #用户视图。特征:尖括号、用户名。
[Huawei] #系统视图。特征:方括号、用户名。
[Huawei-xxx] #业务视图。特征:方括号、用户名、短横、业务名。xxx表示具体业务
用户视图,开机默认视图,对软考中没啥用。
系统视图,修改用户名、密码、时间、查看当前配置。
业务视图,其中具体业务视图主要包括接口视图、路由协议视图、vlan视图。
三种视图间切换:
<Huawei>system-view #用户视图切换到系统视图
[Huawei]interface GigabitEthernet 0/0/1 #系统视图切换到具体的业务视图
[Huawei-GigabitEthernet0/0/1]q #具体的业务视图回退到系统视图。补全为quit
[Huawei]q #系统视图回退到用户视图。补全为quit
<Huawei>
执行quit命令,可从当前视图退出至上一层视图。执行return命令可以从任意视图返回到用户视图。
2、修改交换机名称
[Huawei]sysname Switch-01
[Switch-01]
3、关闭和开启信息中心
[HUAWEI]undo info-center enable #关闭信息中心
[HUAWEI]info-center enable #打开信息中心
4、vlan
[Huawei]display vlan #查看本交换机vlan
[Huawei]vlan 5 #创建名为5的单个vlan
[Huawei]vlan batch 21 23 29 to 40 #批量创建名为21、23、29~40的vlan
[Huawei]undo vlan 5 #删除vlan 5
[Huawei]undo vlan batch 21 23 29 to 40 #批量删除vlan 21、23、29~40
[Huawei]interface vlan 5 #将vlan 5当作一个虚拟接口,SVI技术
[Huawei-Vlanif5]ip address 192.168.1.254 24 #给这个虚拟接口配置一个管理IP地址
[Huawei-Vlanif5]interface g0/0/1 #配置g0/0/1端口
[Huawei-GigabitEthernet0/0/1]port link-type access #将g0/0/1端口的链路类型配置成接入模式
[Huawei-GigabitEthernet0/0/1]port default vlan 5 #将g0/0/1端口加入vlan 5
[Huawei-GigabitEthernet0/0/1]q #从业务视图推出至系统视图
[Huawei]telnet server enable #开启交换机的telnet功能(默认是关闭的)
附录:
键入 ? 可以查看当前视图下所有可用命令。
用户视图下可用命令:
<Huawei>?
User view commands:
cd Change current directory
check Check information
clear Clear information
clock Specify the system clock
cluster Run cluster command
cluster-ftp FTP command of cluster
compare Compare function
configuration Configuration interlock
copy Copy from one file to another
debugging Enable system debugging functions
delete Delete a file
dir List files on a file system
display Display current system information
fixdisk Recover lost chains in storage device
format Format the device
ftp Establish an FTP connection
hwtacacs-user
kill Release a user terminal interface
language-mode Specify the language environment
lldp Link Layer Discovery Protocol
local-user Add/Delete/Set user(s)
lock Lock the current user terminal interface
mkdir Create a new directory
more Display the contents of a file
move Move the file
mtrace Trace route to multicast source
ntdp Run NTDP commands
patch Patch subcommands
ping Send echo messages
pwd Display current working directory
quit Exit from current command view
reboot Reboot system
refresh Do soft reset
rename Rename a file or directory
reset Reset operation
rmdir Remove an existing directory
save Save current configuration
schedule Schedule system task
screen-length Set the number of lines displayed on a screen
screen-width Set screen width
send Send information to other user terminal interfaces
set Set
stack Stack
start-script Start a script on an user-interface
startup Configure parameter for system to startup
super Privilege current user a specified priority level
system-view Enter the system view
telnet Establish a Telnet connection
terminal Set the terminal line characteristics
test-aaa Accounts test
tftp Establish a TFTP connection
trace Trace route (switch) to host on Data Link Layer
tracert Trace route to host
undelete Recover a deleted file
undo Cancel current configuration
unzip Decompress a file
zip Compress a file
<Huawei>
系统视图下可用命令
[Huawei]?
System view commands:
aaa AAA
acl Specify ACL configuration information
alarm Enter the alarm view
anti-attack Specify anti-attack configurations
application-apperceive Set application-apperceive information
arp ARP module
arp-miss Specify ARP MISS configuration information
arp-suppress Specify arp suppress configuration information,
default is disabled
authentication Authentication
autoconfig AutoConfig configuration information
bfd Bidirectional Forwarding Detection
bgp Border Gateway Protocol(BGP)
bootrom BootRom
bpdu BPDU message
btv Btv view
bulk-file Specify the file name of bulk statistics
bulk-stat Set bulk statistics
capture-packet Capture-packet
ccc Circuit cross connection
cfm Connectivity fault management
clear Cancel current configuration
cluster Specify the information for cluster configuration
command-privilege Specify the command level
configuration Configuration interlock
configuration-occupied Configuration exclusive occupied
cp-car Cpu car setting
cpu-defend Configure CPU defend policy
cpu-defend-policy Configure CPU defend policy
cpu-usage Set cpu usage configuration
dhcp Dynamic host configure protocol
dhcp-snooping DHCP snooping
dhcpv6 Dynamic host configure protocol version 6
diffserv Specify diffserv parameters
display Display priority information
dldp Device link detection protocol
dns Specify domain name system
domain Default domain
dot1x 802.1x configuration information
drop Discard attribute
drop-profile Drop profile
dsa Specify DSA module configurations
e-trunk E-Trunk
ecmp ECMP
efm EFM module
erps Ethernet ring protection switching
error-down The interface was shut down because of an error event
event Enter the event view
execute Batch command
fib FIB status and configuration information
file Specify file system configuration information
ftp Set the FTP server attributes
garp Generic Attribute Registration Protocol
gtsm The generalized TTL security mechanism
gvrp Generic VLAN Registration Protocol
header Define the login banner
hwtacacs
hwtacacs-server
icmp Specify ICMP configuration information
icmp-reply Enable ICMP reply fast
igmp Specify IGMP configuration information
igmp-snooping Specify parameters for IGMP-Snooping
info-center Specify message output configuration information
interface Specify the interface configuration view
ip Specify IP configurations for the system
ipv4 Configure ip packet
ipv6 Enable IPv6 functionality
isis Intermediate System to Intermediate System (ISIS)
routes
keychain Keychain authentication
l2-topology Layer 2 topology
l2protocol-tunnel Layer 2 protocol tunnel
lacp Link aggregation control protocol
lldp Link Layer Discovery Protocol
load-balance Specify load balance mode
loopback-detect Loopback detect function
lspv Lsp verification
mac-address Mac address
mac-authen MAC authenticate configure information
mac-forced-forwarding Mac-Forced Forwarding
mac-learning MAC learning
mac-spoofing-defend MAC spoofing defend
matched Is Command can be matched by upper template
mip Configure a rule used to create MIP
mld-snooping Specify parameters for MLD-Snooping
monitor-link Monitor link configuration information
mpls Specify MPLS(Multiprotocol Label Switching)
configuration information
mpls-qos MPLS QoS
msdp Specify MSDP(Multicast Source Discovery Protocol)
configuration information
mtrace Trace route to multicast source
multicast Multicast information
nap NAP protocol
nd Neighbor discovery
ndp Neighbor discovery protocol
nqa Network Quality Analysis(NQA)
nqa-jitter Switch NQA jitter version
nqa-server Specify NQA echo server
ntdp Network topology discovery protocol
ntp-service Specify NTP (Network Time Protocol) configuration
information
oam-mgr Oam-mgr view
observe-port Configure observe port feature
ospf Open Shortest Path First (OSPF)
ospfv3 OSPF version 3 for IPv6
pim Specify PIM(Protocol Independent Multicast)
configuration information
ping Ping function
policy-based-route Specify a policy for policy based routing
port-group Port-group
port-isolate Port isolate
port-mirroring Mirror port
portal Configure Portal local server
portswitch Switch port between router and switch mode
pppoe PPPOE
pw-template Specify PW template configuration
qos QoS configuration
quit Exit from current command view
radius-server Add or delete RADIUS server template
refresh Refresh routes to I/O board
reset Reset operation
return Exit to user view
rip RIP (Routing Information Protocol)
ripng RIPng (Routing information next generation protocol)
rmon Specify RMON configuration
rmon2 Specify RMON2 configuration
route Routing Module
route-policy Route-policy
route-policy-change Specify route policy change parameter
router Configure router information
rrpp Rapid ring protection protocol
rsa Specify RSA module configuration information
scp Set SCP server
screen-width Set screen width
script-string Define a modem script-string
sep Smart ethernet protection
service Toggle service mode. By default it is off
set Set
sftp Set SFTP service attribute
smart-link Smart link configuration information
snmp-agent Specify SNMP (Simple Network Management Protocol)
configuration information
ssh Set the SSH (secure shell) configuration attribute
stack Stack
static-lsp Static LSP configuration
stelnet Set Stelnet service attribute
stp Specify Spanning Tree Protocol (STP) configuration
information
super Modify super password parameters
sysname Specify the host name
tcp Specify TCP(Transmission Control Protocol)
configuration information
telnet Set the status of the Telnet service
temperature Device temperature
test-aaa Accounts test
test-packet Set the test packet
tftp Establish a TFTP connection
tftp-server TFTP server
time-range Specify time-range configuration information
trace Trace route (switch) to host on Data Link Layer
tracert Trace route to host
traffic Specify traffic configuration information
traffic-delete Delete sacl
traffic-filter Filter packets based on acl
traffic-limit Limit the rate of the packets based on acl
traffic-mirror Mirror packets based on acl
traffic-policy Apply specific traffic policy
traffic-redirect Redirect packets based on acl
traffic-remark Remark packets based on acl
traffic-statistic Count packets based on acl
trunk Trunk interface
ttl Time to live
tunnel-selector Tunnel-policy selector
udp-helper UDP Helper
undo Cancel current configuration
unknown-unicast Unknown unicast
upgrade Upgrade software online
user-bind User bind
user-group User group
user-interface Configure the user terminal interface
vlan Virtual LAN
voice-vlan Voice VLAN
vrrp Specify configuration information about VRRP
web-auth-server Portal authentication server
[Huawei]