Switch基本配置

本文档详细介绍了如何配置Switch,包括将VTP设置为client模式,配置管理IP,设置网关,划分端口到VLAN,配置trunk口,设置enable和telnet密码,启用SNMP协议,以及进行其他安全和网络调整。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

VTP配置成client模式

Switch#conf t

Switch(config)#vtp mode client

Switch(config)#vtp domain GSP_COM

Switch(config)#vtp password GSP_COM

 

配置管理IP

Switch#conf t

Switch(config)#interface vlan 2

Switch(config-if)#ip address 10.128.48.190 255.255.255.0

Switch(config-if)#no sh

 

配置网关

Switch(config)#ip default-gateway 10.128.48.254

 

将端口划到Vlan

Switch(config)#interface range fastEthernet 0/1 - 23

Switch(config-if-range)#switchport access vlinexian 67

Switch(config-if-range)#spanning-tree portfast            

Switch(config-if-range)#switchport mode access

 

Fa0/24配置成trunk

Switch(config)#interface fastEthernet 0/24

Switch(config-if)#switchport mode trunk

 

配置en密码

switch#conf t

switch(config)#enable secret ******

 

配置telnet密码 VTY(virtual type terminal) 虚拟终端连接

switch#conf t

switch(config)#line vty 0 4

switch(config-line)#password ******

switch(config-line)#exit

switch(config)#service password-encryption

 

配置SNMP协议

access-list 99 permit 10.128.26.207

snmp-server community gzlis RO 99

snmp-server host 10.128.26.206 gzlis

 

更改VLAN

IMG_B2_PD_2FC_135A#conf t

Enter configuration commands, one per line.  End with CNTL/Z.

IMG_B2_PD_2FC_135A(config)#inter

IMG_B2_PD_2FC_135A(config)#interface f0/22

IMG_B2_PD_2FC_135A(config-if)#swi

IMG_B2_PD_2FC_135A(config-if)#switchport acce

IMG_B2_PD_2FC_135A(config-if)#switchport access vlan 42

IMG_B2_PD_2FC_135A(config-if)#exit

IMG_B2_PD_2FC_135A(config)#exit

IMG_B2_PD_2FC_135A#show run

Building configuration...

 

WR

配置Switch

Switch#sh vtp status => show VTP信息

VTP Version                     : 2

Configuration Revision          : 0

Maximum VLANs supported locally : 128

Number of existing VLANs        : 5

VTP Operating Mode              : Server

VTP Domain Name                 :

VTP Pruning Mode                : Disabled

VTP V2 Mode                     : Disabled

VTP Traps Generation            : Disabled

MD5 digest                      : 0x57 0xCD 0x40 0x65 0x63 0x59 0x47 0xBD

Configuration last modified by 0.0.0.0 at 0-0-00 00:00:00

Local updater ID is 0.0.0.0 (no valid interface found)

 

VTP Operating Mode:Server 改为clitent

Switch#vlan database

Switch(vlan)#vtp client ?

 

配置Domain name

Switch(vlan)#vtp domain GSP_IMG

 

配置VTP Password

 

Switch(vlan)#vtp password =>password 要和domain 名字一样。GSP_IMG

保存wr

 

config vlan

Switch#configure terminal

Switch(config)#interface vlan 2 =>进入管理vlan

Switch(config-if)#ip address 10.128.16.228 255.255.255.0 =>配置vlan ip

Switch(config-if)#no shutdown

 

配置default-gateway

Switch(config)#ip default-gateway 10.128.16.254

 

port划到vlan

Switch(config)#interface f0/1 (单个端口)

Switch(config)#interface range fastEthernet 0/1 - 23

Switch(config-if-range)#switchport access vlan 35 =>1-23port划到vlan 35

 

24 porttrunk

Switch(config)#interface fastEthernet 0/24

Switch(config-if)#switchport mode trunk

Switch(config-if)#switchport trunk encapsulation dot

 

配置快速发送

conf t 到相应端品

Switch(config-if)#spanning-tree portfast

 

配置端品为数据模式

conf t 到相应端口

Switch(config-if)#switchport mode access

 

配置en密码及telnet密码

switch(config)#enable secret **** =>*号为密码

switch#conf t

switch(config)#line vty 0 4

switch(config-line)#password **** =>*号为密码

switch(config-line)#exit

switch(config)#service password-encryption

cisco 2960 login指令

 

清除交换机配置

switch#erase startup-config

 

 

清除vlan信息

switch#delete vlan.dat

switch#reload

 

清除log

switch#clear logging

 

配置SNMP通过HostMonitor监视Switch

access-list 99 permit 10.128.26.207

snmp-server community gzlis RO 99

snmp-server host 10.128.26.206 gzlis

 

端品监听

interface FastEthernet0/42        =>接的是DNS Server安装Sniffer

 description to DNS:192.168.20.5

 port monitor FastEthernet0/1     =>fa0/1接的是interjak

 switchport access vlan 20

 spanning-tree portfast

fa0/42监听fa0/1

 

支持中继上的所有VLAN

switch(config-if)#switchport trunk allowed vlan all

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值