switch>enable switch>configure terminal swith(config)hostname cisco-sw1 cisco-sw1(config)#enable secret ciscoswitch //給交換機配置使能密碼。進入特權模式事需要輸入密碼才能進 cisco-sw1(config)#vlan 2 cisco-sw1(config-vlan)#name test cisco-sw1(config-vlan)#exit cisco-sw1(config)#interface fastEthernet 0/1 //進入交換機蒙一個端口 cisco-sw1(config-if)#switchport mode access cisco-sw1(config-if)#switchport access vlan 2 查看命令 #show vlan brief(查看配置情況) #show version 查看系統中的所有版本信息 #show running-configure查看交換機當前起作用得配置信息。 #show interface fastethernet 0/1 查看交換機1 接口具體配置和統計信息 #show mac-address-table 查看mac地址轉發表。 交換機恢復出廠設置 switch>enable switch>erase startup-configure switch>#reload telnet遠程登錄設置 switch>en switch>#configure terminal switch(conf)#enable password cisco 以cisco為特權模式密碼 switch(conf)#interface vlan1 以vlan1端口作為遠程登錄接口,其它端口亦可。 switch(conf)#ip address 192.168.1.1 255.255.255.0 swich(conf-if)#no shut swich(conf-if)#exit switch(conf)#line vty 0 4 設置0-4個用戶可以telnet遠程登錄。 swich(conf-line)# password 123456 switch(conf-line)#login SSH遠程登錄設置: Switch#conf t Enter configuration commands, one per line. End with CNTL/Z. Switch(config)#hostname cisco-sw1 交換機重新命名 cisco-sw1(config)#ip domain-name 配置域名 cisco-sw1(config)#line vty 0 4 cisco-sw1(config-line)#transport input ssh 登錄方式為SSH cisco-sw1(config-line)#exit cisco-sw1(config)#crypto key generate rsa 配置秘鑰 The name for the keys will be: cisco-sw1. Choose the size of the key modulus in the range of 360 to 2048 for your General Purpose Keys. Choosing a key modulus greater than 512 may take a few minutes. How many bits in the modulus [512]: 1024 思科推薦使用1024 % Generating 1024 bit RSA keys, keys will be non-exportable...[OK] 思科交換機常用命令及配置 |
|