当前位置:网站首页>cisco交换机基本配置命令(华为交换机保存命令是什么)
cisco交换机基本配置命令(华为交换机保存命令是什么)
2022-08-01 09:50:00 【全栈程序员站长】
大家好,又见面了,我是你们的朋友全栈君。
一、调试命令
思科:
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 显示版本信息
二、接口配置命令
思科:
Switch(config)#interface f0/1 进入接口视图
Switch(config-if)#no shut 此命令开启接口
Switch(config-if)#description to server01 端口描述
Switch(config-if)#ip add 192.168.0.100 255.255.255.0 设置接口IP
华为:
[Quidway]interface e0/1 进入接口视图
[Quidway]undo shutdown 此命令开启接口
[Quidway]description to server02 端口描述
[Quidway]ip add 192.168.0.102 255.255.255.0 设置接口IP
三、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 allow vlan {ID|All}
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
五、设置安全远程访问
思科设置vty安全访问:
R1(config)# access-list 1 permit 192.168.0.5
R1(config)# line vty 0 4
R1(config)# access-class 1 in
华为设置vty安全访问:
[Quidway]acl number 2000
rule 1 permit source 172.168.0.150 0
rule 2 deny
[Quidway]user-interface vty 0 4
acl 2000 inbound
六、NTP配置
思科:
Cisco6509#show clock 显示时间
Cisco6509#clock set 14:00:00 30 Sep 2011 设置时间
Cisco6509(config)#ntp server 202.198.0.102 设置与其他时间服务器同步
Cisco6509(config)#clock timezone beijing +8 设置时区
华为:
[Quidway]dis clock 显示时间
[Quidway]clock datetime 23:30:00 2011/11/16 设置时间
[Quidway]ntp-service unicast-server 202.198.0.102 设置与其他时间服务器同步
[Quidway]clock timezone E8 add 08:00:00 设置时区
七、静态路由配置
思科:
ip route <目的网段> <目的网段掩码><下一跳>
Cisco6509# ip route 0.0.0.0 0.0.0.0 10.1.1.2 静态路由
Cisco6509#ip route 0.0.0.0 0.0.0.0 192.168.0.1 150 浮动静态路由管理距离为150
华为:
[Quidway] ip route-static 0.0.0.0 0.0.0.0 10.65.1.2
[Quidway]ip route-static 0.0.0.0 0.0.0.0 192.168.0.1 preference 150
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/126979.html原文链接:https://javaforall.cn
边栏推荐
- How to ensure the consistency of database and cache data?
- 还在纠结报表工具的选型么?来看看这个
- 使用ESP32驱动QMA7981读取三轴加速度(带例程)
- HoloView——实时数据
- SkiaSharp's WPF self-painted five-ring bouncing ball (case version)
- Google Earth Engine APP——15行代码搞定一个inspector高程监测APP
- C language game - minesweeper
- 【数据集】各类绝缘子、鸟巢及防震锤数据集汇总
- ClickHouse入门介绍与其特性
- Shell: Conditional test action
猜你喜欢
随机推荐
js中如何实现深拷贝?
PowerPC技术与市场杂谈
sql server, FULL mode, dbcc shrinkfile(2,1) can not shrink the transaction log, or the original size, why?
基于CAP组件实现补偿事务与消息幂等性
A problem with writing to the database after PHP gets the timestamp
报告:想学AI的学生数量已涨200%,老师都不够用了
Detailed explanation of JVM runtime data area and JMM memory model
Get the Token from the revised version of Qubutu Bed
AI篮球裁判火了,走步算得特别准,就问哈登慌不慌
用OpenCV的边缘检测
net stop/start mysql80 拒绝访问
7/31 训练日志
C language game - minesweeper
杨辉三角(c语言实现)
Idea common plugins
Message queue interview latest finishing (2022)
50.【动态二维数组的运用】
改版去不图床 Token 的获取
Yang Hui Triangle (C language implementation)
可视化——Superset安装与部署