交换机及其配置相关代码

更新时间:2023-06-06 16:13:05 阅读: 评论:0

冷不丁的意思
步骤名称(IOS/CatOS)
Catalyst 3548(Cisco IOS)
Catalyst 6500(Catalyst OS)
启用交换机HTTP Server
1、进入全局配置模式;
2、启用HTTP Server:
Switch-3548(config) # ip http rver
Switch-6500> (enable) t ip http rver enable
配置交换机的主系统信息
1、配置交换机的主机名
Switch-3548 (config) # hostname Switch-PHY-3548
Switch-6500> (enable) t system name Switch-PHY-6500>
2、配置超级用户口令
Switch-3548(config) # enable password zzz(明文)
Switch-3548(config) # enable password 7 zzz(加密)
Switch-3548(config) # enable cret 5 zzz(明文)
Switch-6500> (enable) t enablepass
3、设置远程登录口令
Switch-PHY-3548(config) # line vty 0 4
Switch-3548(config-line) # password (0) zzz(明文)
Switch-3548(config-line) # password 7 zzz(加密)
Switch-PHY-6500>(enable) t password
4、设置系统时间
命令格式:clock t hh:mm:ss day month year
Switch-PHY-3548#clock t 23:00:00 23 february 2007
命令格式:t time [day_of_week] [mm/dd/yy] ][hh:mm:ss]
Switch-PHY-6500>(enable) t time fri 2/23/2007 23:00:00
5、配置设备管理地址(IP地址)与缺省路由(默认路由)
1、配置IP地址:
Switch-PHY-3548(config) # interface VLAN 1
Switch-PHY-3548(config-if) # ip address 203.105.1.62 255.255.255.0
2、配置缺省路由:
Switch-PHY-3548(config) # ip default-gateway 203.105.1.1
1、 配置IP地址:
命令格式:
t interface sc0 <ip_addr> <ip_mask> <ip_addr>(广播地址,可选)
Switch-PHY-6500>(enable) t interface sc0 203.105.1.63 255.255.255.0 203.105.1.255
2、配置缺省路由:
Switch-PHY-6500>(enable) t ip route 0.0.0.0 203.105.1.1
交换机端口配置
1、配置交换机的端口描述
国家法1、进入端口配置模式
Switch-PHY-3548(config) # interface f0/24
2、配置端口描述信息 Switch-PHY-3548(config-if) # descripition To-lib
命令格式: t port name <mod/port> <name>
Switch-PHY-6500>(enable) t port name 4/5 mail-rver
2、配置交换机端口的关闭与开启
1、进入端口配置模式
Switch-PHY-3548(config) # interface f0/24
2、关闭或开启端口 Switch-PHY-3548(config-if) #shutdown
Switch-PHY-3548(config-if) # no shutdown
命令格式:
t port enable <mod/port>(开启)
t port disable <mod/port>(关闭)
Switch-PHY-6500>(enable) t port enable 4/5
Switch-PHY-6500>(enable) t port disable 4/5
   
