Start at the training bench

The branch lab
Configure R1 for the branch LAN and give SW1 a management address. Start from console access, protect local and remote login, then verify SSH from the admin PC. This lab uses VLAN 1 for simplicity; use your network's management VLAN in a real deployment.
Device key: ISP (network / service) · R1 (router) · SW1 (switch) · Admin PC (computer) · Admin, other LAN (laptop)
Lines show the example’s network connections. Thick links: uplinks/WAN, as labelled. The coloured path and envelope follow the current step; its text identifies the sender, receiver and traffic type.
Reading the addresses
IP labels identify interfaces or destinations. Subnet labels identify networks; /n is the prefix length. A router ID (RID) identifies a routing process and need not be a reachable interface.
An IP address alone is not a URL. A web URL includes a scheme such as https://; an address on a router or printer does not imply a website.
- ISP: IP 198.51.100.1
- R1: Gi0/1 192.168.10.1
- SW1: Vlan1 192.168.10.2
- Admin PC: IP 192.168.10.10
- Admin, other LAN: IP 192.168.20.10
- 1. Same subnet: the admin PC reaches SW1's management address directly. No gateway needed.
- 2. From another subnet: a session from 192.168.20.0/24 reaches SW1 through R1.
- 3. The reply needs ip default-gateway: SW1 must know to send off-subnet replies to 192.168.10.1, or the session usually fails (proxy ARP on R1 can sometimes hide the missing setting).
Why each baseline setting is there
- Hostname: the prompt changes to the name, so you always know which device you are typing on. It also appears in CDP, logs and SSH keys.
- Separate passwords per entry point: the console, the remote VTY (virtual terminal) lines and privileged EXEC are three different doors. Each needs its own lock.
- A switch's IP lives on an SVI: a Layer 2 switch port has no IP address. Instead you give an address to a switched virtual interface (SVI), a virtual interface for one VLAN, such as
interface vlan 1. The switch answers management traffic on that VLAN. - Router interfaces start shut down: on most Cisco routers every interface is administratively down until you type
no shutdown. Switch access ports are commonly enabled by default. Check the actual state and shut down unused ports.
The baseline in six steps
- You connect to the console and enter global configuration (see CLI modes and navigation).
hostnamerenames the device. The prompt changes right away.enable secretprotects the move from>to#. It is stored as a hash.- For the console,
passwordwithloginuses a line password. For SSH, create a local username, generate the device's keys and uselogin localon the VTY lines. - An IP address on a routed interface (router) or an SVI (switch) makes the device reachable. A switch also needs
ip default-gatewayto reply to other subnets. - You save with
copy running-config startup-config, or everything is lost at the next reload.
Configuring R1 and SW1
Based on Cisco IOS / IOS XE documentation, not run on a lab device. The console line password is shown for learning. The SSH example uses a local username; access controls and stronger authentication options are covered in Passwords, local users and SSH.
Settings shared by the router and the switch
hostname R1
enable secret Str0ng-Enable!
service password-encryption
no ip domain-lookup
banner motd # Authorised access only. Activity is logged. #Global configuration. The banner text goes between two copies of a delimiter character (# here) that doesn't appear in the message.
line console 0
password C0nsole-Pass
login
logging synchronous
exec-timeout 10 0Console access uses the line password. logging synchronous redraws an interrupted input line; exec-timeout ends an idle session after ten minutes.
Enable SSH with a local account
Run this from global configuration on each lab device after setting its hostname (R1 or SW1). Replace the example secret with your own. This example assumes no AAA configuration is already controlling logins.
ip domain name lab.example
username labadmin secret Lab-Only-Change-Me!
crypto key generate rsa modulus 2048
ip ssh version 2
line vty 0 4
login local
transport input ssh
exec-timeout 10 0
exitThe domain name and RSA keys establish SSH for this example. login local authenticates against the local account; transport input ssh allows SSH and excludes Telnet.
Check line vty ? for your device's available lines. If lines 5 through 15 also exist, apply the same login, transport and timeout settings to them. Some images prompt for the RSA key size separately. Keep console access while checking your first SSH login.
Router interfaces (R1)
interface GigabitEthernet0/0
description WAN to ISP
ip address 198.51.100.2 255.255.255.252
no shutdown
interface GigabitEthernet0/1
description LAN to SW1 Gi1/0/24
ip address 192.168.10.1 255.255.255.0
no shutdown
interface GigabitEthernet0/2
description LAN 192.168.20.0/24
ip address 192.168.20.1 255.255.255.0
no shutdown
interface GigabitEthernet0/3
description Unused
shutdownEach interface needs an address in its own subnet and no shutdown. The description is free text that shows up in show interfaces description.
Switch management and ports (SW1)
hostname SW1
interface vlan 1
description Management SVI
ip address 192.168.10.2 255.255.255.0
no shutdown
exit
ip default-gateway 192.168.10.1
interface GigabitEthernet1/0/1
description Admin PC
speed auto
duplex auto
interface GigabitEthernet1/0/24
description Uplink to R1 Gi0/1
interface range GigabitEthernet1/0/2 - 23
description Unused
shutdownThe SVI is the switch's management address. ip default-gateway is for a Layer 2 switch (one without ip routing enabled). Shutting unused ports is a basic security step.
Leave speed and duplex on auto unless you have a reason not to. If you hard-code them on one end, hard-code the same values on the other end, or you risk a duplex mismatch (see Speed and duplex). In real networks, management usually goes on its own VLAN rather than VLAN 1; the VLANs and trunks lesson shows how.
Checking addresses, descriptions and line security
R1#show ip interface brief Interface IP-Address OK? Method Status Protocol GigabitEthernet0/0 198.51.100.2 YES manual up up GigabitEthernet0/1 192.168.10.1 YES manual up up GigabitEthernet0/2 192.168.20.1 YES manual up up GigabitEthernet0/3 unassigned YES unset administratively down down
R1#show interfaces description Interface Status Protocol Description Gi0/0 up up WAN to ISP Gi0/1 up up LAN to SW1 Gi1/0/24 Gi0/2 up up LAN 192.168.20.0/24 Gi0/3 admin down down Unused
SW1#show ip interface brief | include Vlan|1/0/1 |1/0/24 Vlan1 192.168.10.2 YES manual up up GigabitEthernet1/0/1 unassigned YES unset up up GigabitEthernet1/0/24 unassigned YES unset up up
SW1#show running-config | include default-gateway|hostname hostname SW1 ip default-gateway 192.168.10.1
R1#show running-config | section line line con 0 exec-timeout 10 0 password 7 08021C401A1609125F3B0D1739 logging synchronous login line vty 0 4 exec-timeout 10 0 login local transport input ssh
service password-encryption on, line passwords show as type 7, a weak reversible encoding. The enable secret and username secret are stored as hashes; the hash type depends on the platform and release. The VTY lines use the local username rather than a shared line password.Check show ip ssh for SSH version 2, then connect from the admin PC with ssh -l labadmin 192.168.10.1 for R1 orssh -l labadmin 192.168.10.2 for SW1. After a successful login, use enable for privileged EXEC. Save the verified configuration with copy running-config startup-config.
SW1#ping 192.168.10.1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.10.1, timeout is 2 seconds: .!!!! Success rate is 80 percent (4/5), round-trip min/avg/max = 1/1/2 ms
Down interfaces, silent consoles and unreachable switches
| Symptom | Likely cause | Fix |
|---|---|---|
| Router interface is administratively down | Never enabled | no shutdown on the interface |
| SVI Vlan1 is down/down | No port in VLAN 1 is up, or the SVI is shut down | Connect a port in the VLAN; no shutdown on the SVI |
| Switch reachable from its own subnet only | No default gateway | ip default-gateway 192.168.10.1 |
| Telnet/SSH says Password required, but none set | login with no password on the VTY lines | Set a password, or use login local with a username |
| Console never asks for a password | password set but login missing | Add login under line console 0 |
| Link errors or poor throughput | Possible cabling or speed/duplex issue | Check error counters and both ends. Prefer matching auto-negotiation settings where supported. |
Small slips in a baseline
- Using
enable passwordinstead ofenable secret. If both exist, the secret wins. - Configuring VTY 0 4 on a switch and leaving VTY 5 15 open with different settings.
- Putting
ip addresson a switch's physical access port. Layer 2 ports don't take addresses; use the SVI. - Using
ip default-gatewayon a router or a Layer 3 switch withip routingenabled. It is ignored there; those devices use a default route. - Choosing a banner delimiter that appears in the message, which ends the banner early.
- Forgetting to save, then losing the whole baseline at the next reload.
Test yourself on initial setup
A router has both 'enable password cisco' and 'enable secret class'. Which password does enable accept?
SW1's SVI is 192.168.10.2/24 and up/up. Hosts in 192.168.10.0/24 can SSH to it, but an admin at 192.168.20.10 can't. What is most likely missing?
Under line console 0 you typed 'password C0nsole-Pass' but the console still lets anyone in without a prompt. What is missing?
show ip interface brief on a new router shows Gi0/1 with an IP address but 'administratively down'. What do you do?
After 'service password-encryption', the VTY password shows as 'password 7 0110...'. How secure is it?
Cisco reference
Configure SSH on routers documents the SSH prerequisites, local authentication and verification commands.