肥仔教程网

SEO 优化与 Web 开发技术学习分享平台

Cisco 交换机的配置命令_cisco的交换机配置ip地址的命令

//进入特权模式
Switch>en
//进入全局配置模式
Switch#config t
Enter configuration commands, one per line. End with CNTL/Z.
//设置主机名
Switch(config)#hostname SA
//进入接口
SA(config)#int f0/1
//配置交换机模型
SA(config-if)#switchport mode trunk
SA(config-if)#int f0/4
SA(config-if)#switchport mode trunk
SA(config-if)#^Z
%SYS-5-CONFIG_I: Configured from console by console
//设置交换机vlan为服务器或客户端
SA#vlan d
SA#vlan database
% Warning: It is recommended to configure VLAN from config mode,
as VLAN database mode is being deprecated. Please consult user
documentation for configuring VTP/VLAN in config mode.
SA(vlan)#vtp server
Device mode already VTP SERVER.
SA(vlan)#vtp domain test1
Changing VTP domain name from NULL to test1
SA(vlan)#^Z
%SYS-5-CONFIG_I: Configured from console by console
SA#config t
Enter configuration commands, one per line. End with CNTL/Z.
SA(config)#int f0/2
SA(config-if)#switchport access vlan 20
% Access VLAN does not exist. Creating vlan 20
SA(config-if)#int f0/3
SA(config-if)#switchport access vlan 20
SA(config-if)#int f0/6
SA(config-if)#switchport access vlan 30
% Access VLAN does not exist. Creating vlan 30
SA(config-if)#int f0/7
SA(config-if)#switchport access vlan 40
% Access VLAN does not exist. Creating vlan 40
SA(config-if)#int f0/8
SA(config-if)#switchport access vlan 40
SA(config-if)#^Z
%SYS-5-CONFIG_I: Configured from console by console
SA#config t
Enter configuration commands, one per line. End with CNTL/Z.
SA(config)#int vlan 2
SA(config-if)#ip add 192.168.0.113 255.255.255.240
SA(config-if)#no shut

  1. 基础配置进入特权模式(enable)进入全局配置模式(configure terminal)设置主机名为 SA(hostname SA)
  2. 接口配置将 f0/1 和 f0/4 接口配置为 trunk 模式(switchport mode trunk)
  3. VTP 和 VLAN 配置进入 VLAN 数据库模式(vlan database)设置为 VTP 服务器模式(vtp server)设置 VTP 域名为 test1(vtp domain test1)
  4. 接入端口配置将 f0/2 和 f0/3 接口分配到 VLAN 20(自动创建 VLAN 20)将 f0/6 接口分配到 VLAN 30(自动创建 VLAN 30)将 f0/7 和 f0/8 接口分配到 VLAN 40(自动创建 VLAN 40)
  5. VLAN 接口配置为 VLAN 2 配置 IP 地址 192.168.0.113/28启用该 VLAN 接口(no shutdown)
控制面板
您好,欢迎到访网站!
  查看权限
网站分类
最新留言