3、配置交换机端口的通信方式
1、进入端口配置模式
如何鉴别紫砂壶Switch-PHY-3548(config) # interface f0/24
2、配置端口通信方式 Switch-PHY-3548(config-if) # duplex auto(自适应)
Switch-PHY-3548(config-if) # duplex full(全双工) Switch-PHY-3548(config-if) # duplex half(半双工)
命令格式:
t port duplex <mod/port> full
t port duplex <mod/port> half
Switch-PHY-6500>(enable) t port duplex 5/1 full(设置为全双工)
Switch-PHY-6500>(enable) t port duplex 5/1-24 full
Switch-PHY-6500>(enable) t port duplex 5/1 half(设置为半双工)
Switch-PHY-6500>(enable) t port duplex 5/1-24 half
4、配置交换机端口的传输速率
1、进入端口配置模式
Switch-PHY-3548(config) # interface f0/24
2、配置端口的传输速率 Switch-PHY-3548(config-if) # speed 10 (设置为10Mbps)
Switch-PHY-3548(config-if) # auto(设置为自动速率配置)
命令格式:
t port speed <mod/port> auto
t port speed <mod/port> <port_speed> (10,100,1000)
Switch-PHY-6500>(enable) t port speed 5/1 auto(设置为自动速率配置)
Switch-PHY-6500>(enable) t port speed 5/1-24 auto
Switch-PHY-6500>(enable) t port speed 5/1-24 10(10Mbps)
配置交换机端口的两种系统的区分:① Cisco IOS:进入接口模式,设置属性,内容 ② CatOS 格式:t,对象类型(port),属性具体对象(接口号),内容
交换机VLAN的配置
交换机VTP的配置
1、进入全局配置模式
2、配置VTP域名
Switch-PHY-3548(config) # vtp domain pku(设置VTP域名为pku)
3、配置VTP工作模式
Switch-PHY-3548(config) # vtp mode transpareant/client/rver
(rver为缺省值)
海棠花
1、 配置VTP域名
Switch-PHY-6500>(enable) t vtp domain pku
2、 配置VTP工作模式
Switch-PHY-6500>(enable) t vtp mode rver/client/transparent/off
建立和删除VLAN
1、 进入VLAN配置模式
Switch-PHY-3548 (vlan )# vlan data
2、 建立VLAN
命令格式:
vlan <vlan ID> name <vlan_name>
Switch-PHY-3548 (vlan )# vlan 100 name vlan1000
3、 退出并返回特权用户模式
Switch-PHY-3548 (vlan )# vexit
4、 删除VLAN
Switch-PHY-3548 (vlan )# no vlan 1000
女人脚臭5、 修改VLAN
Switch-PHY-3548 (vlan )# vlan 100 name v1000
1、 建立VLAN
命令格式:
t vlan <vlan ID> name <vlan_name>
Switch-PHY-6500>(enable) t vlan 999 name vlan999
2、 删除VLAN
命令格式:
clear vlan <vlan_num>
Switch-PHY-6500>(enable) clear vlan 999
3、 修改vlan
Switch-PHY-6500>(enable) t vlan 999 name v999
为交换机端口分配vlan
1、 进入交换机端口配置模式
Switch-PHY-3548 # configure t
Switch-PHY-3548(config) # interface f0/24
2、 为端口分配VLAN
word目录怎么自动生成命令格式:
switchport access vlan <vlan-num>
Switch-PHY-3548(config-if) # switchport access vlan 248
(将端口f0/24划分在248号vlan中)
命令格式:
t vlan <vlan-num> <mod/port>
Switch-PHY-6500>(enable) t vlan 42 5/20
VLAN Trunk配置
1、进入交换机端口配置模式
Switch-PHY-3548 # configure t
Switch-PHY-3548(config) # interface f0/24
2、配置VLAN Trunk模式
Switch-PHY-3548(config-if) # switchport mode trunk.
3、 封装VLAN协议
Switch-PHY-3548(config-if) # switchport trunk encapsulation dot1q (封装IEEE 802.1Q)
Switch-PHY-3548(config-if) # switchport trunk encapsulation isl (封装ISL协议)
Switch-PHY-3548(config-if) # switchport trunk encapsulation negotiate P (自动协商)
Switch-PHY-3548(config-if) # switchport trunk allowed vlan 10,14
Switch-PHY-3548(config-if) # switchport trunk allowed vlan 10-14
Switch-PHY-3548(config-if) # switchport trunk allowed vlan except 100-1000
Switch-PHY-6500>(enable) t trunk 5/1 on dot1q
Switch-PHY-6500>(enable) t trunk 5/1 vlan 37-42
Switch-PHY-6500>(enable) clear trunk 5/24 3-36
交换机STP的配置
打开或关闭STP
命令格式:  spanning-tree vlan <vlan> (启用STP)
          no spanning-tree vlan <vlan> (关闭STP)
节礼
Switch-PHY-3548(config) # spanning-tree vlan 3
Switch-PHY-3548(config) #no spanning-tree vlan 3
命令格式:t spantree enable <vlans>(启用STP)
        t spantree disable <vlans>(关闭STP)
Switch-PHY-6500>(enable) t spantree enable 3
Switch-PHY-6500>(enable) t spantree disable 3
配置根网桥和备份根网桥
1、设置主root (first root)
命令格式:spanning-tree vlan <vlans> root primary
Switch-PHY-3548(config) # spanning-tree vlan 3 root primary
2、设置备份root(cond root)
命令格式:spanning-tree vlan <vlans> root condary
Switch-PHY-3548(config) # spanning-tree vlan 3 root condary
1、设置主root
命令格式:t spantree root <vlans>
Switch-PHY-6500>(enable) t spantree root 1,200-204宠物小知识
2、 设置备份root
命令格式:t spantree root condary <vlans>
Switch-PHY-6500>(enable) t spantree root condary 1,200-204
配置生成树优先级
命令格式:spanning-tree vlan <vlans> priority <0-61440>
Switch-PHY-3548(config) # spanning-tree vlan 3 priority 8192
命令格式:t spantree priority
<priority>
Switch-PHY-6500>(enable) t spantree priority 8192

本文发布于:2023-06-06 16:13:05,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/89/1006088.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:配置   交换机   模式   端口   进入
相关文章
留言与评论(共有 0 条评论)
   
验证码:
推荐文章
排行榜
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图