华为交换机命令(带中文注释)
- 格式:doc
- 大小:55.00 KB
- 文档页数:6
华为交换机配置命令解释<Quidway>用户视图,只能看配置<Quidway>reset save (清除配置文件)<Quidway>reboot (重启华为交换机)<Quidway>system view (进入配置模式)<Quidway>sys (省略式打法)[]配置模式修改交换机:[Quidway]sysname sw1[sw1]配置VLAN:[Quidway]vlan 2[Quidway-vlan2]port ether 0/10 to e 0/12 [Quidway-vlan2]quit等同于[Quidway]int e0/13[Quidway-Ethernet0/13]port access vlan 2 [Quidway-Ethernet0/13]quit配置trunk端口:[Quidway]int e0/1[Quidway-Ethernet0/1]port link-type trunk[Quidway-Ethernet0/1]int e0/2[Quidway-Ethernet0/2]port link-type trunk[Quidway-Ethernet0/2]quit两边的端口都要配trunk,通过trunk 不打标签!默认trunk 只允许vlan 1 通过[Quidway]int e0/1[Quidway-Ethernet0/1]port trunk permit vlan all[Quidway-Ethernet0/1]int e0/2[Quidway-Ethernet0/2]port trunk permit vlan all两边端口都要配置充许trunk 所有VLAN,如果是指定通过vlan号,将vlan all 改成对应的vlan编号即可。
取消任何命令,是在命令前面加一个undo 即可!如何防止交换机环路:华为的交换机生成树功能默认是关掉的交换机形成环路,所联接的端口会不停的闪烁!方法一:启用交换机生成树[Quidway]stp enable(开)[Quidway]stp disable(关)要在两台交换机上配置:方法二:通过链路聚合的方式来解决问题链路聚合可以提高带宽和负载均衡配置链路聚合时,两端的端口模式需要配置成一样(双工,半又工),速率也要指定,不能自己自协商状态![Quidway]link-aggregation e0/1 to e0/2 both如:[Quidway]int e0/1[Quidway-Ethernet0/1]duplex full[Quidway-Ethernet0/1]speed 100[Quidway-Ethernet0/1]int e0/2[Quidway-Ethernet0/2]duplex full[Quidway-Ethernet0/2]speed 100查看交换机日志[Quidway]dis log路由器与路由器之间通信的安全保护配置方法一、保护路由器的物理安全二、保护管理接口的安全1、保护控制台端口的访问权限口令的设置应遵循以下原则:初使安装之后立即配置口令,不使用缺省口令;确保特权级口令与用级口令的不同;口令使用字母数字混合字符以使口令破解难以成功。
华为交换机配置命令大全华为交换机是一种高性能、高可靠的数据通信设备,广泛应用于各种网络环境中。
为了更好地使用华为交换机,我们需要了解一些基本的配置命令。
本文将为大家详细介绍华为交换机的配置命令大全,帮助大家更好地了解和使用华为交换机。
1. 登录华为交换机。
首先,我们需要登录华为交换机进行配置。
一般来说,我们可以通过串口、Telnet或SSH方式登录交换机。
以SSH方式登录为例,我们可以使用以下命令:```shell。
ssh -l username 192.168.1.1。
```。
其中,username为登录用户名,192.168.1.1为交换机的IP地址。
登录成功后,我们需要输入密码进行验证。
2. 查看交换机当前配置。
在登录成功后,我们可以使用以下命令查看交换机的当前配置信息:```shell。
display current-configuration。
```。
这条命令可以显示出交换机当前的全部配置信息,包括接口配置、VLAN配置、路由配置等。
3. 配置交换机接口。
接下来,我们可以对交换机的接口进行配置。
比如,我们可以通过以下命令配置一个VLAN接口:```shell。
interface Vlanif1。
ip address 192.168.1.1 255.255.255.0。
```。
这条命令将为VLAN接口Vlanif1配置IP地址为192.168.1.1,子网掩码为255.255.255.0。
4. 配置交换机VLAN。
除了配置接口,我们还可以对交换机的VLAN进行配置。
比如,我们可以使用以下命令创建一个VLAN:```shell。
vlan 10。
```。
这条命令将创建一个VLAN ID为10的VLAN。
5. 配置交换机路由。
在需要进行路由配置时,我们可以使用以下命令添加静态路由:```shell。
ip route-static 0.0.0.0 0.0.0.0 192.168.1.254。
```。
华为路由器交换机常用命令一、设备管理命令1.登录管理命令- ssh [ip地质] -p [端口号]:通过SSH协议登录设备。
- telnet [ip地质]:通过Telnet协议登录设备。
- logout:退出设备。
2.用户管理命令- display current-configuration:显示当前设备配置信息。
- save:保存当前配置。
- undo save:取消保存的配置。
- super:切换到超级用户模式。
- user-interface console 0:配置控制台终端的参数。
- user-interface vty 0 4:配置远程登录终端的参数。
3.设备操作命令- reboot:重启设备。
- reset saved-configuration:恢复出厂配置。
- display version:显示设备的硬件和软件版本信息。
- display device:显示设备的基本信息。
- display interface[接口名称]:显示指定接口信息。
- display ip routing-table:显示IP路由表信息。
二、网络配置命令1.IP配置命令- interface [接口名称]:进入指定接口。
- ip address [IP地质] [子网掩码]:配置接口IP地质。
- undo ip address:取消接口IP地质配置。
- ip route-static [目标网络] [子网掩码] [下一跳地质]:配置静态路由。
- undo ip route-static [目标网络] [子网掩码] [下一跳地质]:取消静态路由配置。
2.VLAN配置命令- vlan [VLAN ID]:创建指定VLAN。
- quit:退出VLAN配置模式。
- interface vlan [VLAN ID]:进入指定VLAN接口。
- ip address [IP地质] [子网掩码]:为VLAN接口配置IP地质。
H3C交换机配置命令大全1、system-view 进入系统视图模式2、sysname 为设备命名3、display current-configuration 当前配置情况4、 language-mode Chinese|English 中英文切换5、interface Ethernet 1/0/1 进入以太网端口视图6、 port link-type Access|Trunk|Hybrid 设置端口访问模式7、 undo shutdown 打开以太网端口8、 shutdown 关闭以太网端口9、 quit 退出当前视图模式10、 vlan 10 创建VLAN 10并进入VLAN 10的视图模式11、 port access vlan 10 在端口模式下将当前端口加入到vlan 10中12、port E1/0/2 to E1/0/5 在VLAN模式下将指定端口加入到当前vlan中13、port trunk permit vlan all 允许所有的vlan通过H3C路由器1、system-view 进入系统视图模式2、sysname R1 为设备命名为R13、display ip routing-table 显示当前路由表4、 language-mode Chinese|English 中英文切换5、interface Ethernet 0/0 进入以太网端口视图6、配置IP地址和子网掩码7、 undo shutdown 打开以太网端口8、 shutdown 关闭以太网端口9、 quit 退出当前视图模式10、配置静态路由11、配置默认的路由H3C S3100 SwitchH3C S3600 SwitchH3C MSR 20-20 Router1、调整超级终端的显示字号;2、捕获超级终端操作命令行,以备日后查对;3、 language-mode Chinese|English 中英文切换;4、复制命令到超级终端命令行,粘贴到主机;5、交换机清除配置 :reset save ;reboot ;6、路由器、交换机配置时不能掉电,连通测试前一定要检查网络的连通性,不要犯最低级的错误。
华为交换机基本配置命令详解1、配置文件相关命令[Quidway]display current-configuration 显示当前生效的配置[Quidway]display saved-configuration显示flash中配置文件,即下次上电启动时所用的配置文件reset saved-configuration 檫除旧的配置文件reboot 交换机重启display version 显示系统版本信息2、基本配置[Quidway]super password 修改特权用户密码[Quidway]sysname 交换机命名[Quidway]interface ethernet 1/0/1 进入接口视图[Quidway]interface vlan 1进入接口视图[Quidway-Vlan-interfacex]ip address 10.1.1.11 255.255.0.0配置VLAN的IP地址[Quidway]ip route-static 0.0.0.0 0.0.0.0 10.1.1.1静态路由=网关3、telnet配置[Quidway]user-interface vty 0 4 进入虚拟终端[S3026-ui-vty0-4]authentication-mode password 设置口令模式[S3026-ui-vty0-4]set authentication-mode password simple xmws123设置口令[S3026-ui-vty0-4]user privilege level 3 用户级别4、端口配置[Quidway-Ethernet1/0/1]duplex {half|full|auto} 配置端口工作状态[Quidway-Ethernet1/0/1]speed {10|100|auto} 配置端口工作速率[Quidway-Ethernet1/0/1]flow-control 配置端口流控[Quidway-Ethernet1/0/1]mdi {across|auto|normal} 配置端口平接扭接[Quidway-Ethernet1/0/1]port link-type {trunk|access|hybrid} 设置端口工作模式[Quidway-Ethernet1/0/1]undo shutdown 激活端口[Quidway-Ethernet1/0/2]quit 退出系统视图5、链路聚合配置[DeviceA] link-aggregation group 1 mode manual 创建手工聚合组1[Qw_A] interface ethernet 1/0/1 将以太网端口Ethernet1/0/1加入聚合组1 [Qw_A-Ethernet1/0/1] port link-aggregation group 1[Qw_A-Ethernet1/0/1] interface ethernet 1/0/2 将以太网端口Ethernet1/0/1加入聚合组1[Qw_A-Ethernet1/0/2] port link-aggregation group 1[Qw_A] link-aggregation group 1 service-type tunnel # 在手工聚合组的基础上创建t unnel业务环回组。
监控视图命令:<Quidway>backup 读出电子标签cd 改变当前路径check 检查信息clear 清除信息clock 设置系统时钟cluster 执行集群命令cluster-ftp 集群管理模块的FTP 命令cluster-tftp 集群管理模块的TFTP 命令compare 比较功能copy 拷贝文件debugging 打开系统调试开关delete 删除文件dir 列出文件系统中的文件display 显示当前系统信息fixdisk 修复存储设备上丢失的数据块 format 格式化设备free 释放用户接口ftp 建立一个FTP连接language-mode 设置语言环境local-user 本地用户lock 锁住用户终端mkdir 创建新目录more 显示文件的内容move 移动文件ntdp 运行NTDP命令patch 补丁命令组patch-state 补丁状态ping 检查网络连接或主机是否可达 pwd 显示当前的工作路径quit 退出当前的命令视图reboot 系统重启rename 重命名文件或目录reset 清除rmdir 删除已经存在的目录save 保存当前有效配置schedule 设定系统任务send 向其他的用户终端接口传送信息 set 设置系统参数startup 配置系统启动参数super 指定当前用户优先级system-view 进入系统视图telnet 建立一个TELNET连接terminal 设置终端特性tftp 建立一个 TFTP 连接tracert 跟踪到达目的地的路由undelete 恢复删除的文件undo 取消当前设置nqa-server 设置NQA服务器监听服ntdp 网络拓扑收集协议ntp-service 指定NTP(网络时间协observing-port 观察端口ping 检查网络连接或主机port 设置端口port-isolate 端口隔离port-mapping 指定应用协议端口映qos QoS设置quit 退出当前的命令视图radius-server 添加或删除RADIUS服reset 重置return 退到用户视图rip 指定RIP配置信息rmon 配置RMONrouter 配置路由器信息rrpp 快速环网保护协议rsa 指定RSA模块配置信息sftp 设置SFTP服务属性smart-link Smart link配置信息snmp-agent 指定SNMP(Simple Nessh 设置SSH(secure shestelnet 设置STELNET服务属性stp 指定Spanning Treestp-snooping 端口监控TCN报文super 修改超级用户密码参sysname 设置主机名称tcp 指定全局TCP配置信息temperature 设备温度test-packet 配置测试报文tftp-server TFTP服务器time-range 指定时间段配置信息trace Trace route 到主机tracert 跟踪到达目的地的路traffic 指定数据流配置信息undo 取消当前设置upgrade 在线升级软件user-interface 配置用户终端接口vlan 虚拟局域网voice-vlan 语音VLAN系统视图命令:[Quidway]aaa AAA(认证、授权、计费) 视图acl 指定ACL配置信息arp ARP配置命令arp-suppress 指定ARP抑制功能配置,缺省值是非使能autoconfig AutoConfig配置信息bpdu bpdu packet settingsbpdu-tunnel 隧道btv BTV视图cfm 连通性故障管理cluster 指定集群配置信息command-privilege 设置命令权限cp-car Cpu限速设置cpu 缓存CPU 报文功能cpu-usage 设置CPU占用率配置信息dhcp DHCP命令display 显示当前系统信息dns 域名解析系统配置命令dot1x 802.1x配置信息efm EFM设置execute 批处理命令file 设置文件系统参数firewall 防火墙ftp 设置FTP服务器参数header 定义登录标题hwtacacs-server 设置HWTACACS服务器icmp 指定ICMP配置信息icmp-reply 打开ICMP快速应答igmp-proxy 设置IGMP-Proxy参数igmp-snooping 设置IGMP-Snooping参数info-center 指定信息中心配置信息interface 指定接口配置视图ip IP 信息ipv4 IPV4lacp 链路聚合控制协议lldp 链路层发现协议loopback-detect 环路检测mac-address MAC地址mac-authen 指定MAC认证配置信息mac-forced-forwarding Mac-Forced Forwardingmac-table 软件学习得到的mac地址表mip 配置MIP节点的创建规则。
华为交换机基本配置命令华为交换机基本配置命令一、单交换机VLAN划分以下是单交换机VLAN划分的基本命令:system:进入系统视图。
system-view:进入系统视图。
quit:退出系统视图。
undovlan20:删除vlan20.XXX:交换机命名。
dispvlan:显示vlan。
vlan20:创建vlan(也可进入vlan20)。
porte1/0/1toe1/0/5:把端口1-5放入VLAN20中。
对于5700系列交换机,单个端口放入VLAN的命令如下:XXX]intg0/0/1XXX]portlink-type access(注:接口类型access,hybrid、trunk)XXX]portdefaultvlan10而批量端口放入VLAN的命令如下:XXX]port-group1XXX-port-group-1]group-XXXXXX-port-group-1]porthybriduntaggedvlan3如果需要删除group(组)vlan200内的15端口,可以使用以下命令:XXX]intg0/0/15XXX-XXX]XXX通过group端口限速设置的命令如下:XXX]Port-group2XXX]group-memberg0/0/2tog0/0/23XXX]qoslroutboundcir2000cbs要显示vlan里的端口20,可以使用以下命令:dispvlan20如果需要进入端口24,可以使用以下命令:inte1/0/24要删除当前VLAN端口10,可以使用以下命令:XXX如果需要显示当前配置,可以使用以下命令:dispcurr如果需要保存配置,可以使用以下命令:save如果需要通过关闭日志信息命令改变DS模块来实现关闭配置后的确认信息显示,可以使用以下命令:info-XXXoff如果需要通过打开日志信息命令改变DS模块来实现打开配置后的确认信息显示,可以使用以下命令:info-XXX二、配置交换机支持XXX以下是配置交换机支持XXX的基本命令:system:进入系统视图。
华为交换机基本配置命令详解1、配置文件相关命令[Quidway]display current-configuration 显示当前生效的配置[Quidway]display saved-configuration显示flash中配置文件,即下次上电启动时所用的配置文件reset saved-configuration 檫除旧的配置文件reboot 交换机重启display version 显示系统版本信息2、基本配置[Quidway]super password 修改特权用户密码[Quidway]sysname 交换机命名[Quidway]interface ethernet 1/0/1 进入接口视图[Quidway]interface vlan 1进入接口视图[Quidway-Vlan-interfacex]ip address 10.1.1.11 255.255.0.0配置VLAN的IP地址[Quidway]ip route-static 0.0.0.0 0.0.0.0 10.1.1.1静态路由=网关3、telnet配置[Quidway]user-interface vty 0 4 进入虚拟终端[S3026-ui-vty0-4]authentication-mode password 设置口令模式[S3026-ui-vty0-4]set authentication-mode password simple xmws123设置口令[S3026-ui-vty0-4]user privilege level 3 用户级别4、端口配置[Quidway-Ethernet1/0/1]duplex {half|full|auto} 配置端口工作状态[Quidway-Ethernet1/0/1]speed {10|100|auto} 配置端口工作速率[Quidway-Ethernet1/0/1]flow-control 配置端口流控[Quidway-Ethernet1/0/1]mdi {across|auto|normal} 配置端口平接扭接[Quidway-Ethernet1/0/1]port link-type {trunk|access|hybrid} 设置端口工作模式[Quidway-Ethernet1/0/1]undo shutdown 激活端口[Quidway-Ethernet1/0/2]quit 退出系统视图5、链路聚合配置[DeviceA] link-aggregation group 1 mode manual 创建手工聚合组1[Qw_A] interface ethernet 1/0/1 将以太网端口Ethernet1/0/1加入聚合组1 [Qw_A-Ethernet1/0/1] port link-aggregation group 1[Qw_A-Ethernet1/0/1] interface ethernet 1/0/2 将以太网端口Ethernet1/0/1加入聚合组1[Qw_A-Ethernet1/0/2] port link-aggregation group 1[Qw_A] link-aggregation group 1 service-type tunnel # 在手工聚合组的基础上创建t unnel业务环回组。
华为交换机常用命令及解释一、基本配置1、视图system-view //用户视图[quidway]interface ethernet 0/1 //系统视图[quidway-ethernet0/1]//接口视图2、密码及基本参数配置(1) console口登录配置system-view[quidway]user-interface aux 0[quidway-aux0]authentication-mode{none|password|scheme} //设置登录的验证方法。
none是不要验证,password是密码验证,scheme是服务器验证。
[quidway-aux0]set authentication password {cipher|simple} 123456 //当上面的模式为paaword时,设置验证的密码。
simple是明文密码。
[quidway-aux0]user privilege level 2 //设置从AUX登录后可以访问的命令级别为2级,默认是1级。
[quidway-aux0]speed 19200 //设置console口使用的传输速率[quidway-aux0]screen-length 30 //设置一屏显示30行命令[quidway-aux0]history-command max-size 20 //设置历史命令缓冲区最多存放20条命令[quidway-aux0]idle-timeout 6 //设置超时时间为6分钟(2)telnet 登录system-view[quidway]user-interface vty 0 4[quidway-aux0]authentication-mode{none|password|scheme} //设置登录的验证方法。
none是不要验证,password是密码验证,scheme是服务器验证。
[quidway-aux0]set authentication password {cipher|simple} 123456 //当上面的模式为paaword时,设置验证的密码。
华为路由器交换机常用命令华为路由器交换机常用命令文档1、连接路由器交换机1.1 使用Console端口连接1.2 使用Telnet远程连接1.3 使用SSH远程连接2、系统管理2.1 修改设备名称2.2 设备备份与恢复2.3 设备升级与软件安装2.4 日志管理2.5 用户管理2.6 系统时间配置3、接口配置3.1 查看接口状态3.2 配置接口IP地质3.3 配置接口描述3.4 配置接口MTU3.5 配置接口速率与双工模式3.6 配置接口ACL3.7 配置接口链路聚合(LAG)4、VLAN 配置4.1 创建VLAN4.2 配置接口VLAN成员关系4.3 配置接口访问VLAN4.4 配置接口Trunk模式4.5 配置VLAN间路由4.6 配置VLAN间ACL控制5、路由配置5.1 配置静态路由5.2 配置动态路由(OSPF,BGP,RIP) 5.3 配置路由跟踪5.4 配置路由重分发5.5 配置路由策略5.6 配置路由保护6、安全配置6.1 配置访问控制列表(ACL) 6.2 配置端口安全6.3 配置802.1X认证6.4 配置密钥链(Key Chn)6.5 配置IPsec VPN7、QoS 配置7.1 配置流量分类7.2 配置流量策略7.3 配置队列调度7.4 配置流量控制附件:1、常用命令示例2、路由器交换机配置示例法律名词及注释:1、ACL(访问控制列表)- 一种用于控制网络流量的策略,可以基于源IP地质、目标IP地质、传输层协议和端口号等信息进行匹配。
2、VLAN(虚拟局域网)- 基于交换机端口的逻辑划分,将不同的端口划分到不同的虚拟局域网中,实现隔离和安全性。
3、LAG(链路聚合)- 将多个物理链路合并为一个逻辑链路,提高链路带宽和冗余能力。
4、OSPF(开放最短路径优先)- 一种用于动态路由选择的协议,根据链路状态信息计算最短路径。
5、BGP(边界网关协议)- 一种用于互联网自治系统间的路由选择的协议。
华为交换机配置命令详解duplex{full|half} //设置双工模式undo duplex //恢复双工模式为缺省值negotiation auto //开启接口自动协商功能(默认开启)speed //修改接口速率undo speed //恢复默认接口改为全双工[Huawei-GigabitEthernet0/0/1]undo negotiation auto[Huawei-GigabitEthernet0/0/1]duplex fulldis vlan 查看vlan划分VLAN:[Huawei-GigabitEthernet0/0/1]port link-type access //接口模式设置成access//可写成p l a[Huawei-GigabitEthernet0/0/1]port default vlan 10 //加入vlan10//可写成 p d v 10接口模式:默认hybird access trunk(802.1q)[sw1-GigabitEthernet0/0/3]port trunk allow-pass vlan all //允许所有vlan通过//可写成p t a v a设置虚拟路由:接口模式下思科私有HSRP GLBPvrrp vrid 1 virtual-ip+虚拟ip 走master 备份backup 优选ip地址大的为mastervrrp vrid 1 priority 105 //调整优先级为105vrrp vrid 1 track int 接口//上行链路跟踪(如果不配,上行不通master会传给备份)//接口断开会把优先级-10创建两个vrid 互为备份STP:BPDU桥接数据单元交换机之间发送 RP根端口 DP指定端口BID:优先级(32768)+扩展ID+MAC地址优先级修改必须为4096的倍数1.非根交换机只有一个根端口2.到根交换机花费最小的口是根端口3.花费相同,发送者的BID小的是根端口4.比较发送者的PID(端口优先级默认128+端口号)5.比较接收者的PID同一条链路只有一个DP 1.RP对端的是DP 2.无RP链路比到根的花费小的不是RP也不是DP将被阻塞 AP端口状态:Down-blocking(AP只能接收BPDU)20s-listening(接收和发送BPDU)15s-learning(学习MAC)15s-forwarding(正常)从连接到传输经过30-50sdis stp查看STP生成树stp mode修改生成树算法stp priority 4096的倍数设置优先级生成树算法:802.1D-STP(慢,有三种端口角色30-50s),802.1W-RSTP(快,有四种端口角色毫秒)生成树模式:PVST+(思科私有),CST-单生成树-所以vlan一棵树,MSTP(802.1S)多生成树华为:RSTP,MSTP当网络发生变化时,向上游发送TCNTCN:4字节TCA:回复TCNTC:TCA的确认端口聚合两个模式:1.手动模式:方法1interface Eth-Trunk 1 //进入聚合端口trunkport g0/0/1 //添加端口dis current-configuration方法2interface Eth-Trunk 1qint g0/0/1eth-trunk 1disp eth-trunk 1CP(链路聚合控制协议)模式interface Eth-Trunk 1mode lacp 更改模式trunkport g0/0/1max active-linknumber 2 设置最大连接端口数lacp preempt enable 开启抢占机制优先级低是主设备延时30s lacp priority 设置设备/接口优先级lacp preempt delay 10 设置抢占延时。
华为交换机配置步骤与命令注释1.sys 进入配置模式2.sysname NAME 为交换机配置一个物理场所名字3.Vlan ID 配置一个Vlan4.q 退出当前配置5.【NAME】Interface Ethernet 0/0/1 进入需要配置端口(这条语句是用来为某一个端口绑定ip用的 user-bind static ip-address 10.10.31.1 interface Ethernet0/0/1 )6.【NAME-Ethernet 0/0/1】Port link-type access 设置端口链接类型为access型(还有trunk型)7.【NAME-Ethernet 0/0/1】port default vlan ID 将端口放入所增加的Vlan8.【NAME-Ethernet 0/0/1】q 退出当前配置界面返回前一层9.【NAME】interface vlanif 1 将所配置交换机放入vlanif1 这个是用来进行远程控制的,vlanif1是在核心配置的10.【NAME-vlanif】IP address 10.10.1.34 255.255.255.0 设置一个可以远程登录的IP地址11.【NAME-vlanif】q 退出当前配置界面12.【NAME】IP route-static 0.0.0.0.0.0.0.0 10.10.1.25413.【NAME】aaa14.【NAME】local-user admin service-typ telnet 本地拨号方式15.【NAME-aaa】local-user admin privilege level 15 本地用户分配级别16.【NAME-aaa】q 退出当前状态17.【NAME】user-interface vty 0 418.【NAME-ui-vty0-4】authentication-mode aaa19.【NAME-ui-vty0-4】q 退出当前模式20.【NAME】interface GigabitEthenet 0/0/1 进入G比特网络端口21.【NAME-GigabitEthenet 0/0/1】port link-type trunk22.【NAME-GigabitEthenet 0/0/1】port trunk allow-pass vlan all (或者2to4999)让你想让通过的vlan通过23.<NAME>save 保存所做的设置24.<NAME> q 退出界面欢迎您的下载,资料仅供参考!致力为企业和个人提供合同协议,策划案计划书,学习资料等等打造全网一站式需求。
1、system-view 进入系统视图模式2、sysname 为设备命名3、display current-configuration 当前配置情况4、language-mode Chinese|English 中英文切换5、interface Ethernet 1/0/1 进入以太网端口视图6、port link-type Access|Trunk|Hybrid 设置端口访问模式7、undo shutdown 打开以太网端口8、shutdown 关闭以太网端口9、quit 退出当前视图模式10、vlan 10 创建VLAN 10并进入VLAN 10的视图模式11、port access vlan 10 在端口模式下将当前端口加入到vlan 10 中12、p ort E1/0/2 to E1/0/5在VLAN模式下将指定端口加入到当前vlan中13、port trunk permit vlan all 允许所有的vlan 通过一、单交换机VLAN划分命令命令解释system 进入系统视图system-view 进入系统视图quit 退到系统视图undo vlan 20 删除vlan 20sysname 交换机命名进入端口 24user-int vty 04 进入虚拟终端authentication-mode password (aut password)令模式 set authentication password simple 222 (set aut pass sim 222)设置口令user privilege level 3(use priv lev 3)删除配置必须退到用户模式vlan 20 创建 vlan ( 也可进入 vlan 20) port e1/0/1 to e1/0/5 把端口 1-5 放入 VLAN 20 中 disp vlan 20 显示 vlan 里的端口 20port access vlan 20 把当前端口放入 vlan 20undo port e1/0/10 表示删除当前VLAN 端口 10 disp curr 显示当前配置 二、配置交换机支持 TELNET system 进入系统视图 sysname 交换机命名 int vlan 1 进入 VLAN 1 ip address 192.168.3.100 255.255.255.0 配置 IP 地址int e1/0/24 设置口配置用户级别disp current-configuration disp cur) 查看当前配置disp ip int查看交换机 VLAN IP 配置reset saved-configuration(reset saved) reboot 重启交换机三、跨交换机VLAN 的通讯建立 VLAN 10进入端口 5把端口 5 加入 vlan 10建立 VLAN 20进入端口 15把端口 15加入 VLAN 20进入端口 24把24端口设为TRUN 端口 同上建立 VLAN 10进入端口 20把端口 20放入 VLAN 10进入端口 24把24端口设为TRUN 端口port trunk permit vlan all (port trunkpermit vlan 10只能为vlan 10使用)24端口为所有VLAN 使用在 sw1 上:vlan 10 int e1/0/5 port access vlan 10 vlan 20 int e1/0/15 port access vlan 20 int e1/0/24 port link-type trunk port trunk permit vlan all 在 SW2上:vlan 10 int e1/0/20 port access vlan 10int e1/0/24port link-type trunk 删除配置disp int e1/0/24查看端口24 是否为TRUNK[S3026]ip route-static 0.0.0.0 0.0.0.0 10.65.1.2[S3026]ip default-gateway 10.65.1.2 清除端口错误命令在>模式下,输入reset counters interface 口号欢迎您的下载,资料仅供参考!致力为企业和个人提供合同协议,策划案计划书,学习资料等等打造全网一站式需求。
华为路由交换机命令大全华为路由交换命令大全华为一般模式(用户户级)命令:(每条命令都可以+?查看其配置参数)>?enable Turn on privileged commands 转入特权用户模式exit Exit from EXEC 退出配置help Description of the interactive help system 系统帮助简述language Switch language mode (English, Chinese) 语言模式切换ping Send echo messages 检查网络主机连接及主机是否可达show Show running system information 显示系统运行信息telnet Open a telnet connection 远程登录功能tracert Trace route to destination 跟踪到目的地经过了哪些路由器华为特权模式命令:#?clear Reset functions 清除各项统计信息clock Manage the system clock 管理系统时钟configure Enter configuration mode 进入全局配置模式copy Upload config file to tftp server 上载配置文件到TFTP服务器debug Debugging functions 开启调试开关disable Turn off privileged commands 返回普通用户模式download Download the new version config 下载新版本配置文件erase Erase the configuration file in flash or nvram 擦除FLASH或NVRAM中的配置文件exec-timeout Enable EXEC time out 打开EXEC超时退出开关exit Exit from EXEC 退出配置first-config Set or clear the first config flag 设置或清除初次配置标志get Download config file from tftp server 从TFTP服务器下载配置文件help Description of the interactive help system 系统帮助简述language Switch language mode (English, Chinese) 语言模式切换no Disable some parameter switchs 关闭某些参数开关ping Send echo messages 检查网络主机连接及主机是否可达reboot Reboot the router 路由器重启setup Run the SETUP command facility 配置路由器参数show Show running system information 显示系统运行信息telnet Open a telnet connection 远程登录功能tracert Trace route to destination 跟踪到目的地经过了哪些路由器write Write running configuration to flash or nvram 将当前配置参数保存至FLASH或NVRAM中华为全局配置模式命令:(config)#?aaa-enable Enable AAA(Authentication, Authorization and 使能配置AAA(认证,授权和计费)Accounting)access-list Configure structure of access-list 配置标准访问表arp Set a static ARP entry 设置静态ARP入口chat-script Define a modem chat script 生成一个用在modem 上的执行脚本crypto Config IPSec or crypto map 设置IPSec相关参数custom-list Build the custom queue list 创建定制队列列表dialer-list Create a dialer-list 创建dialer-listdlsw Configure dlsw 配置DLSwdram-wait Insert dram wait state 设置DRAM等待状态enable Modify enable password parameters 修改ENABLE口令exit Exit from configure mode 退出全局配置模式firewall Configure firewall status 配置防火墙状态flow-interval set time of flow control 设置流量控制时间间隔frame-relay global frame relay configuration commands 帧中继全局配置命令集ftp-server File transfer Protocol FTP 服务器help Description of the interactive help system 系统帮助命令简述host Add host's name and IP address 添加主机名称和其IP地址hostname Modify hostnamec 修改主机名ifquelen Change interface queue length 更改接口队列长度interface Select an interface to configure 选择配置接口ip Global ip configuration subcommands 全局IP配置命令子集ipx Novell IPX global configuration commands 全局IPX配置命令子集logging Logging configuration commands 全局Logging 配置命令logic-channel Select a logic-channel to configure 配置逻辑通道login Enable EXEC Authenticaion 启动EXEC登录验证multilink Set multi-link parameters 配置multilink 参数multilink-user Set multi-link bind interface by username 配置multilink 用户使用的接口nat config net address translation 配置地址转换no Disable some parameter switchs 关闭某些参数开关priority-list Build the priority queue list 创建优先级队列列表route-map Configure route-map 配置路由映射router Enable a routing process 启动路由处理settr Set time ranges 设置时间范围snmp-server Modify SNMP parameters 修改SNMP参数tcp Global TCP parameters 配置全局TCP参数terminal Set terminal line parameters 设置终端参数timerange Enable or disable time range 启动或关闭时间区域tty-server Huawei tty server 华为终端服务器user Add a user into system for ppp authentication use. 为PPP验证向系统中加入用户version Confirm current VRP version 确认配置VRP版本号和将当前VRP的版本是否相同vpdn Configure VPDN 设置VPDNvpdn-group Configure VPDN Group 设置VPDN组x25 X25 level 3 X.25协议分组层华为接口模式配置命令:(1)(config-if-Ethernet0)#?backup Modify dial-backup parameters 修改拨号备份参数bridge-group Join into DLSw Bridge-group 将以太网端口加入DLSw桥组crypto Apply crypto map to interface 在接口上应用crypto mapcustom-group Assign a custom queue list to an interface 将CQL应用到接口上description Ethernet interface specific description 设置以太网端口描述字串duplex Configure duplex operation mode 设置双向操作模式exit Exit from config interface mode 退出端口配置模式help Description of the interactive help system 随机帮助系统简述ip Interface Internet Protocol configure command IP协议配置命令集ipx Novell IPX interface subcommands IPX协议命令子集llc2 Modify LLC2 parameters 设置以太网端口的LLC2参数loopback Configure internal loopback on an interface 配置端口自环方式mtu Set ethernet interface Maximum Transmission Unit(MTU) 设置以太网MTUnat Network Address Translator 网络地址转换no Negate a command or set its defaults 取消命令或设置缺省值priority-group Assign a priority queue list to an interface 将PQL应用到接口上send-frame-type Set the format of the sending frames 设置传送帧格式shutdown Shutdown the selected interface 关闭所选端口standby Hot standby router config HSRP 热备份路由配置(2)(config-if-Serial0)#?backup Modify dial-backup parameters 修改备份口参数baudrate Set transmite and receive baudrate 配置发送、接收波特率bridge-group Join into DLSw Bridge-group 将本串口加入DLSw桥组clock-select Select transmit and receive clock comes from 选择发送、接收时钟来自本地远程local or remotecrypto Apply crypto map to interface 在接口上应用crypto mapcustom-group Assign a custom queue list to an interface 将CQL应用到接口上description interface specific description 设置端口描述字串detect Detect DSR or DTR signal on serial interface 在串口上监测DSR DTR 信号dialer Dial-On-Demand routing (DDR) command 拨号配置命令dialer-group Assign the interface to dialer-list 配置接口的dialer-list encapsulation Set encapsulation type for an interface 设置端口协议封装类型exit Exit from config interface mode 退出端口配置模式flowcontrol Auto flowcontrol or normal flowcontrol 设置流控制方式help Description of the interactive help system 随机帮助系统简述idle-mark Idle in mark mode 空闲为mark状态invert Invert Transmit clock 反转接收时钟ip Interface Internet Protocol configure command IP协议配置命令集ipx Novell IPX interface subcommands IPX协议命令子集keepalive Enable keepalive 使keepalive有效loopback Configure internal loopback on an interface 设置接口内部自环方式mtu Maximum transmission unit 最大传送单位nat Network Address Translator 网络地址转换no Negate a Command or Set its default 取消某命令或配置路由器缺省值nrzi-encoding Set line code to nrzi encoding mode 设置编码方式为NRZI模式peer Peer parameters for point-to-point interface PPP接口的端参数physical-layer Configure sync or async physical layer on serial 设置串口传输方式为同步异步interfaceppp Point-to-Point Protocol PPP协议priority-group Assign a priority queue list to an interface 将PQL应用到接口上-sdlc This command can be used when encapsulate SDLC 只有在封装了SDLC协议才可以使用此命令shutdown Shutdown the selected interface 关闭所选端口terminal Terminal source ip address bind. 终端源地址绑定tty Configure terminal server parameter 配置终端服务器参数配置路由器:(以下命令可减写)路由器基本操作:重启路由器特权模式:reboot 在特权模式下擦除配置信息:#erase 写入配置信息:write 查看命令:#show 重起端口:在端口模式关闭#shut 打开#no+shut (有些命令须重启才可生效)关闭超时退出功能:#no exec 设定主机名:(config)#hostnameDCE方应配置速率:在s0端口配置(config-if-Serial0)#baud 2048000 (注意: 在使用V.24电缆时波特率必须设置成不高于64Kbps!) 填加IP地址:在接口模式下#ip add+IP地址+掩码静态路由:在全局配置模式ip router+目的IP地址+掩码+网关(相邻机器IP地址)查看路由表:sh+ip+route封装协议:(电信DCE设备为发送方、本地DTE设备为接收方)在s0端口配置:(config-if-Serial0)#encap+ppp(任意协议)*ppp协议不适合恶劣介质*链路层PPP点到点协议有两种验证方式:PAP口令验证和CHAP 挑战口令验证(1)PAP验证方式配置:在DCE验证方:(config-if-Serial0)#ppp+auth验证方式+pap 验证方式建立用户:(config)#user+名字+pass+密码是否隐藏(7是/0否)+密码DTE被验证方:(config-if-Serial0)#ppp+pap+sent+名字+pass+密码是否隐藏(7是|0否)+密码*(用户名和密码DCE与DTE同相)*重起端口:在端口模式关闭#shut 再打开#no+shut (有些程序须重启才可生效)建立路由完成验证(2)先删除原来验证方式再配置CHAP验证方式:(可靠方式)在DCE验证方s0端口填加验证方式:(config-if-Serial0)#ppp+auth+chap在DCE验证方s0端口填加chap主机名:(config-if-Serial0)#ppp+chap+host+名字(任意)在DCE验证方填加验证方式:(config)#user+对方主机名字+pass+密码是否隐藏(7是/0否)+密码建立路由完成验证*(DCE与DTE相同)*重起端口:在端口模式关闭#shut 再打开#no+shutppp协议协商(自动协商)只有PPP协议可以自动生成路由项DTE:s0封装DCE:分配方 DTE被分配方配置方法:DCE:(config-if-Serial0)#ip add 50.50.50.1 255.0.0.0(config)#ip local pool 1 50.50.50.50(最低) 50.50.50.60(最高) 配置地址池(config-if-Serial0)#peer default ip add pool 1 分配对方IP地址DTE:(config-if-Serial0)#ip add nego自动获取地址特点:所获得地址没有子网路由x.25协议配置方法:DCE方:(config-if-Serial0)#encap x25 dce(config-if-Serial0)#x25 ltc 16 设置最小双向信道(config-if-Serial0)#x25 htc 16 设置最大双向信道(config-if-Serial0)#x25 nvc 4 设置链接信道条数(config-if-Serial0)#x25 mod 128设置窗口尺寸(config-if-Serial0)#x25 wout 8设置缺省发送窗口大小(config-if-Serial0)#x25 win 8 设置缺省接收窗口大小(config-if-Serial0)#x25 ips 1024 设置输入包长度(config-if-Serial0)#x25 ops 1024 设置输出包长度(config-if-Serial0)#x25 add (88888888) 任意x.25链路层地址(config-if-Serial0)#ip add (IP地址)给双方填加IP地址(config-if-Serial0)#x25 map ip (目标IP地址)(99999999 对端x.25链路层地址)+broadcast(支持广播)DTE方:同上 (DCE和DTE映射时必须指对方端地址)x.25具有寻址功能和纠错功能,它包括物理层、链路层、和网路层,它是一个协议集,支持流控帧中继协议(Frame-relay)配置方法:DCE方:先配置IP地址再打开帧中继交换(config)#frame switch(config-if-Serial0)#encap int dce 设置封装模式(config-if-Serial0)#frame local 18 定义虚电路号*DTE方:同上 (虚电路号发必须相同)当不允许逆向地址解析时,必须手动填加地址和虚电路对应*借用IP地址:DCE方:先设定e0IP地址(config-if-Serial0)#int s 0.1 point 设置子接口为点到点(config-if-Serial0)#frame inter 50 设置虚电路号(config-if-Serial0)#ip unnum eth0 指定IP借用(config)#ip route (下一跳网络号) (掩码)255.255.255.252 s 0.1 DTE方:同上设e0 IP地址(config)#ip route (下一跳地址) (掩码)255.255.255.255 s 0.1(config)#ip route 0.0.0.0 0.0.0.0 (下一跳地址)rip协议配置方法:(DCE和DTE相同)(config)#router rip 设置rip协议启动(config)#network all 把本机所有网段都参于路由交换(广播)(config)#no network (IP网段)单独取消某网段(config)#no network all 所有网段都关闭(config)#sh ip rip 查看路由信息如果想要静态路由也通过rip广播出去须借用路由:(config-router-rip)#redis static(引用路由) metric(静态路由度量值) 1(config-router-rip)#neighbor 对端IP地址OSPF协议配置方法:OSPF不能在x.25和frame frelay协议上进行广播DCE和DTE都封装(任意协议,例:x.25)(config)#router ospf enable 设置OSPF协议启动再进入单独端口启动OSPF:(config-if-Serial0)#ip ospf enable area 1或0(为骨干)(config-if-Ethernet0)#ip ospf enable area 1(config-if-Serial0)#ip ospf neighbor 对端IP地址(config)#ip route 目标网络号掩码下一跳IP 间接路由(config-router-ospf)#redis ospfase static metric 1(度量值默认为1)网络安全:用路由器做firewall(防火墙):(config)#firewall enable 打开防墙设置(config)#firewall default 设置默认规则(config)#access 101(任意号) sirt(指定自链顺序) auto(精度优先) 地址过滤:(config)#access 101 deny ip 70.70.70.2(源地址IP) 0.0.0.0(掩码255.255.255.255反码) 70.70.70.1(目的IP) 0.0.0.0(掩码255.255.255.255反码)定义一条规责不让70.70.70.1访问70.70.70.2(config-if-Ethernet0)#ip access 101 in (把101规责定义在e0口的输入方)(config)#no access 101(规则号) 删除一条链101(config)#sh access 101(规则号) 查看一条链101(config)#access 101 deny ip 70.70.70.0(源地址IP) 0.0.0.127(掩码255.255.255.128反码) 50.50.50.2 (目的IP)0.0.0.0(掩码255.255.255.255反码) 拒绝70.70.70.1-127网段访问允许某个地址访问:(config)#access 101 deny ip any 70.70.70.2(源地址IP) 0.0.0.0(掩码255.255.255.128反码) (config)#aceess 101 permit ip 70.70.70.64(源地址IP) 0.0.0.3(掩码255.255.255.252反码) any只允许70.70.70.64 - 67访问(config-if-Serial0)#ip access 101 in 在s0口加入101链端口过滤:(config)#access 101 deny ip tcp any(任何目标地址) 70.70.70.1(源地址IP) 0.0.0.0(掩码255.255.255.255反码) eq (23端口)或telnet 类型过滤别人ping不通你,你可ping通别人(config)#access special 101 deny ip tcp any(源任何地址) 70.70.70.1(目标IP地址)0.0.0.0(掩码255.255.255.255反码) eq telnet 对本机特定时间段拒绝telnet(config)#rimerange eable 开启时间段(config)#settr(范围)18:23(开始) - 18:25(结束) 时间段内生效链路集合:DCE:(config-if-Serial0)#peer default ip add 50.50.50.2 不定义地址池只有一端与其相连DTE:(config)#sh ip route 查看路由(config)#ip add nego 自动获取地址VPN(虚拟专用网):利用协议做一条专线让两个局域网通过互连网相连。
华为交换机配置步骤与命令注释华为交换机配置步骤与命令注释1.sys 进入配置模式2.sysname NAME 为交换机配置一个物理场所名字3.Vlan ID 配置一个Vlan4.q 退出当前配置5.【NAME】Interface Ethernet 0/0/1 进入需要配置端口(这条语句是用来为某一个端口绑定ip用的user-bind static ip-address 10.10.31.1 interface Ethernet0/0/1 )6.【NAME-Ethernet 0/0/1】Port link-type access 设置端口链接类型为access型(还有trunk 型)7.【NAME-Ethernet 0/0/1】port default vlan ID 将端口放入所增加的Vlan8.【NAME-Ethernet 0/0/1】q 退出当前配置界面返回前一层9.【NAME】interface vlanif 1 将所配置交换机放入vlanif1 这个是用来进行远程控制的,vlanif1是在核心配置的10.【NAME-vlanif】IP address 10.10.1.34 255.255.255.0 设置一个可以远程登录的IP地址11.【NAME-vlanif】q 退出当前配置界面12.【NAME】IP route-static 0.0.0.0.0.0.0.0 10.10.1.25413.【NAME】aaa14.【NAME】local-user admin service-typ telnet 本地拨号方式15.【NAME-aaa】local-user admin privilege level 15 本地用户分配级别16.【NAME-aaa】q 退出当前状态17.【NAME】user-interface vty 0 418.【NAME-ui-vty0-4】authentication-mode aaa19.【NAME-ui-vty0-4】q 退出当前模式20.【NAME】interface GigabitEthenet 0/0/1 进入G比特网络端口21.【NAME-GigabitEthenet 0/0/1】port link-type trunk22.【NAME-GigabitEthenet 0/0/1】port trunk allow-pass vlan all (或者2to4999)让你想让通过的vlan通过23.save 保存所做的设置24. q 退出界面。
华为交换机常用命令配置介绍华为交换机是一种常见的网络设备,用于构建大型网络。
配置华为交换机需要使用一些常用的命令,通过这些命令可以设置交换机的各种功能和参数。
本文将介绍一些常用的华为交换机配置命令,包括基本配置、端口配置和VLAN配置等。
一、基本配置命令:1.设置设备主机名:[HUAWEI] sysname Switch //将设备主机名设置为Switch2.配置管理口:[Switch] interface gigabitethernet 0/0/1 //进入GigabitEthernet 0/0/1接口[Switch-GigabitEthernet0/0/1] port link-type access //设置接口类型为access[Switch-GigabitEthernet0/0/1] port default vlan 10 //设置默认VLAN为103.配置IP地址:[Switch-GigabitEthernet0/0/1] ip address 192.168.1.1255.255.255.0 //配置接口IP地址为192.168.1.1,子网掩码为255.255.255.04.设置设备登录认证:[Switch] aaa //进入AAA视图[Switch-aaa] local-user admin //创建本地用户admin[Switch-aaa] password simple admin123 //设置密码为admin1235.开启SSH远程登录:[Switch] ssh server enable //开启SSH服务[Switch] ssh user admin //创建SSH用户admin[Switch-ssh-user-admin] authentication-type password //设置认证方式为密码[Switch-ssh-user-admin] service-type stelnet //设置服务类型为SSH二、端口配置命令:1.查看端口状态:[Switch] display interface gigabitethernet 0/0/1 //查看GigabitEthernet 0/0/1接口的状态信息2.端口速率设置:[Switch] interface gigabitethernet 0/0/1 //进入GigabitEthernet 0/0/1接口[Switch-GigabitEthernet0/0/1] speed 100 //设置速率为100Mbps 3.端口流量控制:[Switch] interface gigabitethernet 0/0/1 //进入GigabitEthernet 0/0/1接口[Switch-GigabitEthernet0/0/1] flow-control //开启流量控制4.端口VLAN成员关系设置:[Switch] interface gigabitethernet 0/0/1 //进入GigabitEthernet 0/0/1接口[Switch-GigabitEthernet0/0/1] port link-type trunk //设置接口类型为trunk[Switch-GigabitEthernet0/0/1] port trunk allow-pass vlan 1020 //设置允许通过的VLAN为10和20三、VLAN配置命令:1.创建VLAN:[Switch] vlan 10 //创建VLAN 10[Switch-vlan10] quit //退出VLAN 10视图2.VLAN接口配置:[Switch] interface vlanif 10 //进入VLAN 10接口[Switch-Vlan-interface10] ip address 192.168.10.1255.255.255.0 //配置接口IP地址为192.168.10.1,子网掩码为255.255.255.03.VLAN端口关联:[Switch] interface gigabitethernet 0/0/1 //进入GigabitEthernet 0/0/1接口[Switch-GigabitEthernet0/0/1] port link-type hybrid //设置接口类型为hybrid(混合)[Switch-GigabitEthernet0/0/1] port hybrid vlan 10 untagged //设置接口为VLAN 10的未标记端口四、其他常用命令:1.查看设备信息:[Switch] display version //查看设备版本信息[Switch] display interface brief //查看所有接口的基本信息2.保存配置:[Switch] save //保存当前配置3.重启设备:[Switch] reboot //重启设备以上是一些常用的华为交换机配置命令。
华为交换机命令返回上一级命令:quit配置保存命令:save华为交换机命令<>sys进入配置模式[Quidway]dis cur ;显示当前配置[Quidway]display current-configuration ;显示当前配置[Quidway]display interfaces ;显示接口信息[Quidway]display vlan all ;显示路由信息[Quidway]display version ;显示版本信息[Quidway]super password ;修改特权用户密码[Quidway]sysname ;交换机命名[Quidway]interface ethernet 0/1 ;进入接口视图[Quidway]interface vlan x ;进入接口视图[Quidway-Vlan-interfacex]ip address 10.65.1.1 255.255.0.0 ;配置VLAN的IP 地址[Quidway]ip route-static 0.0.0.0 0.0.0.0 10.65.1.2 ;静态路由=网关[Quidway]rip ;三层交换支持[Quidway]local-user ftp[Quidway]user-interface vty 0 4 ;进入虚拟终端[S3026-ui-vty0-4]authentication-mode password ;设置口令模式[S3026-ui-vty0-4]set authentication-mode password simple 222 ;设置口令[S3026-ui-vty0-4]user privilege level 3 ;用户级别[Quidway]interface ethernet 0/1 ;进入端口模式[Quidway]int e0/1 ;进入端口模式[Quidway-Ethernet0/1]duplex {half|full|auto} ;配置端口工作状态[Quidway-Ethernet0/1]speed {10|100|auto} ;配置端口工作速率[Quidway-Ethernet0/1]flow-control ;配置端口流控[Quidway-Ethernet0/1]mdi {across|auto|normal} ;配置端口平接扭接[Quidway-Ethernet0/1]port link-type {trunk|access|hybrid} ;设置端口工作模式[Quidway-Ethernet0/1]port access vlan 3 ;当前端口加入到VLAN[Quidway-Ethernet0/2]port trunk permit vlan {ID|All} ;设trunk允许的VLAN[Quidway-Ethernet0/3]port trunk pvid vlan 3 ;设置trunk端口的PVID [Quidway-Ethernet0/1]undo shutdown ;激活端口[Quidway-Ethernet0/1]shutdown ;关闭端口[Quidway-Ethernet0/1]quit ;返回[Quidway]vlan 3 ;创建VLAN [Quidway-vlan3]port ethernet 0/1 ;在VLAN中增加端口[Quidway-vlan3]port e0/1 ;简写方式[Quidway-vlan3]port ethernet 0/1 to ethernet 0/4 ;在VLAN中增加端口[Quidway-vlan3]port e0/1 to e0/4 ;简写方式[Quidway]monitor-port <interface_type interface_num> ;指定镜像端口[Quidway]port mirror <interface_type interface_num> ;指定被镜像端口[Quidway]port mirror int_list observing-port int_type int_num ;指定镜像和被镜像[Quidway]description string ;指定VLAN描述字符[Quidway]description ;删除VLAN描述字符[Quidway]display vlan [vlan_id] ;查看VLAN设置[Quidway]stp {enable|disable} ;设置生成树,默认关闭[Quidway]stp priority 4096 ;设置交换机的优先级[Quidway]stp root {primary|secondary} ;设置为根或根的备份[Quidway-Ethernet0/1]stp cost 200 ;设置交换机端口的花费[Quidway]link-aggregation e0/1 to e0/4 ingress|both ; 端口的聚合[Quidway]undo link-aggregation e0/1|all ; 始端口为通道号[SwitchA-vlanx]isolate-user-vlan enable ;设置主vlan [SwitchA]isolate-user-vlan <x> secondary <list> ;设置主vlan包括的子vlan[Quidway-Ethernet0/2]port hybrid pvid vlan <id> ;设置vlan的pvid [Quidway-Ethernet0/2]port hybrid pvid ;删除vlan的pvid [Quidway-Ethernet0/2]port hybrid vlan vlan_id_list untagged ;设置无标识的vlan如果包的vlan id与PVId一致,则去掉vlan信息. 默认PVID=1。
所以设置PVID为所属vlan id, 设置可以互通的vlan为untagged.----------------------------------------路由器命令~~~~~~~~~~[Quidway]display version ;显示版本信息[Quidway]display current-configuration ;显示当前配置[Quidway]display interfaces ;显示接口信息[Quidway]display ip route ;显示路由信息[Quidway]sysname aabbcc ;更改主机名[Quidway]super passwrod 123456 ;设置口令[Quidway]interface serial0 ;进入接口[Quidway-serial0]ip address <ip> <mask|mask_len> ;配置端口IP地址[Quidway-serial0]undo shutdown ;激活端口[Quidway]link-protocol hdlc ;绑定hdlc协议[Quidway]user-interface vty 0 4[Quidway-ui-vty0-4]authentication-mode password[Quidway-ui-vty0-4]set authentication-mode password simple 222[Quidway-ui-vty0-4]user privilege level 3[Quidway-ui-vty0-4]quit[Quidway]debugging hdlc all serial0 ;显示所有信息[Quidway]debugging hdlc event serial0 ;调试事件信息[Quidway]debugging hdlc packet serial0 ;显示包的信息静态路由:[Quidway]ip route-static <ip><mask>{interface number|nexthop}[value][reject|blackhole]例如:[Quidway]ip route-static 129.1.0.0 16 10.0.0.2[Quidway]ip route-static 129.1.0.0 255.255.0.0 10.0.0.2[Quidway]ip route-static 129.1.0.0 16 Serial 2[Quidway]ip route-static 0.0.0.0 0.0.0.0 10.0.0.2动态路由:[Quidway]rip ;设置动态路由[Quidway]rip work ;设置工作允许[Quidway]rip input ;设置入口允许[Quidway]rip output ;设置出口允许[Quidway-rip]network 1.0.0.0 ;设置交换路由网络[Quidway-rip]network all ;设置与所有网络交换[Quidway-rip]peer ip-address ;[Quidway-rip]summary ;路由聚合[Quidway]rip version 1 ;设置工作在版本1[Quidway]rip version 2 multicast ;设版本2,多播方式[Quidway-Ethernet0]rip split-horizon ;水平分隔[Quidway]router id A.B.C.D ;配置路由器的ID [Quidway]ospf enable ;启动OSPF协议[Quidway-ospf]import-route direct ;引入直联路由[Quidway-Serial0]ospf enable area <area_id> ;配置OSPF区域标准访问列表命令格式如下:acl <acl-number> [match-order config|auto] ;默认前者顺序匹配。
rule [normal|special]{permit|deny} [source source-addr source-wildcard|any] 例:[Quidway]acl 10[Quidway-acl-10]rule normal permit source 10.0.0.0 0.0.0.255[Quidway-acl-10]rule normal deny source any扩展访问控制列表配置命令配置TCP/UDP协议的扩展访问列表:rule {normal|special}{permit|deny}{tcp|udp}source {<ip wild>|any}destination <ip wild>|any}[operate]配置ICMP协议的扩展访问列表:rule {normal|special}{permit|deny}icmp source {<ip wild>|any]destination {<ip wild>|any][icmp-code] [logging]扩展访问控制列表操作符的含义equal portnumber ;等于greater-than portnumber ;大于less-than portnumber ;小于not-equal portnumber ;不等range portnumber1 portnumber2 ;区间扩展访问控制列表举例[Quidway]acl 101[Quidway-acl-101]rule deny souce any destination any[Quidway-acl-101]rule permit icmp source any destination any icmp-type echo [Quidway-acl-101]rule permit icmp source any destination any icmp-type echo-reply [Quidway]acl 102[Quidway-acl-102]rule permit ip source 10.0.0.1 0.0.0.0 destination 202.0.0.1 0.0.0.0[Quidway-acl-102]rule deny ip source any destination any[Quidway]acl 103[Quidway-acl-103]rule permit tcp source any destination 10.0.0.1 0.0.0.0 destination-port equal ftp[Quidway-acl-103]rule permit tcp source any destination 10.0.0.2 0.0.0.0 destination-port equal www[Quidway]firewall enable[Quidway]firewall default permit|deny[Quidway]int e0[Quidway-Ethernet0]firewall packet-filter 101 inbound|outbound地址转换配置举例[Quidway]firewall enable[Quidway]firewall default permit[Quidway]acl 101 ;内部指定主机可以进入e0 [Quidway-acl-101]rule deny ip source any destination any[Quidway-acl-101]rule permit ip source 129.38.1.1 0 destination any[Quidway-acl-101]rule permit ip source 129.38.1.2 0 destination any [Quidway-acl-101]rule permit ip source 129.38.1.3 0 destination any [Quidway-acl-101]rule permit ip source 129.38.1.4 0 destination any [Quidway-acl-101]quit[Quidway]int e0[Quidway-Ethernet0]firewall packet-filter 101 inbound[Quidway]acl 102 ;外部特定主机和大于1024端口的数据包允许进入S0[Quidway-acl-102]rule deny ip source any destination any[Quidway-acl-102]rule permit tcp source 202.39.2.3 0 destination 202.38.160.1 0 [Quidway-acl-102]rule permit tcp source any destination 202.38.160.1 0 destination-port great-than1024[Quidway-acl-102]quit[Quidway]int s0[Quidway-Serial0]firewall packet-filter 102 inbound ;设202.38.160.1是路由器出口IP。