基础命令 | ||||
说明 | 华为 | H3C | 思科 | 锐捷 |
补全命令 | 按Tab键 | 按Tab键 | 按Tab键 | 按Tab键 |
查看配置命令 | display | display | show | show |
进入配置模 式 | system-view | system-view | 先enable 再config terminal | 先enable 再config terminal |
退回上级 | quit | quit | exit | exit |
直接返回第1级视图 | return | return | end | end |
取消某些配置 | undo | undo | no | no |
关闭接口 | shutdown | shutdown | shutdown | shutdown |
开启接口 | undo shutdown | undo shutdown | no shutdown | no shutdown |
保存配置 | save | save | write | write |
删除配置 | reset saved-configuration | reset saved-configuration | erasestartup-config | delete config.text 或del config.text |
重启设备 | reboot | reboot | reload | reload |
删除文件 | delete | delete | delete | delete |
设备命名 | sysname | sysname | hostname | hostname |
查看当前配置 | display current-configuration | display current-configuration | show running-config | show running-config |
查看已保存配置 | display saved-configuration | display saved-configuration | show startup-config | show startup-config |
查看路由表 | display ip routing-table | display ip routing-table | show ip route | show ip route |
查看ARP表 | display arp | display arp | show arp | show arp |
查看MAC表 | display mac-address | display mac-address | show mac address-table | show mac |
交换机常用命令 | ||||
说明 | 华为 | H3C | 思科 | 锐捷 |
创建VLAN | vlan XX | vlan XX | vlan XX | vlan XX |
查看VLAN | display vlan XX | display vlan XX | show vlan XX | show vlan XX |
删除VLAN | undo vlan | undo vlan | no vlan | no vlan |
进入VLAN接口视图 | interface vlan XX | interface vlan XX | interface vlan XX | interface vlan XX |
配置IP地址 | ip add X.X.X.X Y.Y.Y.Y | ip add X.X.X.X Y.Y.Y.Y | ip add X.X.X.X Y.Y.Y.Y | ip add X.X.X.X Y.Y.Y.Y |
配置接口为access | port link-type access | port link-type access | switchport mode access | switchport mode access |
批量配置接口 | port-group group-member G0/0/1 to G0/0/5 | int range G1/0/1 to G1/0/5 | int range fastEthernet0/x-x | int range fastEthernet0/x-x |
接口加入VLAN | port default vlan XX | port access vlan XX | switchport access vlan XX | switchport access vlan XX |
配置接口为trunk | port link-type trunk | port link-type trunk | switchport mode trunk | switchport mode trunk |
允许xx vlan通过 | port trunk allow-pass vlan xx | port trunk permit vlan xx | switchport trunk allowed vlan xx | switchport trunk allowed vlan xx |
配置接口双工 | duplex(half|full lauto) | duplex(half|full lauto) | duplex(half|full lauto) | duplex(half|full lauto) |
配置接口速率 | speed (100|1000) | speed (100|1000) | speed (100|1000) | speed (100|1000) |
转为二层口 | portswitch | port link-mode bridge | switchport | switchport |
开启接口三层功能 | undo portswitch | port link-mode route | no switchport | no switchport |
开启STP | stp enable | stp global enable | 默认开启 | spanning-tree |
改为快速生成树 | stp mode rstp | stp mode rstp | spanning-tree mode rapid-pvst | spanning-tree mode rstp |
配置STP优先级 | stp priority (0|4096|xxxx) | stp priority (0|4096|xxxx) | spanning-tree vlan XX priority (0|4096|xxxx) | spanning-tree priority(0|4096|xxxx) |
配置边缘端口 | stp edged-port enable | stp edged-port | spanning-tree portfast | spanning-tree portfast |
查看生成树状态 | display stp brief | display stp brief | show spanning-tree summary | show spanning-tree summary |
创建端口聚合组 | interface eth-trunk 1 | int Bridge-Aggregation 1 | interface port-channel 1 | int aggregateport 1 |
配置为lacp模式 | mode lacp | link-aggregation mode dynamic | 接口下channel-group 1 mode active | 接口下port-group 1 mode active |
接口下加入聚合组 | eth-trunk 1 | port link-aggregation group 1 | channel-group 1 mode active | port-group 1 mode active |
配置聚合口为acc或trunk | 参考普通接口配置 | 参考普通接口配置 | 参考普通接口配置 | 参考普通接口配置 |
查看聚合组 | display eth-trunk | display link-aggregation verbose Bridge-Aggregation | show etherchannel summary | show aggregatePort summary |
创建高级ACL | acl 3000 (3000-3999) | acl advanced 3000 (3000-3999) | 不需要先创建(100-199) | 不需要先创建(100-199) |
配置规则 | rule 5 permit tcp source 192.168.1.0 0.0.0.255 destination 192.168.2.2 0.0.0.0 destination-port eq 80 | rule 5 permit tcp source 192.168.1.0 0.0.0.255 destination 192.168.2.2 0.0.0.0 destination-port eq 80 | access-list 100 permit tcp 192.168.1.0 0.0.0.255 192.168.2.2 0.0.0.0 eq 80 | access-list 100 permit tcp 192.168.1.0 0.0.0.255 192.168.2.2 0.0.0.0 eq 80 |
接口应用ACL | traffic-filter inbound acl 3000 | packet-filter 3000 inbound | ip access-group 100 in | ip access-group 100 in |
查看ACL | display acl all | display acl all | show access-lists | show access-lists |