A-A+

思科cisco和华为Quidway交换机常用命令之对比学习

2016年01月18日 路由器高级应用 暂无评论 阅读 2 views 次

思科和华为交换机应该是网络项目中大家接触比较多的了,这两种交换机的常用命令各有不同,本文结合网络项目中两种交换机的常用命令从对比的角度帮助大家来学习。

一、Switch#show run

显示所有配置命令

Switch#show ip inter brief 显示所有接口状态

Switch#show vlan brief 显示所有VLAN的信息

Switch#show version 显示版本信息

[Quidway]dis cur

显示所有配置命令 [Quidway]display interfaces 显示所有接口状态 [Quidway]display vlan all 显示所有VLAN的信息 [Quidway]display version 显示版本信息

二、VLAN配置命令:思科.

建立和删除VLAN

Switch# vlan database

Switch(vlan)# vlan 20 name test20

Switch(vlan)# no vlan 20

Switch(vlan)# exit

将端口分配给一个VLAN

Switch(config)# interface f0/1

Switch(config-if)# switchport mode access

Switch(config-if)# switchport access vlan 20

设置VLAN TRUNK

Switch(config)# interface f0/24 Switch(config-if)# switchport mode trunk

Switch(config-if)# switchport trunk encapsulation dot1q 华为:

建立和删除VLAN

[Quidway]vlan 30

[Quidway]undo vlan 30

将端口分配给一个VLAN

[Quidway]int ethernet0/1

[Quidway-Ethernet0/1]port access vlan 30( port default vlan 30)

或[Quidway]vlan 30

[Quidway-vlan3]port ethernet 0/1 在VLAN中增加端口

[Quidway-vlan3]port ethernet 0/1 to ethernet 0/4 在VLAN中增加多个连续端口

设置VLAN TRUNK

[Quidway]int e0/24

[Quidway-Ethernet0/24] port link-type trunk

[Quidway-Ethernet0/24]port trunk permit vlan {ID|All}

四、端口镜像配置

思科:配置镜像源端口

Switch(config)#monitor session 1 source interface gigabitEthernet 0/2 - 5 rx

上面命令最后一个参数:

both 监听双向数据,默认为both

rx 接收

tx 发送

配置镜像目的端口

Switch(config)#monitor session 1 destination interface gigabitEthernet

0/6

删除镜像端口

Switch(config)#no monitor session 1 华为:

将端口E0/2配置为监控端口 [Quidway]monitor-port Ethernet 0/2 端口

E0/1配置为镜像端口 [Quidway]port mirror Ethernet 0/1 或者直接配置监控端口和镜像端口 [Quidway]port mirror Ethernet 0/1 observing-port Ethernet 0/2

删除镜像[Quidway]undo monitor-port 五、冗余配置

思科HSRP:

  1. Switch# interface Vlan20  
  2.   ip address 172.29.197.33  255.255.255.248  
  3.  standby 20 ip 172.29.197.53  
  4.   
  5.  standby 20 priority 105   优先级  
  6.  standby 20 preempt        抢占  
  7.  standby 20 track GigabitEthernet0/25  decrement 10   跟踪端口如果DOWN了优先级减10 华为  
  8. VRRP:  
  9. [Quidway]interface Vlanif30  
  10.  ip address 172.29.197.9   255.255.255.248  
  11.  vrrp vrid 30 virtual-ip 172.29.141.11  
  12.  vrrp vrid 30 priority 150  优先级  
  13.  vrrp vrid 30 preempt-mode   抢占  

vrrp vrid 30 track interface GigabitEthernet0/0/18 reduced 60 跟踪端口如果DOWN了优先级减60 六、设置安全远程访问 [Quidway]

七、可网管配置

思科:

Switch(config)#snmp-server community sunion ro 配置本交换机的只读字串为sunion

Switch(config)#snmp-server community sunion rw 配置本交换机的读写字串为sunion

Switch(config)#snmp-server enable traps 允许交换机将所有类型SNMP Trap发送出去

Switch(config)#snmp-server host 192.168.190.1 traps sunion 指定交换机SNMP Trap的接收者为192.168.190.1,发送Trap时采用sunion作为字串 华为:

[Quidway]snmp-agent community read datanms 配置本交换机的只读字串为datanms

[Quidway]snmp-agent community write datanms 配置本交换机的读写字串为datanms

[Quidway]snmp-agent sys-info location BeiJing China 设置交换机的位置信息

[Quidway]snmp-agent sys-info version all 设置交换机支持所有的SNMP

协议版本

[Quidway]snmp-agent target-host trap address udp-domain

192.168.190.121 params securityname datanms 指定交换机SNMP Trap的接收者为192.168.190.121 ,发送Trap时采用datanms作为字串

好了,通过以上七点的举例,相信大家对项目中两种交换机的常用命令应该比较清晰了,当然更多的命令使用和技巧需要我们不断的积累。

思科和华为交换机应该是网络项目中大家接触比较多的了,这两种交换机的常用命令各有不同,本文结合网络项目中两种交换机的常用命令从对比的角度帮助大家来学习。

一、Switch#show run

显示所有配置命令

Switch#show ip inter brief 显示所有接口状态

Switch#show vlan brief 显示所有VLAN的信息

Switch#show version 显示版本信息

[Quidway]dis cur

显示所有配置命令 [Quidway]display interfaces 显示所有接口状态 [Quidway]display vlan all 显示所有VLAN的信息 [Quidway]display version 显示版本信息

三、VLAN配置命令:思科.

建立和删除VLAN

Switch# vlan database

Switch(vlan)# vlan 20 name test20

Switch(vlan)# no vlan 20

Switch(vlan)# exit

将端口分配给一个VLAN

Switch(config)# interface f0/1

Switch(config-if)# switchport mode access

Switch(config-if)# switchport access vlan 20

设置VLAN TRUNK

Switch(config)# interface f0/24 Switch(config-if)# switchport mode trunk

Switch(config-if)# switchport trunk encapsulation dot1q 华为:

建立和删除VLAN

[Quidway]vlan 30

[Quidway]undo vlan 30

将端口分配给一个VLAN

[Quidway]int ethernet0/1

[Quidway-Ethernet0/1]port access vlan 30( port default vlan 30)

或[Quidway]vlan 30

[Quidway-vlan3]port ethernet 0/1 在VLAN中增加端口

[Quidway-vlan3]port ethernet 0/1 to ethernet 0/4 在VLAN中增加多个连续端口

设置VLAN TRUNK

[Quidway]int e0/24

[Quidway-Ethernet0/24] port link-type trunk

[Quidway-Ethernet0/24]port trunk permit vlan {ID|All}

四、端口镜像配置

思科:配置镜像源端口

Switch(config)#monitor session 1 source interface gigabitEthernet 0/2 - 5 rx

上面命令最后一个参数:

both 监听双向数据,默认为both

rx 接收

tx 发送

配置镜像目的端口

Switch(config)#monitor session 1 destination interface gigabitEthernet

0/6

删除镜像端口

Switch(config)#no monitor session

1 华为:

将端口E0/2配置为监控端口 [Quidway]monitor-port Ethernet 0/2 端口E0/1配置为镜像端口 [Quidway]port mirror Ethernet 0/1 或者直接配置监控端口和镜像端口 [Quidway]port mirror Ethernet 0/1 observing-port Ethernet 0/2

删除镜像[Quidway]undo monitor-port

五、冗余配置

思科HSRP:

Switch# interface Vlan20

ip address 172.29.197.33 255.255.255.248

standby 20 ip 172.29.197.53

standby 20 priority 105 优先级

standby 20 preempt 抢占

standby 20 track GigabitEthernet0/25 decrement 10 跟踪端口如果DOWN了优先级减10

华为VRRP:

[Quidway]interface Vlanif30

ip address 172.29.197.9 255.255.255.248

vrrp vrid 30 virtual-ip 172.29.141.11

vrrp vrid 30 priority 150 优先级

vrrp vrid 30 preempt-mode 抢占

vrrp vrid 30 track interface GigabitEthernet0/0/18 reduced 60 跟踪端口如果DOWN了优先级减60 六、设置安全远程访问 [Quidway]

七、可网管配置

思科:

Switch(config)#snmp-server community sunion ro 配置本交换机的只读字串为sunion

Switch(config)#snmp-server community sunion rw 配置本交换机的读写字串为sunion

Switch(config)#snmp-server enable traps 允许交换机将所有类型SNMP Trap发送出去

Switch(config)#snmp-server host 192.168.190.1 traps sunion 指定交换机SNMP Trap的接收者为192.168.190.1,发送Trap时采用sunion作为字串

华为:

[Quidway]snmp-agent community read datanms 配置本交换机的只读字串为datanms

[Quidway]snmp-agent community write datanms 配置本交换机的读写字串为datanms

[Quidway]snmp-agent sys-info location BeiJing China 设置交换机的位置信息

[Quidway]snmp-agent sys-info version all 设置交换机支持所有的SNMP协议版本

[Quidway]snmp-agent target-host trap address udp-domain

192.168.190.121 params securityname datanms 指定交换机SNMP Trap的接收者为192.168.190.121 ,发送Trap时采用datanms作为字串好了,通过以上七点的举例,相信大家对项目中两种交换机的常用命令应该比较清晰了,当然更多的命令使用和技巧需要我们不断的积累。

标签:

给我留言