app教程网 学习教程 华为和思科交换机配置区别(思科交换机配置loopback的指令)

华为和思科交换机配置区别(思科交换机配置loopback的指令)

Switch#show run显示所有配置命令Switch#show ip inter brief显示所有接口状态Switch#show vlan brief显示所有vlan信息Switch#show version显示版本信息。

一、调试命令

思科:

Switch#show run显示所有配置命令Switch#show ip inter brief显示所有接口状态Switch#show vlan brief显示所有vlan信息Switch#show version显示版本信息。

华为:

[quidway] diskur显示所有配置命令。

The Quidditch display interface shows the status of all interfaces.

[Quidway] Display all vlan Display information of all virtual LANs.

[Quidditch] The demo version displays version information.

二、接口配置命令

思科:

Switch (Configuration) # Interface f0/8 Enter Interface View Switch (Configuration -if)# No Close This command opens the interface.

Switch (Configuration -if)# Description to server01 Port Description

Switch (configuration -if)#ip address 192.168.1.100 255.255.255.0 Set the interface.

IP

华为:

【魁地奇】界面e0/1进入界面视图。

[Quidway]撤销关机这个命令打开界面。

Description of server 02 Port description

[Quidditch ]ip address 192.168.1.102 255.255.255.0 Set the interface Internet Protocol.

三、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

Set interface f0/24 of VLAN trunk switch (configuration)

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

六、设置安全远程访问

思科设置vty 安全访问:

R1(config)# access-list 1 permit 192.168.2.5

R1(config)# line vty 0 4

R1(config)# access-class 1 in

华为设置vty 安全访问:

[Quidway]acl number 2000

rule 1 permit source 172.29.181.150 0

rule 2 deny

[Quidway]user-interface vty 0 4

acl 2000 inbound

七、可网管配置

思科:

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 作为字串

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

本文来自网络,不代表本站立场,转载请注明出处:https: