Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1630523
  • 博文数量: 135
  • 博客积分: 2820
  • 博客等级: 少校
  • 技术积分: 2544
  • 用 户 组: 普通用户
  • 注册时间: 2010-09-16 13:33
文章分类

全部博文(135)

文章存档

2015年(1)

2014年(8)

2013年(16)

2012年(43)

2011年(56)

2010年(11)

分类: 系统运维

2013-04-17 15:21:05

通过Telnet访问
1、配置管理VLAN接口的IP地址(ip address命令)
2、指定与终端相连的以太网端口属于该VLAN(VLAN模式下使用switchport命令)
3、配置登录Telnet用户授权验证
switch> enable
Password:
switch# configure terminal
Enter configuration commands, one per line. End with Ctrl+Z.
switch (config)# line vty 0 4
switch (config-line)# password xxxx(xxxx是Telnet用户登录口令)
switch (config-line)# exit
switch (config)# enable password xxxx(xxxx特权用户模式的口令)
4、运行Telnet程序与以太网交换机建立Telnet连接

设置交换机名字
switch(config)#hostname ASB-3750-a
ASB-3750-a(config)#

设置交换机管理IP地址
switch(config)#interface vlan1
switch(config)#ip address 10.1.1.1 255.255.255.0
switch(config-if)#no shutdown
switch(config-if)#exit
switch#show run
…..
interface Vlan1
ip address 139.118.4.2 255.255.252.0
….
//配置交换机的缺省网关,三层用不配.
switch(config)#ip default-gateway 10.1.1.255

设置交换机时间信息
switch#show clock
* 18:37:04.104 UTC Mon Jul 30 2008
switch# clock set 9:00:00 Jan 1 2001
switch#show clock
09:00:04.123 UTC Mon Jan 1 2008

设置交换机的密码
# 使用secret口令,不使用password口令
switch(config)# enable secret ASB
switch(config)#exit
switch#show running-config
……….
Enable secret 5 $1228899030dieiiop
……….
#同样配置telnet和console的口令,并加密(service password-encryption).
switch(config)# service password-encryption
switch(config)#line console 0
switch(config-line)#password xxxxxx
switch(config-line)#line vty 0 4
switch(config-line)#password yyyyyy
switch(config-line)#login
switch(cnfig-line)#end

设置交换机的日志信息
输出 : 分为Console、Telnet、Buffer、Host四个方向。
?日志等级分为8级,0级最高.使用logging buffer level 修改记录等级。
emergency 0 紧急:系统不可用
alert 1 告警:需要立即行动
critical 2 关键:关键状态
error 3 错误:错误状态
warning 4 警告:警告状态
notification 5 通知:正常但重要状态
informational 6 信息:仅是信息消息
debug 7 调试:调试消息

switch(config)#logging buffered //把日志记录到buffer中的配置命令.
switch(config)#logging buffered informational //等级为6,informational
switchr(config)#show logging //显示buffer中的logging信息.
switch(config)# service timestamps log datetime //给日志信息打时间标记

设置交换机的snmp信息
switch(config)# access-list 10 permit 172.18.129.100 log
//配置snmp访问控制列表
switch(config)# snmp-server community ********** RW 10
//配置读写字符串
switch(config)# snmp-server trap-source Vlan1000
//配置trap的源地址
switch(config)# snmp-server host 172.18.129.100 **********
//配置接收trap的主机地址及特定字符串

打开/关闭以太网端口
Switch(config)#interface fastethernet 0/1
Switch(config-if)#shutdown //关闭端口
Switch(config)#interface fastethernet 0/1
Switch(config-if))#no shutdown //打开端口

//缺省状态下,端口是关闭的

设置以太网端口的描述
# 描述命令说明了以太网端口的作用.
Switch(config)#interface fastethernet 0/1
Switch(config-if)#description : connected to CC1

设置以太网端口的双工状态
Switch(config)#interface fastethernet 0/1
Switch(config-if)# duplex { half | full | auto }
//其中half为半双工,full为全双工,auto为自动协商

设置以太网端口的速率
Switch(config)#interface fastethernet 0/1
Switch(config-if)# speed { 10 | 100 | 1000 | auto}
//其中10为10M,100为100M,1000为1000M,auto为自动协商。

Switch(config-if)#no speed
//恢复端口缺省速率配置。

设置以太网端口的工作模式
// 指明端口工作在access模式下
Switch(config-if)#switchport mode access
//指明端口工作在trunk模式下
Switch(config-if)#switchport mode trunk

说明 :
0、以太网端口有二种工作模式:Access和Trunk。
1、端口工作在Access模式下只能属于1个VLAN,一般用于接用户计算机的端口;
2、端口工作在Trunk模式下可以属于多个VLAN,可以接收和发送多个VLAN的报文,一般用于交换机之间连接的端口;
3、可以使用switchport access vlan vlan_number指明端口属于什么vlan。


转自:

阅读(4282) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~