资源描述
cisco2960配置
cisco2960配置
编辑整理:
尊敬的读者朋友们:
这里是精品文档编辑中心,本文档内容是由我和我的同事精心编辑整理后发布的,发布之前我们对文中内容进行仔细校对,但是难免会有疏漏的地方,但是任然希望(cisco2960配置)的内容能够给您的工作和学习带来便利。同时也真诚的希望收到您的建议和反馈,这将是我们进步的源泉,前进的动力。
本文可编辑可修改,如果觉得对您有帮助请收藏以便随时查阅,最后祝您生活愉快 业绩进步,以下为cisco2960配置的全部内容。
cisco2960G交换机 简单配置http://img。 t ”_blank
2950是只支持二层的交换机
支持VLAN
第1步:单击“开始”按钮,在“程序”菜单的“附件”选项中单击“超级终端”
第2步:在“名称”文本框中键入“Cisco”
第3步:在“连接时使用”下拉列表框中选择与交换机相连的计算机的串口。台式机为“com 1”,笔记本为“com 3或者com 5”。
第4步:在“波特率”下拉列表框中选择“9600”-确定.
如果通信正常的话就会出现类似于如下所示的主配置界面,并会在这个窗口中就会显示交换机的初始配置情况。
enter
enter
enter
no!
1)配置交换机姓名
switch〉ena
switch#configure
enter
switch#configure terminal (进入配置状态)
Switch(config)#hostname 配置的交换机姓名 如:30FLoor—2960-1
30FLoor-2960-1(config)#end
30FLoor-2960—1#
2)配置交换机的ip
30FLoor-2960-1#configure terminal (进入配置状态)
30FLoor—2960—1(config)#interface vlan 1
30FLoor—2960—1(config)#ip address ip地址 子网掩码
例如:30FLoor—2960—1(config)#ip address 10。11.90.10 255.255。255。0
30FLoor—2960—1(config)#no shutdown
30FLoor—2960-1(config)#end
30FLoor-2960-1#
30FLoor—2960—1#
3)配置交换机的 默认网关
30FLoor—2960-1(config)#ip default-gateway 网关ip
例如:30FLoor—2960—1(config)#ip default—gateway 10.11。90.254
4)设置路由
30FLoor—2960-1(config)#ip route 0。0.0.0 X.X.X.X
5)设置console口密码
30FLoor—2960-1(config)#line console 0
30FLoor—2960—1(config-line)#password 输入密码
30FLoor-2960-1(config-line)#login
30FLoor-2960—1(config-line)#end
6)设置telnet的密码
30FLoor—2960-1(config)#line vty 0 10
30FLoor—2960-1(config—line)#password 输入密码(yuxuan)
30FLoor-2960-1(config-line)#login
30FLoor-2960-1(config—line)#end
7)设置交换机的enable密码
30FLoor-2960—1(config)#enable password 输入密码(xuan)
30FLoor—2960—1(config)#enable secret 输入密码(yuxuan)
30FLoor—2960-1(config)#end
8)将当前配置信息保存到闪存中
30FLoor—2960-1(config)#write
9)查看交换机信息
30FLoor—2960-1#
show version 查看交换机版本信息
show ip interfaces 查看交换机的ip地址
show interface vlan 1 验证管理ip地址已经配置并开启
show ip redirect 查看交换机的网关
show running-configure 查看交换机当前的配置信息
show configure 查看交换机保存的配置信息
switch#write ; 保存配置信息
switch#show vtp ; 查看vtp配置信息
switch#show run ; 查看当前配置信息
switch#show vlan ; 查看vlan配置信息
switch#show interface ; 查看端口信息
switch#show int f0/0 ; 查看指定端口信息
10)交换机基本配置步骤
1.登陆到交换机
2.进入特权模式
命令:enable
3。进入全局配置模式
命令:configure terminal
4。进入相应的配置子模式
如:接口子模式
命令:interface vlan 1
交换机基本状态:
switch: ;ROM状态, 路由器是rommon〉
hostname> ;用户模式
hostname# ;特权模式
hostname(config)# ;全局配置模式
hostname(config-if)# ;接口状态
交换机口令设置:
switch〉enable ;进入特权模式
switch#config terminal ;进入全局配置模式
switch(config)#hostname ;设置交换机的主机名
switch(config)#enable secret xxx ;设置特权加密口令
switch(config)#enable password xxa ;设置特权非密口令
switch(config)#line console 0 ;进入控制台口
switch(config-line)#line vty 0 4 ;进入虚拟终端
switch(config-line)#login ;允许登录
switch(config—line)#password xx ;设置登录口令xx
switch#exit ;返回命令
交换机VLAN设置:
switch#vlan database ;进入VLAN设置
switch(vlan)#vlan 2 ;建VLAN 2
switch(vlan)#no vlan 2 ;删vlan 2
switch(config)#int f0/1 ;进入端口1
switch(config—if)#switchport access vlan 2 ;当前端口加入vlan 2
switch(config-if)#switchport mode trunk ;设置为干线
switch(config-if)#switchport trunk allowed vlan 1,2 ;设置允许的vlan
switch(config-if)#switchport trunk encap dot1q ;设置vlan 中继
switch(config)#vtp domain ;设置发vtp域名
switch(config)#vtp password ;设置发vtp密码
switch(config)#vtp mode server ;设置发vtp模式
switch(config)#vtp mode client ;设置发vtp模式
交换机设置IP地址:
switch(config)#interface vlan 1 ;进入vlan 1
switch(config—if)#ip address ;设置IP地址
switch(config)#ip default-gateway ;设置默认网关
switch#dir flash: ;查看闪存
交换机显示命令:
switch#write ;保存配置信息
switch#show vtp ;查看vtp配置信息
switch#show run ;查看当前配置信息
switch#show vlan ;查看vlan配置信息
switch#show interface ;查看端口信息
switch#show int f0/0 ;查看指定端口信息
思科2950交换机VLAN划分
cisco
首先配置一下交换机
SC—2950>
SC—2950>en
SC—2950#conf t
Enter configuration commands, one per line。 End with CNTL/Z。
SC-2950(config)#config-register 0x2102
SC-2950(config)#end
添加三个VLAN
SC-2950#vlan data
SC-2950(vlan)#vlan 10 name v1
VLAN 10 added:
Name: v1
SC-2950(vlan)#vlan 20 name v2
VLAN 20 added:
Name: v2
SC—2950(vlan)#vlan 30 name v3
VLAN 30 added:
Name: v3
SC-2950(vlan)#exit
APPLY completed.
Exiting。。。.
SC-2950#
划分接口到各个VLAN
SC-2950#conf t
Enter configuration commands, one per line。 End with CNTL/Z。
SC-2950(config)#int fa0/1 //留给管理员
SC—2950(config-if)#switchport mode access
SC—2950(config—if)#sw acc vlan 10
SC—2950(config—if)#no shutdown
SC-2950(config-if)#exit
SC-2950(config)#int range f0/2 - 15
SC-2950(config-if—range)#sw mode acc
SC-2950(config—if-range)#sw acc vlan 20
SC—2950(config-if-range)#no sh
SC—2950(config—if—range)#exit
SC-2950(config)#int range f0/16 - 24
SC—2950(config—if—range)#sw mode acc
SC-2950(config—if—range)#sw acc vlan 30
SC—2950(config—if—range)#no sh
SC—2950(config-if—range)#exit
激活VLAN,并且给VLAN 10加个IP以便管理
SC—2950(config)#int vlan 10
SC—2950(config—if)#ip add 192。168。1。1 255。255。255。0
SC—2950(config—if)#no sh
SC-2950(config—if)#exit
SC-2950(config)#int vlan 20
SC—2950(config-if)#no sh
SC-2950(config-if)#exit
SC—2950(config)#int vlan 30
SC—2950(config-if)#no sh
SC-2950(config-if)#exit
将交换机指向网关
SC—2950(config)#ip default—gateway 192。168。1。254
SC—2950(config)#end
SC-2950#
检测配置
SC—2950#sh vlan brief
VLAN Name Status Ports
——-- ———-------————-—-———--———-—-———— —---—-—-— ---———---——-—---————--—--——--—-
1 default active
10 v1 active Fa0/1
20 v2 active Fa0/2, Fa0/3, Fa0/4,Fa0/5
Fa0/6, Fa0/7, Fa0/8,Fa0/9
Fa0/10, Fa0/11, Fa0/12,Fa0/13
Fa0/14, Fa0/15
30 v3 active Fa0/16, Fa0/17, Fa0/18, Fa0/19
Fa0/20, Fa0/21, Fa0/22, Fa0/23
Fa0/24
SC—2950#sh ip int b
Interface IP—Address OK? Method Status Prot
ocol
FastEthernet0/23 unassigned YES unset up down
FastEthernet0/24 unassigned YES unset up down
Vlan1 unassigned YES unset up down
Vlan10 192。168.1.1 YES manual up up
Vlan20 unassigned YES unset up up
Vlan30 unassigned YES unset up down
SC-2950#sh run
Building configuration.。.
Current configuration : 1482 bytes
。.。
!
interface FastEthernet0/24
switchport access vlan 30
!
interface Vlan1
no ip address
!
interface Vlan10
ip address 192。168。1.1 255。255。255。0
!
interface Vlan20
no ip address
!
interface Vlan30
no ip address
!
ip default-gateway 192。168.1.254
ip http server
!
。..
保存配置
SC-2950#write
Building configuration..。
[OK]
cisco 2960 交换机 安装配置基础
新设备配置内容:
1。 interface vlan 1 的ip,gateway
conf t
int vlan 1
ip address xx.xx。xx。xx 255。255。255。0
ip default—gateway ip—address
no shutdown
exit
2。en的密码
3。line vty 0-4 telnet的密码
4.wr存盘
show interface vlan 1
show run
将F0/1—10端口加入到VLAN20中,对应以下命令
interface range f0/1 -10
switchport mode acccess
switchport access vlan 20
注意,f0/1后面有个空格,然后才是-10
cisco 2950 常用配置命令
产品相关命令
1、配置IP地址
交换机要能够被网管,必须给它标识一个管理IP地址,默认情况下CISCO交换机的VLAN 1为管理VLAN,为该VLAN配上IP 地址,交换机就可以被网管了。命令如下:
a、进入全局模式: Switch#configure terminal
b、进入VLAN 1接口模式:Switch(config)#interface vlan 1
c、配置管理IP地址:Switch(config—if) # ip address [A.B.C。D] [mask]
如果当前VLAN 不是管理VLAN ,只需要将上面第b处命令的vlan的号码换成管理VLAN的号码即可。
2、打开SNMP协议
a、进入全局模式: Switch#configure terminal
b、配置只读的Community,产品默认的只读Community名为public
Switch(config)#snmp-server community public ro
c、配置可写的Community,产品默认的可写Community名为private
Switch(config)#snmp-server community private rw
3、更改SNMP的Community密码
a、将设备分组,并使能支持的各种SNMP版本
Switch(config)#snmp—server group qycx123 v1
Switch(config)#snmp-server group qycx 123 v2c
Switch(config)#snmp—server group qycx123 v3 noauth
b、分别配置只读和可写community 如:
Switch(config)#snmp-server community qycx123 ro
Switch(config)#snmp—server community qycx123 rw
4、保存交换机配置
Switch#copy run start
常用命令
1、设置交换机密码
a、更改远程TELNNET密码
Switch#configure terminal
Switch(config)#line vty 0 4
Switch(config-line)#password qycx123
Switch(config-line)#login
Switch(config-line)#exit
b、更改进入全局配置模式时的密码
Switch#configure terminal
Switch(config)#enable secret qycx123
2、创建并划分VLAN
a、创建VLAN
Switch#vlan database
Switch(vlan)#vlan 99 name office
(创建vlan 99 并命名为office)
b、将端口划分至vlan
Switch(config)#interface fastEthernet 0/8
Switch(config—if)#switchport mode access
Switch(config—if)#switchport access vlan 99
(将8号快速以太口划分至vlan 99)
3、常用调试命令
a、显示所有配置命令:Switch#show run
b、显示所有接口状态:Switch#show ip int brief
c、显示所有VLAN的信息:Switch#show vlan brief
Cisco之line vty线路使用
2007—12-08 13:11
Cisco的设备管理有很多种方式,如Console、HTTP、TTY、VTY或其它网管软件,但我们远程管理较为常用的一种方式肯定是VTY方式.
VTY在Cisco的不同系列产品中,都有一定数量的VTY线路可用,但具体数目则不尽相同。有些路由器交换机产品只有五条线路可用(line vty 0 4),有些交换机路由器设备则提供了十多条,甚至达一千多条,但默认情况下不一定全部启用.如果您想看一下自己的设备具体支持多少条线路,只需在全局模式下使用命令show line ; show line vty 0 ?即可查看该设备支持多少条线路。
VTY线路的启用/关闭:
VTY线路的启用只能按顺序进行,你不可能启用line vty 10,而不启用line vty 9。如果想启用line vty 9,那么你可以在全局模式(或line模式)下输入命令line vty 9 ,如:
(config)#line vty 9
这样系统会自动启用前面的0—8线路.当然也可以直接输入line vty 0 9直接启用10条线路。
如果不想开启这么多条线路供用户使用,那么只须在全局模式下使用no line vty m [n]命令就可以关闭第m后的线路,此时n这个数值可有可无,因为系统只允许开启连续的线路号,取消第m号线路会自动取消其后的所有线路。
VTY线路的协议选用:
VTY线路支持多种协议:
acercon Remote console for ACE-based blade
lat DEC LAT protocol
mop DEC MOP Remote Console Protocol
nasi NASI protocol
pad X。3 PAD
rlogin Unix rlogin protocol
ssh TCP/IP SSH protocol
telnet TCP/IP Telnet protocol
udptn UDPTN async via UDP protocol
在某一个接口上使用什么协议可以使用命令:transport {input|ouput}来进行定义:
(config)#line vty 0
(config-line)#transport ? //查看支持哪种方式的协议定义
input Define which protocols to use when connecting to the terminal server
output Define which protocols to use for outgoing connections
preferred Specify the preferred protocol to use
(config—line)#transport input ? //查看在输入方向上支持的协议
acercon Remote console for ACE-based blade
all All protocols
lat DEC LAT protocol
mop DEC MOP Remote Console Protocol
nasi NASI protocol
none No protocols
pad X。3 PAD
rlogin Unix rlogin protocol
ssh TCP/IP SSH protocol
telnet TCP/IP Telnet protocol
udptn UDPTN async via UDP protocol
(config—line)#transport output ? //查看在输出方向上支持的协议
acercon Remote console for ACE-based blade
all All protocols
lat DEC LAT protocol
mop DEC MOP Remote Console Protocol
nasi NASI protocol
none No protocols
pad X。3 PAD
rlogin Unix rlogin protocol
ssh TCP/IP SSH protocol
telnet TCP/IP Telnet protocol
udptn UDPTN async via UDP protocol
(config—line)#transport preferred //定义协议的优先次序
查看某一线路当前支持的协议可以使用命令show line vty m:
#show line vty 9
Tty Typ Tx/Rx A Modem Roty AccO AccI Uses Noise Overruns Int
10 VTY — — - — — 0 0 0/0 -
Line 10, Location: ”", Type: "”
Length: 24 lines, Width: 80 columns
Baud rate (TX/RX) is 9600/9600
Status: No Exit Banner
Capabilities: none
Modem state: Idle
Group codes: 0
Special Chars: Escape Hold Stop Start Disconnect Activation
^^x none — - none
Timeouts: Idle EXEC Idle Session Modem Answer Session Dispatch
00:10:00 never none not set
Idle Session Disconnect Warning
never
Login—sequence User Response
00:00:30
Autoselect Initial Wait
not set
Modem type is unknown。
Session limit is not set。
Time since activation: never
Editing is enabled。
History is enabled, history size is 10。
DNS resolution in show commands is enabled
Full user help is disabled
Allowed input transports are lat pad mop telnet rlogin ssh nasi。
Allowed output transports are lat pad mop telnet rlogin ssh nasi.
Preferred transport is lat。
No output characters are padded
No special data dispatching characters
VTY线路的使用:
VTY线路启用后,并不能直接使用,必须对其进行下面简单的配置才允许用户进行登录。
1、配置登录密码
如果想成功登录到设备,必须在line线路下使用命令password来定义登录密码,否则无法成功登录(注:如果全局已经启用了相关认证如AAA,则在此不必配置密码)
注意:在此你配置的密码是保存在配置文件中的,即使你启用service password—encryption功能,它加密的方式也是一种可逆的加密,很容易破解,所以在使用过程中尽可能配置一个不同于特权模式中的密码。
2、登录验证
默认情况下,在line vty线路中,默认情况下使用的是系统默认的登录方式(要看你是否在全局启用了AAA等),如果你需要在登录时指定认证模式,你可以使用login authentication命令进行指定.如果你想在登录时不需要用户输入密码,则可以使用no lgoin命令进行指定(当然这很危险)
特权模式的使用:
通过VTY线路登录后,会进入用户模式,如果你需要进行特权模式,那么你必须配置登录特权模式的认证。
使用案例:
不同的线路上,可以配置不同的协议,如在line vty 0上配置telnet,在line vty 1上配置ssh,这样当SSH用户登录时,系统会让line vty 0空闲,而使用line vty 1进行连接。
应用:在line vty 0-1上配置使用telnet协议,使用动态访问列表,在网络中进行严格的控制,以便只有网络管理人员才可以使用特殊通信;在2-10上配置SSH协议,用来进行设备管理。
Cisco 2960交换机中如何绑定IP与MAC地址
请问:在2960交换机中如何进行端口MAC地址绑定,并同时绑定IP与MAC地址?
网友1:
conf t
arp 192.168。1。1 0000.1001.2200 arpa fa0/1
网友2:
IP地址与MAC地址的关系: IP地址是根据现在的IPv4标准指定的,不受硬件限制长度4个字节。而 MAC地址却是用网卡的物理地址,保存在网卡的EPROM里面,与硬件有关系,长度为6个字节。
在交换式网络中,交换机维护一张MAC地址表,并根据MAC地址,将数据发送至目的计算机。 为什么要绑定MAC与IP 地址:IP地址的修改非常容易,而MAC地址存储在网卡的EEPROM中,而且网卡的MAC地址是唯一确定的.因此,为了防止内部人员进行非法IP盗用 (例如盗用权限更高人员的IP地址,以获得权限外的信息),可以将内部网络的IP地址与MAC地址绑定,盗用者即使修改了IP地址,也因MAC地址不匹配而盗用失败:而且由于网卡MAC地址的唯一确定性,可以根据MAC地址查出使用该MAC地址的网卡,进而查出非法盗用者。
在Cisco中有以下三种方案可供选择,方案1和方案2实现的功能是一样的,即在具体的交换机端口上绑定特定的主机的MAC地址(网卡硬件地址),方案3是在具体的交换机端口上同时绑定特定的主机的MAC地址(网卡硬件地址)和IP地址。
1.方案1-—基于端口的M
展开阅读全文