Cisco switches static network config and remote access via ssh.

Creating simple static network configuration for a Cisco 2960s switch and enabling SSH remote access.

Switch#conf t
Switch(config)#interface vlan 1
Switch(config-if)#ip address 192.168.0.2 255.255.255.0
Switch(config-if)#no shutdown
Switch(config-if)#end 
Switch#copy running-config startup-config

Configure default gateway and name resolution server.

Switch#conf t
Switch(config)#ip default-gateway 192.168.0.1
Switch(config)#ip name-server 8.8.8.8
Switch(config-if)#end 
Switch#copy running-config startup-config

Configure SSH server.

Switch#conf t
Switch(config)#hostname Switch
Switch(config)#ip domain-name cisco.com
Switch(config)#crypto key generate rsa
How many bits in the modulus [512]: 1024
Switch(config)#line vty 0 4
Switch(config-line)#transport input ssh 
Switch(config-line)#login local
Switch(config-line)#end

Switch#conf t
Switch(config)#line console 0
Switch(config-line)#logging synchronous
Switch(config-line)#end

Switch#conf t
Switch(config)#aaa new-model 
Switch(config)#username user password mypassword
Switch(config)#service password-encryption
Switch(config)#ip ssh time-out 120
Switch(config)#ip ssh authentication-retries 2
Switch(config)#ip ssh version 2
Switch(config)#end

Switch#copy running-config startup-config

Show SSH configuration.

Switch#show ip ssh 

Leave a Reply