01-11-2010 01:10 AM - edited 03-06-2019 09:14 AM
Hi all,
I can't delete "line vty 5 15"
when i try it the below message occurs
====================================================
PE007#sh run | beg line vty
line vty 0 4
exec-timeout 30 0
privilege level 15
logging synchronous
no login
line vty 5 15
exec-timeout 0 0
no login
!
end
PE007#conf t
Enter configuration commands, one per line. End with CNTL/Z.
PE007(config)#no line
PE007(config)#no line vty 5 15
% Can't delete last 16 VTY lines
PE007(config)#
who's knows about this??
Solved! Go to Solution.
01-11-2010 01:26 AM
Hello Sanghee,
You cannot delete the VTY lines 5 to 15. They are only separately described in the configuration file for backward compatibility purposes.
The reason is this: Older IOSes supported only 5 VTYs, from 0 to 4. In newer IOSes, this number was increased. Now imagine that the VTY section would begin with a command line vty 0 15. The configuration parser in older IOSes would refuse to accept such command and it would also ignore all the commands that were supposed to be placed on the VTY lines. As a result, no VTY line would be configured, resulting in inability to login remotely. That is why the newer IOSes consciously split the configuration of the VTY lines to two sections - line vty 0 4 that will be accepted by all IOSes, old and new, and the remaining lines line vty 5 15 that will be understood and accepted by newer IOSes.
Best regards,
Peter
01-11-2010 01:45 AM
Hi,
I dont think you can delete the VTY lines but you can not allow access to them which you already have in place (no login). You can simply allow access via only the first 5 lines if desired:
line vty 0 4
password
login
line vty 5 15
no login <--does not allow access to these lines.
Hope that helps
Regards
Ganesh.H
01-11-2010 01:26 AM
Hello Sanghee,
You cannot delete the VTY lines 5 to 15. They are only separately described in the configuration file for backward compatibility purposes.
The reason is this: Older IOSes supported only 5 VTYs, from 0 to 4. In newer IOSes, this number was increased. Now imagine that the VTY section would begin with a command line vty 0 15. The configuration parser in older IOSes would refuse to accept such command and it would also ignore all the commands that were supposed to be placed on the VTY lines. As a result, no VTY line would be configured, resulting in inability to login remotely. That is why the newer IOSes consciously split the configuration of the VTY lines to two sections - line vty 0 4 that will be accepted by all IOSes, old and new, and the remaining lines line vty 5 15 that will be understood and accepted by newer IOSes.
Best regards,
Peter
01-11-2010 02:01 AM
thanks for your answer.
it's helpful to me.
11-05-2015 07:21 AM
Long time ago the last answer.
The solution is simple yet strange:
Just compair both line so like
0 2
3-4
5,
6-15
make all the VTY's like the one you want to keep ( like the 0-2 ) and they will disapear.
so copy paste the same configuration to ALL the VTY's like 0 2.
line vty 0 2
session-timeout 20
line vty 3 4
session-timeout 30
line vty 5
session-timeout 40
config t
line vty 3 4
session-timeout 20
line vty 5
session-timeout 20
and they should be gone with just 0-4 left.
if you see 0 5 just split it to 0 4 and 5 ( 5 needs a diffirent config like 0 4
and do a
no vty line 5
done!
01-11-2010 01:45 AM
Hi,
I dont think you can delete the VTY lines but you can not allow access to them which you already have in place (no login). You can simply allow access via only the first 5 lines if desired:
line vty 0 4
password
login
line vty 5 15
no login <--does not allow access to these lines.
Hope that helps
Regards
Ganesh.H
01-11-2010 02:02 AM
thanks for you answer.
it's a good information. thanks again
02-16-2012 11:06 AM
line vty 0 4
password
login
line vty 5 15
no login
Beware!!! Actually this disables asking for password on incomming telnet sessions!
In this case, your switch will only ask for password on the firt five telnet sessions.
06-27-2012 10:17 AM
you can also go with....
line vty 5 15
transport input none
transport output none.
That will not allow any type (ssh, telnet, etc) to be established on vty lines 5 15.
I would recommend the following config on any devies that uses SSH
line vty 0 4
transport input ssh
password
login
06-27-2012 11:10 AM
If you want the vty 5 to 15 to not work then the best thing to do is to configure this
line vty 5 15
no exec
HTH
Rick
02-18-2013 02:58 AM
Not sure what IOS version you have, but I did it before. Note you only need to delete line vty 5 and the IOS will automatically delete all lines that started from 5. However, you can not delete the line vty from 0 to 4.
Below is how I delete them:
c28ar01#conf t
Enter configuration commands, one per line. End with CNTL/Z.
c28ar01(config)#do sh run | be line vty
line vty 0 4
session-timeout 5
access-class 22 in
transport preferred none
transport input ssh
transport output none
!
!
< snip >
c28ar01(config)#
c28ar01(config)#line vty 5 15 >>> Added vty 5 - 15
c28ar01(config-line)#
c28ar01(config-line)#
c28ar01(config-line)#
c28ar01(config-line)#do sh run | be line vty
line vty 0 4
session-timeout 5
access-class 22 in
transport preferred none
transport input ssh
transport output none
!
line vty 5 15 >>> new
!
< snip >
c28ar01(config-line)#
c28ar01(config-line)#no line vty 5
c28ar01(config)#
c28ar01(config)#
c28ar01(config)#do sh run | be line vty
line vty 0 4
session-timeout 5
access-class 22 in
transport preferred none
transport input ssh
transport output none
!
<<< line vty 5-15 are now deleted >>>
< snip >
02-18-2013 04:57 AM
I wanted to add that I normally configure my vty ports as follows:
line vty 0 4
access-class 23 in
password 7 xxxxxxxxxxx
login local
transport input ssh
line vty 5 15
access-class 23 in
no login
transport input none
I don't normally login from one switch to another. I limit IP addresses that have access to the device. There are many variations. But if you don't want to use ports vty 5 - 15, just input the:
line vty 5 15
no login
transport input none
02-18-2013 08:52 AM
How IOS treats the vty 5 15 is very much dependent on the version of IOS being used. We have an example in this thread in which vty 5 15 is not the default. Clearly in this version of IOS the extra vty can be added and can be deleted.
And very clearly the version of IOS for the original poster does have vty 5 15 as its default setting and will not allow them to be deleted
PE007(config)#no line vty 5 15
% Can't delete last 16 VTY lines
HTH
Rick
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide