Cisco接入交换机配置指南
Clean session
#Show current login usersshow users# terminal a userclear line vty 0
Set Session timeout
exec timeout command is sused to specify the timeout for exec sessions[telnet/ssh] whereas session timeout command specifies the idle timeout period for all the sessions.
config tline vty 0 15exec-timeout 10session-timeout 10#Check configuresh run | be line vty
How to fix %Error opening tftp://255.255.255.255/network-confg (Timed out)
no service config
Set ip address and default gateway
ip default-gateway 192.168.0.1interface vlan 1ip address 192.168.0.2 255.255.255.0
Set hostname and domain-name
config thostname myswitchip domain-name mydomain.com
Enable ssh login
Generate the RSA keys
myswitch(config)# crypto key generate rsa The name for the keys will be: myswitch.thegeekstuff.com 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 % Generating 1024 bit RSA keys, keys will be non-exportable...[OK]
Setup the line vty configurations
line vty 0 4session-timeout 10transport input sshlogin localpassword 7exit
Set the console line
line console 0logging synchronuslogin local
Create the username password
config tusername $USERNAME password $MYPASSWORDenable secret $MYENABLEPASSWORD
enable service password-encryption
service password-encryption
Verify SSH access
show ip ssh
Configureport-channel
interface Port-channel1 description testing switchport trunk allowed vlan 4-12 switchport trunk encapsulation dot1q switchport mode trunk# network port settingsinterface GigabitEthernet1/0/27 description lacp-wifi-network switchport trunk encapsulation dot1q switchport mode trunk channel-protocol lacp channel-group 3 mode active!interface GigabitEthernet1/0/28 description lacp-wifi-network switchport trunk encapsulation dot1q switchport mode trunk channel-protocol lacp channel-group 3 mode active!
Access mode
interface GigabitEthernet1/0/29 switchport access vlan 60 switchport mode access
SNMP
snmp-server community public RO
NTP
ntp source vlan 20ntp server 10.32.0.2 source vlan 20