Cisco IOS configuration modes and VTY lines: On a Cisco router, which command (typed in the correct configuration mode) configures all of the default virtual terminal (VTY) lines used for Telnet/SSH access (lines 0 through 4)?

Difficulty: Easy

Correct Answer: Router(config)#line vty 0 4

Explanation:


Introduction / Context:
Virtual terminal (VTY) lines on Cisco IOS devices are used for remote administrative sessions such as Telnet or Secure Shell (SSH). Knowing how to enter the correct configuration submode to apply passwords, login methods, and transport protocols to all default VTY lines (0–4) is essential for secure router access control.



Given Data / Assumptions:

  • The device is a Cisco router running IOS.
  • We want to configure the default set of VTY lines, which are 5 lines numbered 0 through 4.
  • Commands must be entered from the correct mode hierarchy: user EXEC → privileged EXEC → global configuration → line configuration.


Concept / Approach:

To configure multiple VTY lines at once, you enter global configuration mode and then the line submode for the range. The canonical syntax is line vty 0 4 from Router(config)#. Inside that submode you can set password, login, transport input ssh, and apply access-class filters.



Step-by-Step Solution:

From privileged EXEC, type: configure terminalEnter the VTY line range: line vty 0 4Apply desired settings: password, login local, transport input ssh, etc.Exit and save: end, then copy running-config startup-config


Verification / Alternative check:

Use show running-config | section line vty to confirm that the configuration applied to lines 0–4. Attempt a Telnet/SSH session to validate access behavior matches policy.



Why Other Options Are Wrong:

Router#line vty 0 4 shows the wrong prompt; you must be in global config, not user/privileged EXEC.

Router(config-if)#line console 0 configures the console line, not VTY.

Router(config)#line vty all is not valid IOS syntax; specify the numeric range.



Common Pitfalls:

Forgetting to include the entire range (0–4), leaving some lines unprotected; configuring Telnet without SSH; omitting login or AAA, which can lock out access or weaken security.



Final Answer:

Router(config)#line vty 0 4

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion