分类: 系统运维
2010-06-02 10:08:55
新设备配置内容:
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
1. linux 命令:
PCA login: root ;使用root用户 password: linux ;口令是linux # shutdown -h now ;同init 0 关机 # logout # login # ifconfig ;显示IP地址 # ifconfig eth0 # ifconfig eht0 # route add 0.0.0.0 gw # route del 0.0.0.0 gw # route add default gw # route del default gw # route ;显示网关 # ping # telnet 2. 交换机支持的命令: 交换机基本状态: switch: ;交换机的ROM状态 rommon> ;路由器的ROM状态 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 switch(config)#vtp password 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 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 ;查看指定端口信息 3. 路由器支持的命令: 路由器显示命令: router#show run ;显示配置信息 router#show interface ;显示接口信息 router#show ip route ;显示路由信息 router#show cdp nei ;显示邻居信息 router#reload ;重新起动 路由器口令设置: router>enable ;进入特权模式 router#config terminal ;进入全局配置模式 router(config)#hostname router(config)#enable secret xxx ;设置特权加密口令 router(config)#enable password xxb ;设置特权非密口令 router(config)#line console 0 ;进入控制台口 router(config-line)#line vty 0 4 ;进入虚拟终端 router(config-line)#login ;要求口令验证 router(config-line)#password xx ;设置登录口令xx router(config)#(Ctrl+z) ; 返回特权模式 router#exit ;返回命令 路由器配置: router(config)#int s0/0 ;进入Serail接口 router(config-if)#no shutdown ;激活当前接口 router(config-if)#clock rate 64000 ;设置同步时钟 router(config-if)#ip address router(config-if)#ip address router(config-if)#int f0/0.1 ;进入子接口 router(config-***if.1)#ip address router(config-***if.1)#encapsulation dot1q router(config)#config-register 0x2142 ;跳过配置文件 router(config)#config-register 0x2102 ;正常使用配置文件 router#reload ;重新引导 路由器文件操作: router#copy running-config startup-config ;保存配置 router#copy running-config tftp ;保存配置到tftp router#copy startup-config tftp ;开机配置存到tftp router#copy tftp flash: ;下传文件到flash router#copy tftp startup-config ;下载配置文件 ROM状态: Ctrl+Break ;进入ROM监控状态 rommon>confreg 0x2142 ;跳过配置文件 rommon>confreg 0x2102 ;恢复配置文件 rommon>reset ;重新引导 rommon>copy xmodem: Cisco 2960设置管理地址问题
我这里有个2960,准备配置管理地址,配置应该没有问题,可是就是无法连通,在此台2960上也无法Ping通网关,相关配置如下 interface GigabitEthernet0/2 switchport mode trunk spanning-tree link-type point-to-point interface Vlan241 ip address 192.168.241.53 255.255.255.0 no ip redirects no ip unreachables no ip proxy-arp no ip route-cache ! ip default-gateway 192.168.241.1 交换机工作正常,但是使用Show inter vlan241,发现接口处于Down状态,使用No shutdown 命令也没有用,不知道怎么回事情?是不是和VTP有关?谢谢! 网友1; 方法两个: 1、把你见vlan号给删除,给vlan1配置ip地址 2、修改你配置vlan的native vlan 网友2: cisco的vlan1默认为管理vlan,只要给它配各地址就行了 网友3: 1.show vlan看本交换机有没有VLAN241 如果没有可以手工添加上去 或者启用VTP学习 2.show int g0/2 trunk信息 网友4: 1、show vlan brief 看一下有没有这个vlan 2、如果数据vlan和管理vlan分开,看看上联的trunk起来没有 网友5: 29交换机管理VLAN默认就是VLAN1,你的问题有两种方法: 1、取消VLAN241的IP地址 interface vlan 1 ip add 192.168.241.53 255.255.255.0 2、是将VLAN241设置成管理VLAN interface vlan 241 ip add 192.168.241.53 255.255.255.0 management-----------是将该VLAN设置成管理VLAN 你任选一种就可以的 ********************************************
思科2960交换机配置命令交换机基本状态: 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 ;查看指定端口信息 |