line vty 0 4 和line vty 5 15 区别

简介:

line vty 0 4 和line vty 5 15 区别

    Cisco的设备管理有很多种方式,如Console、HTTP、TTY、VTY或其它网管软件,但我们远程管理较为常用的一种方式肯定是VTY方式。
VTY在Cisco的不同系列产品中,都有一定数量的VTY线路可用,但具体数目则不尽相同。有些路由器交换机产品只有五条线路可用(line vty 0 4),有些交换机路由器设备则提供了十多条,甚至达一千多条,但默认情况下不一定全部启用。如果您想看一下自己的设备具体支持多少条线路,只需在全局模式下使用命令line vty 0 ?即可查看该设备支持多少条线路。
VTY线路的启用/关闭:
VTY线路的启用只能按顺序进行,你不可能启用line vty 10,而不启用line vty 9。如果想启用line vty 9,那么你可以在全局模式(或line模式)下输入命令line vty 9 ,如:
(config)#line vty 9

这样系统会自动启用前面的0-8线路。当然也可以直接输入line vty 0 9直接启用10条线路。
如果不想开启这么多条线路供用户使用,那么只须在全局模式下使用no line vty m [n]命令就可以关闭第m后的线路,此时n这个数值可有可无,因为系统只允许开启连续的线路号,取消第m号线路会自动取消其后的所有线路。
VTY线路的协议选用:
  VTY线路支持多种协议:
   acercon   Remote console for ACE-based blade
   lat    DEC LAT protocol
   mop    DEC MOP Remote Console Protocol
   nasi     NASI protocol
   pad    X.3 PAD
   rlogin Unix rlogin protocol
   ssh    TCP/IP SSH protocol
   telnet TCP/IP Telnet protocol
   udptn UDPTN async via UDP protocol




在某一个接口上使用什么协议可以使用命令:transport {input|ouput}来进行定义:
(config)#line vty 0
(config-line)#transport ? //查看支持哪种方式的协议定义
   input    Define which protocols to use when connecting to the terminal server
   output     Define which protocols to use for outgoing connections
   preferred   Specify the preferred protocol to use
(config-line)#transport input ?     //查看在输入方向上支持的协议
   acercon   Remote console for ACE-based blade
   all    All protocols
   lat    DEC LAT protocol
   mop    DEC MOP Remote Console Protocol
   nasi     NASI protocol
   none     No protocols
   pad    X.3 PAD
   rlogin Unix rlogin protocol
   ssh    TCP/IP SSH protocol
   telnet TCP/IP Telnet protocol
   udptn UDPTN async via UDP protocol
(config-line)#transport output ?     //查看在输出方向上支持的协议
   acercon   Remote console for ACE-based blade
   all    All protocols
   lat    DEC LAT protocol
   mop    DEC MOP Remote Console Protocol
   nasi     NASI protocol
   none     No protocols
   pad    X.3 PAD
   rlogin Unix rlogin protocol
   ssh    TCP/IP SSH protocol
   telnet TCP/IP Telnet protocol
   udptn UDPTN async via UDP protocol
(config-line)#transport preferred //定义协议的优先次序
查看某一线路当前支持的协议可以使用命令show line vty m:
#show line vty 9
Tty Typ     Tx/Rx A Modem   Roty AccO AccI Uses Noise   Overruns Int
10 VTY              - -    - - -    0    0     0/0    -
Line 10, Location: "", Type: ""
Length: 24 lines, Width: 80 columns
Baud rate (TX/RX) is 9600/9600
Status: No Exit Banner
Capabilities: none
Modem state: Idle
Group codes: 0
Special Chars: Escape   Hold   Stop   Start   Disconnect   Activation
            ^^x none -     -    none       
Timeouts:    Idle EXEC Idle Session Modem Answer   Session Dispatch
            00:10:00        never                      none     not set
                        Idle Session Disconnect Warning
                           never
                        Login-sequence User Response
                            00:00:30
                        Autoselect Initial Wait
                           not set
Modem type is unknown.
Session limit is not set.
Time since activation: never
Editing is enabled.
History is enabled, history size is 10.
DNS resolution in show commands is enabled
Full user help is disabled
Allowed input transports are lat pad mop telnet rlogin ssh nasi.
Allowed output transports are lat pad mop telnet rlogin ssh nasi.
Preferred transport is lat.

No output characters are padded
No special data dispatching characters
VTY线路的使用:
VTY线路启用后,并不能直接使用,必须对其进行下面简单的配置才允许用户进行登录。
1、配置登录密码
如果想成功登录到设备,必须在line线路下使用命令password来定义登录密码,否则无法成功登录(注:如果全局已经启用了相关认证如AAA,则在此不必配置密码)
注意:在此你配置的密码是保存在配置文件中的,即使你启用service password-encryption功能,它加密的方式也是一种可逆的加密,很容易破解,所以在使用过程中尽可能配置一个不同于特权模式中的密码。
2、登录验证
   默认情况下,在line vty线路中,默认情况下使用的是系统默认的登录方式(要看你是否在全局启用了AAA等),如果你需要在登录时指定认证模式,你可以使用login authentication命令进行指定。如果你想在登录时不需要用户输入密码,则可以使用no lgoin命令进行指定(当然这很危险)
特权模式的使用:
通过VTY线路登录后,会进入用户模式,如果你需要进行特权模式,那么你必须配置登录特权模式的认证。
使用案例:
   不同的线路上,可以配置不同的协议,如在line vty 0上配置telnet,在line vty 1上配置ssh,这样当SSH用户登录时,系统会让line vty 0空闲,而使用line vty 1进行连接。
应用:在line vty 0-1上配置使用telnet协议,使用动态访问列表,在网络中进行严格的控制,以便只有网络管理人员才可以使用特殊通信;在2-10上配置SSH协议,用来进行设备管理。
默认情况下,IOS 自动为 VTY 线路执行了 login 命令。这可防止设备在用户通过 Telnet 访问设备时不事先要求其进行身份验证。如果用户错误的使用了 no login 命令,则会取消身份验证要求,这样未经授权的人员就可通过 Telnet 连接到该线路。这是一项重大的安全风险。


本文转自 bilinyee博客,原文链接:    http://blog.51cto.com/215363/934896     如需转载请自行联系原作者         
相关文章
|
7月前
|
编译器 C语言
__FILE__, __LINE__ __FUNCTION__
__FILE__, __LINE__ __FUNCTION__
|
8月前
|
Java
解决Command line is too long. Shorten command line for ServiceStarter or also for Application报错
解决Command line is too long. Shorten command line for ServiceStarter or also for Application报错
56 0
运行 ‘ApiApplication‘ 出错: Command line is too long. Shorten command line for ShopApiApplication or
运行 ‘ApiApplication‘ 出错: Command line is too long. Shorten command line for ShopApiApplication or
179 0
运行 ‘ApiApplication‘ 出错: Command line is too long. Shorten command line for ShopApiApplication or
Error running 'XXXApplication': Command line is too long. Shorten command line forXXX
Error running 'XXXApplication': Command line is too long. Shorten command line forXXX
113 0
Error running 'XXXApplication': Command line is too long. Shorten command line forXXX
Command line is too long. Shorten command line for AppWebStarter or...(已解决)
找到你项目中 .idea/workspace.xml文件 找到 < component name=“PropertiesComponent” > 在标签内部加上这句
143 0
Command line is too long. Shorten command line for AppWebStarter or...(已解决)

热门文章

最新文章