switch>enable switch>configure terminal swith(config)hostname cisco-sw1 cisco-sw1(config)#enable secret ciscoswitch //給交換機(jī)配置使能密碼。進(jìn)入特權(quán)模式事需要輸入密碼才能進(jìn) cisco-sw1(config)#vlan 2 cisco-sw1(config-vlan)#name test cisco-sw1(config-vlan)#exit cisco-sw1(config)#interface fastEthernet 0/1 //進(jìn)入交換機(jī)蒙一個(gè)端口 cisco-sw1(config-if)#switchport mode access cisco-sw1(config-if)#switchport access vlan 2 查看命令 #show vlan brief(查看配置情況) #show version 查看系統(tǒng)中的所有版本信息 #show running-configure查看交換機(jī)當(dāng)前起作用得配置信息。 #show interface fastethernet 0/1 查看交換機(jī)1 接口具體配置和統(tǒng)計(jì)信息 #show mac-address-table 查看mac地址轉(zhuǎn)發(fā)表。 交換機(jī)恢復(fù)出廠設(shè)置 switch>enable switch>erase startup-configure switch>#reload telnet遠(yuǎn)程登錄設(shè)置 switch>en switch>#configure terminal switch(conf)#enable password cisco 以cisco為特權(quán)模式密碼 switch(conf)#interface vlan1 以vlan1端口作為遠(yuǎn)程登錄接口,其它端口亦可。 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 設(shè)置0-4個(gè)用戶可以telnet遠(yuǎn)程登錄。 swich(conf-line)# password 123456 switch(conf-line)#login SSH遠(yuǎn)程登錄設(shè)置: Switch#conf t Enter configuration commands, one per line. End with CNTL/Z. Switch(config)#hostname cisco-sw1 交換機(jī)重新命名 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] 思科交換機(jī)常用命令及配置 |
|