全部商品分类

交换机的常用命令

来源:易点云 责编:易点云编辑 2020-08-01

1 - 2022-01-25T171239.760.jpg


交换机常用命令介绍:


        H3C Switch命令

一、模式命令:
1. 用户模式:Switch>
2. 特权模式:Switch>enable
Switch#
3. 全局配置模式:Switch#config terminal
Switch(config)#
4. 接口配置模式:Switch(config)#interface fastethernet0/1
Switch(config-if)#
5. Line模式:Switch(config)#line console 0
Switch(config-line)#
二、特权模式下的命令:
1. 查看机MAC地址:Switch#show mac-address-table
2. 发现(CDP):
Switch#show cdp
Switch#show cdp interface fastethernet0/1
Switch#show cdp neighbors
Switch#show cdp neighbors detail
Switch#show cdp entry
3. 保存机配置:
Switch#copy running-config startup-config或者Switch#write
4. 恢复交换机出厂值:
Switch#erase startup-config
Switch#reload
三、全局配置模式下的命令:
1. 配置主机名:Switch(config)#hostname Sw1
Sw1(config)#
2、 设置登陆台密码:Switch(config)#line console 0
Switch(config-line)#password 密码
Switch(config-line)#login
3. 使能口令:Switch(config)#enable Password 密码
4. 加密保存的使能口令:Switch(config)#enable secret 密码
5. 配置IP地址:
Switch(config)#interface vlan 1
Switch(config-if)#ip address IP地址 网关
Switch(config-if)#no shutdown
6. 配置交换机网关:Switch(config)#ip default-gateway 网关
四、VLAN配置命令:
1. 创建vlan命令:
a) 全局配置模式下:
Switch)#vlan 2(config
Switch(config)#name v2
Switch(config)#mtu 数值
Switch(config)#end
b) Vlan数据库下:
Switch#vlan database
Switch#vlan 2 name v2
Switch#vlan 2 mut 数值
Switch#exit
2. 删除vlan命令:
a) 全局配置模式下:
Switch(config)#no vlan 2
Switch(config)#end
b) Vlan数据库下:
Switch#no vlan 2 name v2
Switch#exit
3. 在vlan中添加端口:
Switch#config terminal
Switch(config)#interface f0/1(端口)
Switch(config-if)#Switchport mode access
Switch(config-if)#switchport access vlan 2
Switch(config-if)#end
一次将多个端口添加到vlan中:
Switch#config terminal
Switch(config)#interface range f0/1 - 5(端口)
Switch(config-if)#switchport access vlan 2
Switch(config-if)#end
注:switch#show vlan biref(查看vlan信息)
4. 配置vlan trunk:
1. 配置接口为trunk命令:
Switch(config)# interface f0/1(端口)
Switch(config-if)#Switchport mode trunk
2. 配置接口为动态协商模式的命令:
Switch(config)# interface f0/1(端口)
Switch(config-if)#switchport mode dynamic desirable/auto
3. 从trunk中删除vlan:
Switch(config)# interface f0/1(端口)
Switch(config-if)#Switchport trunk allowed vlan remove 2
4. 在trunk中添加vlan:
Switch(config)# interface f0/1(端口)

Switch(config-if)#Switchport trunk allowed vlan add 2

后续会更新 交换机的其他设置 以及搭建环境操作

上一篇: ​路由器DHCP配置方法 下一篇:台式机自带COMFAST白色网卡爱掉线处理办法

猜你喜欢

电脑连不上网感叹号怎么回事
电脑连不上网感叹号怎么回事
电脑连不上网感叹号怎么回事:主干路由器WAN口出现问题;路由器设备端问题;局域网ip地址冲突;电脑网卡问题。依次看看这几种原因是如何产生及解决的吧。针对上述涉及...

ip地址和mac地址的区别
ip地址和mac地址的区别
ip地址和mac地址的区别:一、地址性质不同MAC地址是烧录在网卡或者接口上的物理地址,具有二层意义和全球唯一性,一般不能被改变。每台计算机都有自己MAC地址,...

设置无线路由器的步骤
设置无线路由器的步骤
1. 宽带网线连接到路由器。如下图。线路连好后,看看WAN口对应的指示灯亮不亮,如果不亮则表明线路连接有问题,请检查确认网线连接牢固或尝试换一根网线。2. 登...

网络协议分为几层
网络协议分为几层
网络协议分为7层。首层是物理层、数据链路层、网络层、传输层、会话层、表示层、最后是应用层。中高层(即7、6、5、4层)定义了应用程序的功能,下面3层(即3、2、...

网络适配器是什么
网络适配器是什么
网卡,又称网络适配器或网络接口卡(NIC),英文名为Network Interface Card。在网络中,如果有一台计算机没有网卡,那么这台计算机将不能和其他...