Networking
Router# auto secureEncrypt passwords
R1(config)# service password-encryptionSet a minimum password length
R1(config)# security passwords min-length 8Limit failed login attempts
R1(config)# login block-for 120 attempts 3 within 60Configure password on VTY lines
R1(config)# line vty 0 4
R1(config-line)# password cisco123cisco123.Set exec-timeout for idle VTY sessions
R1(config-line)# exec-timeout 5 30Restrict VTY access to SSH only
R1(config-line)# transport input sshSummary:
R1(config)# service password-encryption
R1(config)# security passwords min-length 8
R1(config)# login block-for 120 attempts 3 within 60
R1(config)# line vty 0 4
R1(config-line)# password cisco123
R1(config-line)# exec-timeout 5 30
R1(config-line)# transport input ssh
R1(config-line)# end
R1#
R1# show running-config | section line vty
line vty 0 4
password 7 094F471A1A0A
exec-timeout 5 30
login
transport input ssh
R1#Enter global configuration mode
Router# configure terminalSet the router's hostname
Router(config)# hostname R1R1.Set the domain name
R1(config)# ip domain name span.comspan.com, necessary for generating an SSH key pair.Generate the RSA key pair for SSH
R1(config)# crypto key generate rsa general-keys modulus 1024Create a local user with a password
R1(config)# username Bob secret ciscoBob with the password cisco. The secret keyword encrypts the password.Enter configuration mode for VTY lines
R1(config)# line vty 0 4Enable local authentication for VTY lines
R1(config-line)# login localEnable SSH for VTY lines and disable Telnet
R1(config-line)# transport input sshExit VTY configuration mode
R1(config-line)# exitReturn to global configuration mode
R1(config)#Summary:
Router# configure terminal
Router(config)# hostname R1
R1(config)# ip domain name span.com
R1(config)# crypto key generate rsa general-keys modulus 1024
The name for the keys will be: Rl.span.com % The key modulus size is 1024 bits
% Generating 1024 bit RSA keys, keys will be non-exportable...[OK]
Dec 13 16:19:12.079: %SSH-5-ENABLED: SSH 1.99 has been enabled
R1(config)#
R1(config)# username Bob secret cisco
R1(config)# line vty 0 4
R1(config-line)# login local
R1(config-line)# transport input ssh
R1(config-line)# exit
R1(config)#Here’s each command with its explanation:
# Show all active ports on the router
show ip ports all# Show open ports on the control-plane
show control-plane host open-ports# Enter global configuration mode
configure terminal# Disable the HTTP server
no ip http server# Configure virtual terminal (VTY) lines 0-15
line vty 0 15# Allow only SSH for remote access
transport input sshSummary:
Router# show ip ports all
Proto Local Address Foreign Address State PID/Program Name
TCB Local Address Foreign Address (state)
tcp :::443 :::* LISTEN 309/[IOS]HTTP CORE
tcp *:443 *:* LISTEN 309/[IOS]HTTP CORE
udp *:67 0.0.0.0:0 387/[IOS]DHCPD Receive
Router#Router# show control-plane host open-ports
Active internet connections (servers and established)
Prot Local Address Foreign Address Service State
tcp *:23 *:0 Telnet LISTEN
tcp *:80 *:0 HTTP CORE LISTEN
udp *:67 *:0 DHCPD Receive LISTEN
Router# configure terminal
Router(config)# no ip http server
Router(config)# line vty 0 15
Router(config-line)# transport input sshÚltima actualización