概述
本文介绍了 USW-Leaf 交换机支持的不同 CLI 命令以及它们在 Cisco 交换机上相对应的命令。
注意事项:暂不支持以下带有星号(*)的命令,可能会修改,但不会另行通知。
目录
- 常用命令
- VLAN 命令
- 端口操作指令
- LAG(链路聚合)命令
- SPAN(端口镜像)命令
- 风暴控制命令
- 端口隔离(受保护的端口)命令
- 端口流量拥塞控制命令
- QoS (Scheduling, Shaping and Policing) 命令
- ACL 命令
- STP; RSTP 命令
- MSTP 命令
- 端口错误禁用/自动恢复命令
- DHCP Guard / DHCP 侦听(Cisco)
- ARP
- DHCP 客户端/静态 IP
- 静态路由
常用命令
命令说明 |
USW-Leaf 命令 |
Cisco 命令 |
显示操作系统版本信息. | show version | show version |
显示 MAC 地址. | show system | show version |
显示 USW 型号. | show platform info | show version |
显示当前配置(DRAM). | show running config |
show running config
|
显示启动配置(NVRAM). | show startup-config |
show startup-config
|
显示路由器内存中的所有日志. | show log | show log |
显示交换机上的所有 IPv4 接口信息. | show ip interfaces brief |
show ip interfaces brief
|
显示当前的路由协议. | show ip protocol |
show ip protocol
|
显示 IPv4 路由表. | show ip route | show ip route |
显示 IPv6 路由表. | show ipv6 route | show ipv6 route |
显示访问列表. | show access-list <list_name> |
show access-list
|
显示 MAC 地址表. | show platform mac address-table |
show mac address-table
|
显示 ARP 表. | show arp | show arp |
显示连接到交换机的所有用户. | NA | show users |
显示闪存的信息. | NA | show flash |
显示使用命令的历史记录. | NA | show history |
显示系统时钟. | NA | show clock |
显示硬件状态信息. | show environment | show environment |
显示交换机可用内存. | show memory | show memory |
VLAN 命令
命令说明 |
USW-Leaf 命令 |
Cisco 命令 |
显示 VLAN 信息,属于指定 VLAN 的所有端口以及有关在交换机上配置的 VLAN 数量. | UBNT# show bridge-domain | SW# show vlan |
创建新的 VLAN 2. | UBNT# configure terminal UBNT(config)# bridge-domain 2 UBNT(bridge-domain)# exit UBNT(config)# |
SW# configure terminal
SW(config)# vlan 2 SW(config-vlan)# exit |
|
UBNT(config)# interface swp1 UBNT(config-if)# switchport mode trunk UBNT(config-if)# switchport trunk allowed vlan 2 UBNT(config-if)# switchport trunk native-vlan 10 UBNT(config-if)# exit UBNT(config)# bridge-domain 2 UBNT(bridge-domain)# vlan 2 swp1 UBNT(bridge-domain)# exit UBNT(config)# bridge-domain 10 UBNT(bridge-domain)# vlan 10 swp1 UBNT(bridge-domain)# exit |
SW(config)# interface fa1/0
SW(config-if)# switchport mode trunk SW(config-if)# switchport trunk allowed vlan add 2 SW(config-if)# switchport trunk native vlan 10 SW(config-if)# exit |
|
UBNT(config)# interface swp1 UBNT(config-if)# switchport trunk allowed vlan remove 2 UBNT(config-if)# no switchport trunk native-vlan UBNT(config-if)# exit |
SW(config)# interface fa1/0
SW(config-if)# switchport trunk allowed vlan remove 2 SW(config-if)# no switchport trunk native vlan SW(config-if)# exit |
*为指定端口上的本征 VLAN 启用或禁用 DOT1Q 。思科的方法在全球范围内通用. | UBNT(config)# interface swp1 UBNT(config-if)# vlan dot1q tag native UBNT(config-if)# no vlan dot1q tag native UBNT(config-if)# exit |
SW(config)# vlan do1q tag native
SW(config)# no vlan do1q tag native |
|
UBNT(config)# interface swp1 UBNT(config-if)# no switchport UBNT(config-if)# switchport mode access UBNT(config-if)# switchport access vlan 3 UBNT(config-if)# exit UBNT(config)# bridge-domain 3 UBNT(bridge-domain)# vlan 3 swp1 UBNT(bridge-domain)# exit |
SW(config)# interface fa1/0
SW(config-if)# switchport mode access SW(config-if)# switchport access vlan 3 SW(config-if)# exit |
删除接口上所有二层配置并关闭二层功能(包括 VLAN ),然后将接口切换到三层模式。 | UBNT(config)# interface swp1 UBNT(config-if)# no switchport UBNT(config-if)# exit |
SW(config)# interface fa1/0
SW(config-if)# no switchport SW(config-if)# exit |
|
UBNT(config)# bridge-domain 2 UBNT(bridge-domain)# no learning enable UBNT(bridge-domain)# learning limit 1000 UBNT(bridge-domain)# learning sticky aa:bb:cc:dd:11:22 interface swp1 UBNT(bridge-domain)# exit |
SW(config)# no mac-address-table learning vlan 2
SW(config)# mac-address-table limit vlan 2 maximum 1000 SW(config)# interface fa1/0 SW(config-if)# switchport port-security mac-address aa:bb:cc:dd:11:22 SW(config-if)# exit |
端口操作命令
命令说明 |
USW-Leaf 命令 |
Cisco 命令 |
显示端口状态和管理员状态. | UBNT# show interface status |
SW# show interface status
|
在接口上验证 FEC 功能状态. |
UBNT# show fec status
|
|
查看接口 swp1 的接口状态. | UBNT# show interface swp1 |
SW# show interface fa1/0
|
显示界面统计信息. | UBNT# show statistics interface |
SW# show interface counters
|
清除接口统计信息计数器. | UBNT# show statistics clear |
SW# clear counters
|
显示有关连接的收发器的信息. | UBNT# show platform fwd interface sfp |
SW# show interface transceiver
|
*有关 switchport 接口的信息. | NA |
show interface switchport
|
配置接口速度 100g,自动协商和 FEC cl-91. | UBNT(config)# interface swp54 UBNT(config-if)# speed 100g UBNT(config-if)# autonegotiation enabled UBNT(config-if)# fec cl-91 UBNT(config-if)# exit |
SW(config)# interface fa1/0
SW(config-if)# speed 100g SW(config-if)# speed auto SW(config-if)# fec cl91 SW(config-if)# exit |
配置每个指定接口的最大传输单元(MTU)大小. | UBNT(config)# interface swp54 UBNT(config-if)# mtu 9216 UBNT(config-if)# exit |
SW(config)# interface fa1/0
SW(config-if)# ip mtu 9216 SW(config-if)# end |
LAG(链路聚合)命令
命令说明 |
USW-Leaf 命令 |
Cisco 命令 |
显示 LACP 内部信息. | UBNT# show lacp internal |
SW# show lacp internal
|
显示 port-channel 接口的状态. | UBNT# show interface po1 |
SW# show interface port-channel 1
|
显示 port-channel 的流量统计信息. | UBNT# show lacp counters |
SW# show lacp counters
|
清除 LACP 计数器. | UBNT# clear lacp counters |
SW# clear lacp counters
|
显示 LACP 系统标识符. | UBNT# show lacp sys-id |
SW# show lacp system-identifier
|
显示有关 LACP 邻居的信息. | UBNT# show lacp neighbor |
SW# show lacp neighbor
|
配置 LACP 系统优先级和物理接口优先级. | UBNT(config)# lacp system-priority 65535 UBNT(config)# interface swp54 UBNT(config-if)# lacp port-priority priority 20000 UBNT(config-if)# exit |
SW(config)# lacp system-priority 65535
SW(config)# interface fa1/0 SW(config-if)# lacp port-priority priority 20000 SW(config-if)# exit |
|
UBNT(config)# interface swp1 UBNT(config-if)# no switchport UBNT(config-if)# channel-group 1 mode active UBNT(config-if)# interface swp2 UBNT(config-if)# no switchport UBNT(config-if)# channel-group 1 mode active UBNT(config-if)# interface port-channel 1 UBNT(config-if)# lacp min-links 2 UBNT(config-if)# lacp max-bundle 8 UBNT(config-if)# exit |
SW(config)# interface fa0/1
SW(config-if)# channel-group 1 mode active SW(config-if)# interface fa0/2 SW(config-if)# channel-group 1 mode active SW(config-if)# interface port-channel 1 SW(config-if)# lacp min-links 2 SW(config-if)# lacp max-bundle 8 SW(config-if)# exit |
SPAN(端口镜像)命令
命令说明 |
USW-Leaf 命令 |
Cisco 命令 |
显示有关交换端口分析器(SPAN)的信息. | UBNT# show mirror |
SW# show monitor session
|
设置 SPAN session (session 1) ,以监视目标端口的入口和出口流量. |
UBNT(config)# mirror tx session 1 UBNT(config-mirror)# source interface swp1 UBNT(config-mirror)# destination interface swp2 UBNT(config)# mirror rx session 1 UBNT(config-mirror)# source interface swp1 UBNT(config-mirror)# destination interface swp2 UBNT(config-mirror)# exit |
SW(config)# monitor session 1 source interface fastEthernet0/1 tx
SW(config)# monitor session 1 source interface fastEthernet0/1 rx SW(config)# monitor session 1 destination interface fastEthernet0/2 |
删除 SPAN sessions. | UBNT(config)# no mirror tx session 1 UBNT(config)# no mirror rx session 1 |
SW(config)# no monitor session 1
|
风暴控制命令
命令说明 |
USW-Leaf 命令 |
Cisco 命令 |
显示指定接口的风暴控制统计信息. | UBNT# show statistics storm-control interface swp1 |
SW# show interface fa0/1 counters storm-control
|
*风暴控制配置 (level 代表接口带宽百分比). | UBNT(config)# interface swp1 UBNT(config-if)# storm-control unicast level 50 UBNT(config-if)# storm-control multicast level 50 UBNT(config-if)# storm-control broadcast level 50 UBNT(config-if)# exit |
SW(config)# interface fa0/1
SW(config-if)# storm-control unicast level 50 SW(config-if)# storm-control multicast level 50 SW(config-if)# storm-control broadcast level 50 SW(config-if)# exit |
端口隔离(受保护的端口)命令
命令说明 |
USW-Leaf 命令 |
Cisco 命令 |
显示指定接口的受保护端口状态. | UBNT# show interface swp1 switchport |
SW# show interface fa0/1 switchport
|
启用或禁用将成为受保护端口的接口. | UBNT(config)# interface swp1 UBNT(config-if)# switchport protected UBNT(config-if)# no switchport protected UBNT(config-if)# exit |
SW(config)# interface fa0/1
SW(config-if)# switchport protected SW(config-if)# no switchport protected SW(config-if)# exit |
端口流量拥塞控制命令
命令说明 |
USW-Leaf 命令 |
Cisco 命令 |
*显示流量控制设置.
|
NA |
SW# show interface flowcontrol
|
|
UBNT(config)# interface swp1 UBNT(config-if)# flow-control mode both UBNT(config-if)# priority-flow-control mode both UBNT(config-if)# exit |
SW(config)# interface ethernet fa0/1
SW(config-if)# flowcontrol receive on SW(config-if)# flowcontrol send on SW(config-if)#priority-flow-control mode on SW(config-if)# exit |
在指定接口上禁用链路级别流控制及其优先级. | UBNT(config)# interface swp1 UBNT(config-if)# no flow-control UBNT(config-if)# no priority-flow-control UBNT(config-if)# exit |
SW(config)# interface ethernet fa0/1
SW(config-if)# flowcontrol receive off SW(config-if)# flowcontrol send off SW(config-if)#priority-flow-control mode off SW(config-if)# exit |
QoS(排程,整形和策略)命令
命令说明 |
USW-Leaf 命令 |
Cisco 命令 |
显示当前排程策略,队列权重和绑定的接口. | UBNT# show qos policy scheduling | SW# show mls qos interface queueing |
显示当前流量整形策略. | UBNT# show qos policy shape |
SW# show policy-map interface
|
显示当前流量管理策略. | UBNT# show qos policy policing | |
配置 QoS 排程策略,将策略绑定到指定接口. | UBNT(config)# qos policy scheduling sch_pol UBNT(qos-policy)# queue 0 dwrr 5 UBNT(qos-policy)# queue 1 dwrr 10 UBNT(qos-policy)# queue 2 dwrr 20 UBNT(qos-policy)# queue 3 dwrr 30 UBNT(qos-policy)# queue 4 dwrr 40 UBNT(qos-policy)# queue 5 dwrr 50 UBNT(qos-policy)# queue 6 dwrr 60 UBNT(qos-policy)# queue 7 dwrr 70 UBNT(qos-policy)# exit UBNT(config)# interface swp1 UBNT(config-if)# qos policy scheduling sch_pol UBNT(config-if)# exit |
SW(config)# interface gigabitEthernet 1/0/1 SW(config-if)# wrr-queue bandwidth 5 10 20 30 40 50 60 70 SW(config-if)# exit |
配置 QoS 整形策略,将策略绑定到指定接口. | UBNT(config)# qos policy shape shape_pol UBNT(qos-policy)# queue 0 min 2000 64000 max 10000 640000 UBNT(qos-policy)# queue 1 min 2000 64000 max 20000 640000 UBNT(qos-policy)# queue 2 min 2000 64000 max 20000 640000 UBNT(qos-policy)# queue 3 min 2000 64000 max 30000 640000 UBNT(qos-policy)# queue 4 min 2000 64000 max 40000 640000 UBNT(qos-policy)# queue 5 min 2000 64000 max 50000 640000 UBNT(qos-policy)# queue 6 min 2000 64000 max 60000 640000 UBNT(qos-policy)# queue 7 min 2000 64000 max 70000 640000 UBNT(qos-policy)# exit UBNT(config)# interface swp1 UBNT(config-if)# qos policy shape shape_pol UBNT(config-if)# end |
SW(config)#policy-map shape_pol SW(config-pmap)#class shape_cl SW(config-pmap-c)#shape avarage 640000 SWconfig-pmap-c)# exit SW(config)# interface gigabitEthernet 1/0/1 SW(config-if)#service-policy output shape_pol SW(config-if)# exit |
*配置利用两个 ACL(与策略器相关联)的QoS 管制策略,将该策略绑定到指定接口. | UBNT(config)# ip access-list voice-acl UBNT(config-ip-acl)# 10 permit ip 192.168.10.0/24 any UBNT(config-ip-acl)# exit UBNT(config)# ip access-list database UBNT(config-ip-acl)# 10 permit tcp any any eq 1810 UBNT(config-ip-acl)# 20 permit tcp any any eq 2481 UBNT(config-ip-acl)# 30 permit tcp any any eq 1521 UBNT(config-ip-acl)# exit UBNT(config)# policer aggregate voice-acl-aggr UBNT(qos-policer)# conform-action transmit UBNT(qos-policer)# exit UBNT(config)# policer aggregate database-aggr UBNT(qos-policer)# conform-action set-dscp 18 UBNT(qos-policer)# exit UBNT(config)# qos policy policing test-policing UBNT(qos-policy-policing)# 10 access-list voice-acl UBNT(qos-policy-policing-acl)# policer voice-acl-aggr UBNT(qos-policy-policing-acl)# exit UBNT(qos-policy-policing)# 20 access-list database UBNT(qos-policy-policing-acl)# policer database-aggr UBNT(qos-policy-policing-acl)# exit UBNT(qos-policy-policing)# exit UBNT(config)# interface swp1 UBNT(config-if)# qos policy policing test-policing input UBNT(config-if)# end |
SW(config)#ip access-list extended voice-acl SW(config-ext-nacl#permit ip 192.168.10.0 0.0.0.255 any SW(config-ext-nacl)#exit SW(config)#ip access-list extended database SW(config-ext-nacl)#permit tcp any any eq 1810 SW(config-ext-nacl)#permit tcp any any eq 2481 SW(config-ext-nacl)#permit tcp any any eq 1521 SW(config-ext-nacl)#exit SW(config)#class-map class-voice SW(config-cmap)#match access-group name voice-acl SW(config-cmap)#exit SW(config)#class-map class-database SW(config-cmap)#match access-group name database SW(config-cmap)#exit SW(config)#policy-map test-policing SW(config-pmap)#class class-voice SW(config-pmap-c)#trust cos SW(config-pmap-c)#exit SW(config-pmap)#class class-database SW(config-pmap-c)#set dscp af21 SW(config-pmap-c)#exit SW(config-pmap)#exit SW(config)#interface gigabitEthernet 1/0/1 SW(config-if)#service-policy input test-policing SW(config-if)#exit |
取消指定接口下的调度,排程和管理策略的绑定. | UBNT(config)# interface swp1 UBNT(config-if)# no qos policy scheduling UBNT(config-if)# no qos policy shape UBNT(config-if)# no qos policy policing input UBNT(config-if)# exit |
SW(config)# interface gigabitEthernet 1/0/1 SW(config-if)# no wrr-queue bandwidth SW(config-if)# no service-policy output shape_pol SW(config-if)# no service-policy input test-policing SW(config-if)# exit |
ACL 命令
命令说明 |
USW-Leaf 命令 |
Cisco 命令 |
显示 MAC 访问列表配置. | UBNT# show access-lists mac-acl | SW# show mac access-lists mac-acl |
显示 IP 访问列表配置. | UBNT# show access-lists ip-acl | SW# show ip access-lists ip-acl |
*MAC ACL 配置 | UBNT(config)# mac access-list mac-acl UBNT(config-mac-acl)# 10 permit any 0000.aaaa.0001 ffff.ffff.ffff any UBNT(config-mac-acl)# 20 permit any 0000.aaaa.0002 ffff.ffff.ffff any UBNT(config-mac-acl)# no sequence 20 UBNT(config-mac-acl)# exit |
SW(config)#mac access-list extended mac-acl SW(config-ext-macl)#permit any host 0000.aaaa.0001 SW(config-ext-macl)#permit any host 0000.aaaa.0002 SW(config-ext-macl)#no permit any host 0000.aaaa.0002 SW(config-ext-macl)#exit |
IP ACL 配置 | SW(config)# ip access-list ip-acl SW(config-ip-acl)# 10 permit ip 192.168.10.0/24 any SW(config-ip-acl)# 20 deny tcp any any eq 8080 SW(config-ip-acl)# exit |
SW(config)#ip access-list extended ip-acl SW(config-ext-ipacl)#permit ip 192.168.10.0 0.0.0.255 any SW(config-ext-ipacl)#deny tcp any any eq 8080 SW(config-ext-ipacl)#exit |
将 MAC ACL 和 IP ACL 应用于指定接口. | UBNT(config-mac-acl)# interface swp1 UBNT(config-if)# mac access-group mac-acl in UBNT(config-if)# ip access-group ip-acl in UBNT(config-mac-acl)# exit |
SW(config)# interface gigabitEthernet 1/0/1 SW(config-if)# mac access-group mac-acl in SW(config-if)# ip access-group ip-acl in SW(config-if)# exit |
从指定接口中删除 MAC ACL 和 IP ACL. | UBNT(config-mac-acl)# interface swp1 UBNT(config-if)# no mac access-group in UBNT(config-if)# no ip access-group in UBNT(config-mac-acl)# exit |
SW(config)# interface gigabitEthernet 1/0/1 SW(config-if)# no mac access-group mac-acl in SW(config-if)# no ip access-group ip-acl in SW(config-if)# exit |
STP; RSTP 命令
命令说明 |
USW-Leaf 命令 |
Cisco 命令 |
显示生成树信息. | UBNT# show spanning-tree stp | SW# show spanning-tree |
显示有关 STP 的简要信息. | UBNT# show spanning-tree interface brief | SW# show spanning-tree brief |
显示 STP 接口状态和指定接口的配置. | UBNT# show spanning-tree interface swp1 | SW# show spanning-tree interface gigabitEthernet 1/0/1 |
显示快速生成树信息. | UBNT# show spanning-tree rstp | SW# show spanning-tree |
配置生成树属性. | UBNT(config)# spanning-tree UBNT(config)# spanning-tree mode stp UBNT(config)# spanning-tree priority 32768 UBNT(config)# spanning-tree forward-time 15 UBNT(config)# spanning-tree max-age 20 UBNT(config)# spanning-tree hello-time 2 UBNT(config)# spanning-tree transmit hold-count 4 UBNT(config)# spanning-tree pathcost-method long UBNT(config)# exit |
SW(config)# spanning-tree SW(config)# spanning-tree mode stp SW(config)# spanning-tree priority 32768 SW(config)# spanning-tree forward-time 15 SW(config)# spanning-tree max-age 20 SW(config)# spanning-tree hello-time 2 SW(config)# spanning-tree transmit hold-count 4 SW(config)# spanning-tree pathcost-method long SW(config)# exit |
启用快速 STP. | UBNT(config)# spanning-tree mode rstp | SW(config)# spanning-tree mode rstp |
全局禁用生成树. | UBNT(config)# no spanning-tree | SW(config)#no spanning-tree |
*为接口启用或禁用 BPDU Guard. | UBNT(config)# interface swp1.1 UBNT(config-if)# spanning-tree bpdu-guard UBNT(config-if)# no spanning-tree bpdu-guard |
SW(config)# interface gigabitEthernet 1/0/1 SW(config-if)# spanning-tree bpduguard enable SW(config-if)# spanning-tree bpduguard disable |
*为接口启用或禁用 Loop Guard. | UBNT(config)# interface swp1.1 UBNT(config-if)# spanning-tree loopback-detection UBNT(config-if)# no spanning-tree loopback-detection |
SW(config)# interface gigabitEthernet 1/0/1 SW(config-if)# spanning-tree loopguard default SW(config-if)# no spanning-tree loopguard default |
*为接口启用或禁用 Root Guard. | UBNT(config)# interface swp1.1 UBNT(config-if)# spanning-tree root-guard UBNT(config-if)# no spanning-tree root-guard |
SW(config)# interface gigabitEthernet 1/0/1 SW(config-if)# spanning-tree guard root SW(config-if)# no spanning-tree guard root |
MSTP 命令
命令说明 |
USW-Leaf 命令 |
Cisco 命令 |
显示多个生成树配置信息. | UBNT# show spanning-tree mst configuration | SW# show spanning-tree mst configuration |
显示多个生成树指定的 instance 信息. | UBNT# show spanning-tree mst 1 status | SW# show spanning-tree mst 1 |
显示有关特定 MSTP instance 的简要信息. | UBNT# show spanning-tree mst 1 interface brief | |
配置多个生成树属性. | UBNT(config)# spanning-tree mode mst UBNT(config)# spanning-tree mst max-hops 22 UBNT(config)# spanning-tree mst name test_inst UBNT(config)# spanning-tree mst revision 32768 |
SW(config)# spanning-tree mode mst SW(config)# spanning-tree mst max-hops 22 SW(config)# spanning-tree mst configuration SW(config-mst)# name test_inst SW(config-mst)# revision 32768 SW(config-mst)# exit |
配置实例优先级,并将 VLAN 100 添加到 MST instance 2. | UBNT(config)# spanning-tree mst 2 priority 61440 UBNT(config)# spanning-tree instance 2 domain 100 |
SW(config)# spanning-tree mst 2 priority 61440 SW(config)# spanning-tree mst configuration SW(config-mst)# instance 2 vlan 100 SW(config-mst)# exit |
*指定 vlan 100 中特殊接口 swp1 的 STP / MSTP 接口相关命令. |
UBNT(config-if)# interface swp1.100 UBNT(config-if)# spanning-tree link-type point-to-point UBNT(config-if)# spanning-tree cost 10000 UBNT(config-if)# spanning-tree port-priority 32 UBNT(config-if)# spanning-tree edge-port |
SW(config)# interface gigabitEthernet 1/0/1 SW(config-if)# spanning-tree link-type point-to-point SW(config-if)# spanning-tree mst <instance-id> port-priority 32 SW(config-if)# spanning-tree mst <instance-id> cost 10000 SW(config-if)# spanning-tree portfast |
端口错误禁用/自动恢复命令
命令说明 |
USW-Leaf 命令 |
Cisco 命令 |
显示在 “ errdisable” 条件下启用接口的时间段. | UBNT# show errdisable recovery | SW# show errdisable recovery |
显示 “ errdisable” 状态的原因. | UBNT# show errdisable detect | SW# show errdisable detect |
配置 “ errdisable” 恢复间隔. | UBNT(config)# errdisable recovery interval 400 | SW(config)# errdisable recovery interval 400 |
*启用或禁用 BPDU 保护 “ errdisable” 恢复. | UBNT(config)# errdisable recovery cause bpduguard UBNT(config)# no errdisable recovery cause bpduguard |
SW(config)# errdisable recovery cause bpduguard SW(config)# no errdisable recovery cause bpduguard |
DHCP Guard / DHCP 侦听(Cisco)
命令说明 |
USW-Leaf 命令 |
Cisco 命令 |
显示 DHCP guard 设置. | UBNT# show ip dhcp guard | SW# show ip dhcp snooping binding |
启用或禁用 DHCP Guard. | UBNT(config)# ip dhcp guard UBNT(config)# no ip dhcp guard |
SW(config)# ip dhcp snooping SW(config)# no ip dhcp snooping |
将受信任的 DHCP 服务器添加或删除到指定 VLAN(Cisco 使用信任接口方法). | UBNT(config)# ip dhcp guard vlan 23 server 172.16.1.1 UBNT(config)# no ip dhcp guard vlan 23 server 172.16.1.1 |
SW(config)# ip dhcp snooping vlan 23 SW(config)# interface gigabitEthernet 1/0/1 SW(config-if)# ip dhcp snooping trust SW(config-if)# no ip dhcp snooping trust |
ARP
命令说明 |
USW-Leaf 命令 |
Cisco 命令 |
显示 ARP 表. | UBNT# show arp | SW# show ip arp |
在全局和每个特定接口上配置 ARP 老化时间. | UBNT(config)# arp aging-time 300 UBNT(config)# int swp1 UBNT(config-if)# arp aging-time 3600 UBNT(config-if)# exit |
SW(config)# arp timeout 300 SW(config)# interface gigabitEthernet 1/0/1 SW(config-if)# arp timeout 3600 SW(config-if)# exit |
添加或删除静态 ARP 条目. | UBNT(config)# ip arp 10.1.1.1 44:d9:e7:9e:b6:db port swp1 UBNT(config)# no ip arp 10.1.1.1 44:d9:e7:9e:b6:db |
SW(config)# interface gigabitEthernet 1/0/1 SW(config-if)# ip arp 10.1.1.1 44:d9:e7:9e:b6:db SW(config-if)# no ip arp 10.1.1.1 44:d9:e7:9e:b6:db |
清除 ARP 表. | UBNT# clear arp all | SW# clear ip arp |
DHCP 客户端/静态 IP
命令说明 |
USW-Leaf 命令 |
Cisco 命令 |
显示交换机上的所有 IPv4 接口. | UBNT# show ip interfaces brief | SW# show ip interfaces brief |
在 bridge-domain 接口上启用/禁用 DHCP 客户端. | UBNT(config)# interface bridge 1 UBNT(config-if)# ip address dhcp UBNT(config-if)# no ip address dhcp UBNT(config-if)# exit |
SW(config)# interface vlan1 SW(config-if)# ip address dhcp SW(config-if)# no ip address dhcp SW(config-if)# exit |
配置/删除接口上的静态 IP 地址. | UBNT(config)# interface swp1 UBNT(config-if)# ip address 172.16.0.1/24 UBNT(config-if)# no ip address 172.16.0.1/24 UBNT(config-if)# exit |
SW(config)# interface gigabitEthernet 1/0/1 SW(config-if)# ip address 172.16.0.1 255.255.255.0 SW(config-if)# no ip address 172.16.0.1 SW(config-if)# exit |
静态路由
命令说明 |
USW-Leaf 命令 |
Cisco 命令 |
显示 IPv4 路由表. | UBNT# sh ip route | SW# show ip route |
配置/删除默认静态路由. | UBNT(config)# ip route 0.0.0.0/0 192.168.1.1 UBNT(config)# no ip route 0.0.0.0/0 192.168.1.1 |
SW(config)# ip route 0.0.0.0 0.0.0.0 192.168.1.1 SW(config)# no ip route 0.0.0.0 0.0.0.0 192.168.1.1 |
配置/删除到指定网络的静态路由. | UBNT(config)# ip route 172.16.1.0/24 192.168.1.1 UBNT(config)# no ip route 172.16.1.0/24 192.168.1.1 |
SW(config)# ip route 172.16.1.0 255.255.255.0 192.168.1.1 SW(config)# no ip route 172.16.1.0 255.255.255.0 192.168.1.1 |
配置具有管理距离的静态路由. | UBNT(config)# ip route 172.16.1.0/24 192.168.1.1 15 | SW(config)# ip route 172.16.1.0 255.255.255.0 192.168.1.1 15 |
配置/删除 null0(blackhole)路由. | UBNT(config)# ip route 172.16.1.0/24 null0 UBNT(config)# no ip route 172.16.1.0/24 null0 |
SW(config)# ip route 172.16.1.0 255.255.255.0 null0 SW(config)# no ip route 172.16.1.0 255.255.255.0 null0 |
配置/删除 ICMP 拒绝路由. | UBNT(config)# ip route 172.16.1.0/24 reject UBNT(config)# no ip route 172.16.1.0/24 reject |
NA |