华为交换机基本命令
华为交换机配置命令大全

华为交换机配置命令大全华为交换机是一种高性能、高可靠的数据通信设备,广泛应用于各种网络环境中。
为了更好地使用华为交换机,我们需要了解一些基本的配置命令。
本文将为大家详细介绍华为交换机的配置命令大全,帮助大家更好地了解和使用华为交换机。
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。
```。
华为交换机常用命令

[Quidway-ui-vty0-4]set authentication-mode password simple 222
[Quidway-ui-vty0-4]user privilege level 3
line-rate in 37 (进)
line-rate out 37 (出)
下载和上传都是10M
带宽的换算方式是N-27
37-27=10
10M=27
20M=47
30M=57
以此类推
4.通过IP查找端口
ping 所查IP
dis arp
dis mac 该IP把对应的mac
[Quidway-serial0]undo shutdown ;激活端口
[Quidway]link-protocol hdlc ;绑定hdlc协议
[Quidway]user-interface vty 0 4
[Quidway]sysname ;交换机命名
[Quidway]interface ethernet 0/1 ;进入接口视图 ห้องสมุดไป่ตู้
[Quidway]interface vlan x ;进入接口视图
[Quidway]vlan 3 ;创建VLAN
[Quidway-vlan3]port ethernet 0/1 ;在VLAN中增加端口
[Quidway-vlan3]port e0/1 ;简写方式
[Quidway]description ;删除VLAN描述字符
[Quidway]display vlan [vlan_id] ;查看VLAN设置
华为路由器交换机常用命令

华为路由器交换机常用命令一、设备管理命令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地质。
华为交换机设备基础命令大全,拿走不谢!

华为交换机设备基础命令大全,拿走不谢!终将渡过成长的海01正文01交换机的基础命令汇总system-view 进入系统视图quit 退到系统视图sysname 交换机命名vlan 20 创建vlan(进入vlan20)display vlan 显示vlanundo vlan 20 删除vlan20display vlan 20 显示vlan里的端口20Interface e1/0/24 进入端口24portlink-type access vlan 20 把当前端口放入vlan20 undo porte1/0/10 删除当前VLAN端口10display current-configuration 显示当前配置02配置交换机支持TE L N E Tinterfacevlan 1 进入VLAN1ip address192.168.3.100 255.255.255.0 配置IP地址user-interfacevty 0 4 进入虚拟终端authentication-modepassword (aut password) 设置口令模式setauthentication password simple 222 (set aut pass sim 222) 设置口令userprivilege level 3(use priv lev 3) 配置用户级别dispcurrent-configuration (disp cur) 查看当前配置display ipinterface 查看交换机VLANIP配置resetsaved-configuration(reset saved) 删除配置(必须退到用户模式)reboot重启交换机03跨交换机V L AN的通讯在sw1上:vlan 10建立VLAN 10interfacee1/0/5 进入端口5Portdefault vlan 10 把端口5加入vlan10vlan 20建立VLAN 20interfacee1/0/15 进入端口15portdefault vlan 20 把端口15加入VLAN20interfacee1/0/24 进入端口24portlink-type trunk 把24端口设为TRUNK端口port trunkpermit vlan all 所有端口都能经过此路径在SW2上:vlan 10建立VLAN 10interfacee1/0/20 进入端口20portdefault vlan 10 把端口20放入VLAN10interfacee1/0/24 进入端口24portlink-type trunk 把24端口设为TRUNK端口port trunkpermit vlan all (port trunk permit vlan 10 只能为vlan10使用)24端口为所有VLAN使用displayinterface e1/0/24 查看端口24是否为TRUNKundo porttrunk permit vlan all 删除该句04路由器的基础命令汇总dispaly version 显示系统软件版本及硬件信息system-view 切换到系统视图quit 返回interface +接口进入接口视图ip address +IP +mask 配置IP和子网掩码return 返回用户视图<Ctrl+Z> 返回用户视图sysname R1 修改路由器名称为R1display current-configuration 查看路由器当前配置dispaly interface +接口查看路由器接口的状态信息save 保存当前配置display ip interface brief 查看接口与IP相关摘要信息display ip routing-table 查看路由表05t e l ne t远程登陆配置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 配置该用户接入类型为aaaq 退回到用户视图user-interface vty 0 4 进入到VTY用户视图authentication-mode aaa 设置验证方式aaa06配置S te l ne t配置SSHserver:rsalocal-key-pair create 生成本地RSA主机密钥对display rsa local-key-pair public 查看本地密钥对中的公钥信息user-interface vty 0 4 进入VTY用户视图authentication-mode aaa 设置用户验证方式为aaa授权验证方式protocol inbound ssh 指定VTY用户只支持sshq 返回到系统视图aaa 进入aaa视图local-user huawei1 password cipher huawei1 创建用户和设置用户密码local-user huawei1 service-type ssh 配置本地用户接入类型为sshq 退回到用户视图ssh user huawei1 authentication-type password新建ssh用户指定ssh用户认证方式为passwordaaa 进入aaa视图local-user huawei1 privilege level 3 设置huawei1用户级别为3级别范围0~15stelnet server enable 开启ssh功能display ssh user-information huawei1 查看ssh用户配置信息不指定用户默认查看所有用户display ssh server status 查看ssh服务器全局配置信息07S TP配置和选路规则stp enable 在交换机上启用STPstp mode stpdis stp 查看stp配置dis stp brief 查看接口摘要信息stp priority 4096 修改交换机优先级为4096stp root primary 设置交换机为主根交换机stp root secondary 命令配置备份交换机display stp interface Ethernet 0/0/2 查看e0/0/2接口的开销值int e0/0/2stp cost 2000 配置接口e0/0/2的带价值为2000stp timer forward-delay 3000 修改STP的ForwardDelay时间为3000cs也就是30sstp bridge-diameter 3 命令设置网络的直径为3stp mode rstp 启用RSTP使用RSTP可以缩短收敛时间int e0/0/1stp edged-port enable 配置接口e0/0/1为边缘端口不参与生成树的计算08配置MS TP多实例stp region-configuration 进入MST域视图region-name huawei 配置MST域名为huaweirevision-level 1 配置MSTP的修订级别为1instance 1 vlan 10 指定VLAN10映射到MSTI1active region-configuration 激活MST域配置display stp region-configuration 查看交换机上当前生效的MST域配置信息dis stp instance 0 brief 查看实例0中的生成树状态和统计的摘要信息stp instance 2 priority 0 配置交换机成位实例2中的根交换机09R I P路由协议配置rip 创建开启协议进程network + ip 对指定网段接口使能RIP功能IP地址是与路由器直连的网段debugging rip 1 查看RIP定期更新情况terminal debuggingterminal monitor 在屏幕上显示debug信息undo debugging rip 1undo debug all 命令关闭debug调试功能在上面的配置基础上配置RIP2rip 进入子视图模式version 2 配置版本或者直接配置rip 1version 2network + ip10O S P F单区域配置ospf 1 进入ospf视图1代表进程号area 0 创建区域并进入OSPF区域视图,输入要创建的区域ID,骨干区域即区域0network +IP +匹配码display ospf interface 命令查看OSPF接口通告是否正确、display ospf peer 查看OSPF邻居状态display ip routing-table protocol ospf 查看OSPF路由表11配置O S P F区域明文认证ospf 1area 1authentication-mode simple plain huawei plain是口令以明文方式显示authentication-mode md5 1 huawei 配置区域密文认证12配置链路认证int g0/0/1ospf authentication-mode md5 1 huawei 在一条链路中的两个接口配置要相同13配置抑制接口ospf 1silent-interface GigabitEthernet 0/0/1 禁止接口g0/0/1接收和发送ospf报文14技巧对多个接口配置接口抑制ospf 1silent-interface all 抑制所有接口undisplay ip routing-table 10.0.1.1 查看10.0.1.1所在网段的路由条目15基于接口修改int g0/0/0ospf network-type p2mp 修改ospf的网络类型为多到多点ospf network-type broadcast 修改ospf的网络类型为广播ospf dr-priority 100 修改g0/0/0接口的DR优先级为100reset ospf process 重启ospf进程ospf cost 1000 修改ospf的开销值为1000ospf timer hello 20 修改HELLO计时器为20sospf timer dead 80 修改dead计时器为80sospf 1preference 110 修改ospf优先级为110值越大优先级越低16路由引入ospf 1import-route rip 1 在ospf进程中引入ripdefault-route-advertise always 在ospf进程中引入默认路由ripimport-route ospf 1 在rip进程中引入ospfimport-route ospf cost 3 ospf 引入rip时配置开销值default-route originate 在RIP进程中发布默认路由17v r r p(虚拟路由器冗余协议)基本配置int g0/0/0vrrp vrid 1 virtual-ip 172.16.1.254创建VRRP备份组,备份组号为1,配置虚拟IP为172.16.1.254vrrp vrid 1 priority 120 修改优先级为120display vrrp 查看vrrp信息display vrrp briefdisplay vrrp interface g0/0/0 查看VRRP的工作状态18配置V R RP多备份组int g0/0/0vrrp vrid 1 virtual-ip 172.16.1.254创建VRRP备份组,备份组号为1,配置虚拟IP为172.16.1.254vrrp vrid 1 priority 120 修改优先级为120vrrp vrid 2 virtual-ip 172.16.1.253创建VRRP备份组,备份组号为2,配置虚拟IP为172.16.1.253int g0/0/0vrrp vrid 1 virtual-ip 172.16.1.254创建VRRP备份组,备份组号为1,配置虚拟IP为172.16.1.254vrrp vrid 2 virtual-ip 172.16.1.253创建VRRP备份组,备份组号为2,配置虚拟IP为172.16.1.253vrrp vrid 2 priority 120 修改优先级为120vrrp vrid 2 preempt-mode disable 开启非抢占方式19配置V R RP的跟踪接口及认证int g0/0/1vrrp vrid 1 track interface GigabitEthernet 0/0/0 reduced 50监视上行接口G0/0/0,当此接口断掉时,裁减优先级50,使优先级为70 vrrp vrid 1 authentication-mode md5 huawei 认证配置20配置基本的访问控制表acl 2000 创建一个编号型ACL,基本ACL的范围是2000~29999rule 5 permit source 1.1.1.1 0指定规则ID为5,允许数据源地址为1.1.1.1的报文通过,反掩码全为0,即精确匹配rule 10 deny source any 指定ID为10,拒绝任意源地址的数据包通过display acl all 查看设备上所有的访问控制列表。
(完整版)华为交换机命令大全

华为交换机基本配置命令详解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-view2.设置用户登录时需要进行口令验证,且验证口令为huawei。
[Quidway] user-interface 0[Quidway-ui0] authentication-mode password[Quidway-ui0] set authentication password simple huawei3. 设置从用户界面登录后可以访问的命令级别: user privilege level level恢复从用户界面登录后可以访问的命令级别为缺省级别: undo user privilege level4.系统IP配置:a.创建并进入管理VLAN接口视图:interface vlan-interface vlan-id删除管理VLAN :undo interface vlan-interface vlan-idb.配置管理VLAN接口IP地址:ip address ip-address net-mast删除管理VLAN接口IP地址:undo ip address [ip-address net-mast]5. 进入Ethernet0/1以太网端口视图。
[Quidway] interface ethernet0/16. 配置端口Ethernet0/1为Trunk端口,并允许2、6到50、100等VLAN通过。
[Quidway-Ethernet0/1] port link-type trunk[Quidway-Ethernet0/1] port trunk permit vlan 2 6 to 50 100创建VLAN 100。
[Quidway] vlan 100配置端口Ethernet0/1的缺省VLAN ID为100。
[Quidway-Ethernet0/1] port trunk pvid vlan 1007. 创建VLAN并进入VLAN视图: vlan vlan_id删除已创建的VLAN: undo vlan{ vlan_id [ to vlan_id ] | all }8. 为指定的VLAN增加以太网端口: port interface_list删除指定的VLAN的某些以太网端口: undo port interface_list创建VLAN2并进入其视图。
华为交换机基础命令

华为交换机基础命令⼀.简单命令1.进⼊到管理员配置模式<Huawei>sys2.更改名字[Huawei]sysname test3.查看VLAN[test]dis vlan[test]dis port vlan4.进⼊VLAN[test]int g0/0/15.查看端⼝模式[test-GigabitEthernet0/0/1]port link-type ?access Access portdot1q-tunnel QinQ porthybrid Hybrid porttrunk Trunk port6.划分端⼝[test]vlan 107.将端⼝设置为trunk模式[test-GigabitEthernet0/0/2]port link-type trunk8.允许所有VLAN通过[test-GigabitEthernet0/0/2]port trunk allow-pass vlan all⼆.划分vlan1.进⼊配置模式并修改名称<test>sysEnter system view, return user view with Ctrl+Z.[test]sysname lianxi[lianxi]2.开启端⼝0/0/1端⼝(分别开启1、2、3、4号端⼝)[lianxi]int GigabitEthernet 0/0/1[lianxi-GigabitEthernet0/0/1]port link-type access[lianxi-GigabitEthernet0/0/1]quit[lianxi]3.划分VALM,添加端⼝(同样的⽅法添加vlan 20)[lianxi]vlan 10[lianxi-vlan10]port GigabitEthernet 0/0/1 to 0/0/2[lianxi-vlan10]display vlanThe total number of vlans is : 3--------------------------------------------------------------------------------U: Up; D: Down; TG: Tagged; UT: Untagged;MP: Vlan-mapping; ST: Vlan-stacking;#: ProtocolTransparent-vlan; *: Management-vlan;--------------------------------------------------------------------------------VID Type Ports--------------------------------------------------------------------------------1 common UT:GE0/0/5(D) GE0/0/6(D) GE0/0/7(D) GE0/0/8(D)GE0/0/9(D) GE0/0/10(D) GE0/0/11(D) GE0/0/12(D)GE0/0/13(D) GE0/0/14(D) GE0/0/15(D) GE0/0/16(D)GE0/0/17(D) GE0/0/18(D) GE0/0/19(D) GE0/0/20(D)GE0/0/21(D) GE0/0/22(D) GE0/0/23(D) GE0/0/24(D)10 common UT:GE0/0/1(U) GE0/0/2(U)20 common UT:GE0/0/3(U) GE0/0/4(U)4.删除vlan[lianxi]undo vlan 10[lianxi]display vlan1 common UT:GE0/0/1(U) GE0/0/2(U) GE0/0/5(D) GE0/0/6(D)GE0/0/7(D) GE0/0/8(D) GE0/0/9(D) GE0/0/10(D)GE0/0/11(D) GE0/0/12(D) GE0/0/13(D) GE0/0/14(D)GE0/0/15(D) GE0/0/16(D) GE0/0/17(D) GE0/0/18(D)GE0/0/19(D) GE0/0/20(D) GE0/0/21(D) GE0/0/22(D)GE0/0/23(D) GE0/0/24(D)20 common UT:GE0/0/3(U) GE0/0/4(U)三.交换机连接[lianxi]int GigabitEthernet 0/0/6[lianxi-GigabitEthernet0/0/6]port link-type trunk #trunk模式[lianxi-GigabitEthernet0/0/6]port trunk allow-pass vlan all #让所有vlan通过四.交换机DHCP分配地址开启DHCP<Huawei>sys[Huawei]dhcp enable #开启DHCP划分vlan[Huawei]vlan 10[Huawei-vlan10]q[Huawei]vl[Huawei]vlan 20[Huawei-vlan20]q[Huawei]进⼊vlan,分配IP地址[Huawei]int vlan 10[Huawei-Vlanif10]ip address 192.168.10.1 24 #为vlan10 分配IP地址[Huawei-Vlanif10]dhcp select interface #在VLAN中开启DHCP[Huawei-Vlanif10]dhcp server dns-list 192.168.10.254 #设置⽹关[Huawei-Vlanif10]dhcp server excluded-ip-address 192.168.10.254 #禁⽌⽹关分配到客户机将0/0/1端⼝划分到VLAN 10中,有[Huawei]int g0/0/1[Huawei-GigabitEthernet0/0/1]port hybrid pvid vlan 10[Huawei-GigabitEthernet0/0/1]port hybrid untagged vlan 10。
华为交换机基本配置命令

华为交换机基本配置命令华为交换机基本配置命令一、单交换机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、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
华为交换机基本命令华为交换机基本命令交换机命令[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[Quidway]ip route-static 0.0.0.0 0.0.0.0 10.65.1.2 静态路由=网关[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-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} 配置端口MDI/MDIX状态平接或扭接[Quidway-Ethernet0/1]port link-type {trunk|access|hybrid} 设置接口工作模式(access(缺省)不支持802.1q帧的传送,而trunk支持(用于Switch间互连),hybrid和trunk的区别在于trunk 只允许缺省VLAN的报文发送时不打标签,而hybrid允许多个VLAN报文发送时不打标签。
)[Quidway-Ethernet0/1]shutdown 关闭/重起接口[Quidway-Ethernet0/2]quit 退出系统视图------------------------------------[Quidway]vlan 3 创建/删除一个VLAN/进入VLAN模式[Quidway-vlan3]port ethernet 0/1 to ethernet 0/4 在当前VLAN增加/删除以太网接口[Quidway-Ethernet0/2]port access vlan 3 将当前接口加入到指定VLAN[Quidway-Ethernet0/2]port trunk permit vlan {ID|All} 设trunk允许的VLAN[Quidway-Ethernet0/2]port trunk pvid vlan 3 设置trunk端口的PVID[Quidway]monitor-port 指定和清除镜像端口[Quidway]port mirror 指定和清除被镜像端口[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 设置交换机端口的花费[SwitchA-vlanx]isolate-user-vlan enable 设置主vlan[SwitchA]Isolate-user-vlan secondary 设置主vlan包括的子vlan[Quidway-Ethernet0/2]port hybrid pvid vlan 设置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]link-aggregation ethernet 0/7 to ethernet 0/10 {ingress|both} 配置端口聚合Port_num1为端口聚合组的起始端口号,Port_num2为终止端口号,ingress为接口入负荷分担方式,both为接口出入双向负荷分担方式。
[SwitchA]display link-aggregation ethernet0/1[SwitchA]undo link-aggregation all------------------------------------路由器命令[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[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 {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 ;可以all[Quidway-rip]network 2.0.0.0[Quidway-rip]peer ip-address[Quidway-rip]summary[Quidway]rip version 1[Quidway]rip version 2 multicast[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配置OSPF区域标准访问列表命令格式如下:acl [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 {|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 区间扩展访问控制列表举例[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[Quidway-acl-101]rule deny ip source any destination any[Quidway-acl-101]rule permit ip source 129.38.1.4 0 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 102[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-than 1024[Quidway-Ethernet0]firewall packet-filter 101 inbound[Quidway-Serial0]firewall packet-filter 102 inbound[Quidway]nat address-group 202.38.160.101 202.38.160.103 pool1[Quidway]acl 1[Quidway-acl-1]rule permit source 10.110.10.0 0.0.0.255[Quidway-acl-1]rule deny source any[Quidway-acl-1]int serial 0[Quidway-Serial0]nat outbound 1 address-group pool1[Quidway-Serial0]nat server global 202.38.160.101 inside 10.110.10.1 ftp tcp[Quidway-Serial0]nat server global 202.38.160.102 inside 10.110.10.2 www tcp[Quidway-Serial0]nat server global 202.38.160.102 8080 inside 10.110.10.3 www tcp[Quidway-Serial0]nat server global 202.38.160.103 inside 10.110.10.4 smtp udpPPP配置命令[Quidway-Serial0]link-protocol ppp 封装PPP协议[Quidway-Serial0]ppp authentication-mode {pap|chap} 设置验证类型证类型[Quidway]local-user username password {simple|cipher} password 配置用户列表PPP验证:主验方:pap|chap[Quidway]local-user u2 password {simple|cipher} aaa[Quidway]interface serial 0[Quidway-serial0]ppp authentication-mode {pap|chap}[Quidway-serial0]ppp chap user u1 //pap时,不用此句pap被验方:[Quidway]interface serial 0[Quidway-serial0]ppp pap local-user u2 password {simple|cipher} aaachap被验方:[Quidway]interface serial 0[Quidway-serial0]ppp chap user u1[Quidway-serial0]local-user u2 password {simple|cipher} aaa。