电脑技术学习

交换机配置基本使用命令解析

dn001
1、 换机基本状态
  switch:
  rommon> ROM状态,路由器也是

  hostname> 用户模式

  hostname# 特权模式
  hostname(config)# 全局配置模式
  hostname(config-if) 接口状态
  hostname(config-subif) 子接口状态

  2、 主机名设置

  hostname(config)#hostname name
  3、 配置密码

  hostname(config)#enable passWord level 1 passwor

d 设置进入用户模式密码(cata1900)


  hostname(config)#enable password level 15 password 设置进入特权模式密码(cata1900)

  hostname(config)#enable secret password 设置特权加密口令为password

  hostname(config)#enable password password 设置特权非加密口令为password


  hostname(config)#line console 0 进入控制台
  hostname(config-line)#login 答应登录
  hostname(config-line)#password XXXX 设置登录口令为XXXX

  hostname(config)#line vty 0 4 进入虚拟终端virtual tty(cata1900不用设置)

  4、 IP地址设置

  Hostname(config)#ip address ip –address subnet-mask 只在1900下可直接在全局配置模式下设IP

  Hostname(config)#int vlan 1
  Hostname(config-if)#-mask 在3550中要到vlan子模式、或在接口模式下设治理IP
  ip address ip-address subnet

  5、 缺省网关

  hostname(config)#ip defaut-gateway ip-address

  6、 接口配置

  hostname(config)#int e0/n 进入接口配置模式
  hostname(config-if)#duplex half / full 设置半双工、双工

  hostname(config-if)#description message 接口描述信息

  hostname(config-if)#trunk on/off 主干信息(只有百兆口才能配置)1900

  hostname(config-if)#switchport mode trunk 3550switch或其它中高端

  hostname(config-if)#no switchport 将一个二层端口转变成三层端口

  hostname(config-if)#switchport 将一个三层端口转变成二层端口

  注:通过no switchpor 口没什么区别,在里面,可以分配ip address 或者做访问

t 配置命令,就可以把3550中的二层端口变成和一般路由器的FE端列表的控制、QOS相关的配置等等

  hostname(config)#int
range f number 进入一组接口

  7、 配置VTP信息

  hostname(config)#vtp domain name VTP域名

  hostname(config)#vtp server/client/transparent 模式(服务器/客户端/透时域)

  hostname(config)#vtp password secret VTP密码

  hostname(config)#vtp pruning enable VTP剪除启动

  hostname(config)#vtp trap enable VTP trap 启动


  注:在3550等中高端交换机中也可在VLAN模式下进行以上配置
  hostname#vlan database
  hostname(vlan)#……

  8、 VLAN配置

  Hostname(config)valn创建VLAN

  vlan-number name vlan-name

  Hostname(config-if)vlan-member ship static vlan-number 端口分配给VLAN(1900SWITCH)

  Hostname(config-if)switchport Access vlan vlan-number 端口分配置给VLAN(3550及以上)

  Hostname(config-if)switchport trunk encapsulation cisco dot1 设置trunk封装

  Hostname(config-if)#switchport mode trunk 起主干

  hostname(config-if)#no shutdown

标签: 交换机