You can also view the connections to the router or switch by using the show users command, so show user
shows us that we connected via console zero, but we also connected via a telnet session from this IP
address.
So if I exit out of the telnet session,
show users now shows that we only connected via the console, I'll log in via the telnet session again.
Show users shows us that the telnet session is now active.
I'll jump back to router 1 using the keystrokes control shift 6 x
and open up another telnet session, show users now shows us that David is connected to VTY 0 as
well as VTY 1 control shift 6 X.
Open up another session, control shift 6 X do another.
So we now have four VTY sessions open, jump back.
Now, the telnet session.
Show users, we're now connected and what's interesting is notice the username is not case sensitive in this
example, but the password is case sensitive.
So we've got 1,2,3,4,5 VTY sessions,
if I jump back to the router now, router 1
and try and telnet again, notice the session is refused because we only enabled five VTY sessions from
0 to 4.
At the moment, 5 VTY sessions are being used, so it's 6, 1 is refused or rejected.
Now, here we could clear line 98
by using the command clear line and specifying a number so we could say 98, so just to show you that
again, we could clear this line or we could clear the VTY, so clear line 98 confirm show users,
98 has been disconnected and now on router 1, we can telnet back to router 2, so we have
our session on line 98.
Reason why is, when you type show line, you'll see that the console is VTY 0.
The auxiliary port on the router is line 97 and the first VTY is line 98.
That's to do with asynchronous modules that you can insert into router which you use what are called TTY
lines.
In this case, I'll telnet to a physical router that I've got running locally here
and I'll log in.
This is a 3640 router show line, shows me that I have a console as well as a lot of TTY lines, these
allow me to implement reverse telnet sessions and then an auxiliary connection and then my VTY sessions
on this router.
So show line once again, first line is, is the console.
Then we have a range of TTYs, then the auxillary line and then VTY lines, hence the number
of these VTY lines is not 1 or 2 because you can have reverse console connections on a router.
In the old days, this was used for asynchronous modems.
So the really old days on routers, we had asynchronous modems and we would connect via those modems
on various TTY lines.
So just type show line
if you're not sure what the numbers are, that will vary from device to device.
So on this virtual switch show line shows me that the auxilliary port is line 1 and the VTY line is line
2 because it doesn't support TTY asynchronous modems, whereas a router such as a 3725 does.
So I could also type clear line VTY and specify number so 0 and the connection was closed.
So I'll telnet back
my username is David, not Cisco show line
shows me various lines, show user or uses shows me that at the moment, this is the only active
VTY line.
You can also see the star associated with a VTY line.
The other sessions would have timed out because of a timer.
So once again, if I jump back, control shift 6 x another telnet session,
show line, you can see the console is active and so are both these VTY lines, show users shows me that
I have two connections VTY 0 and VTY 1, clear line 99.
Notice the connection was closed, on this router show
sessions shows me my current sessions and then I could do something like Disconnect, which will disconnect
the last active session.
So Show Sessions shows me that 6 was closed.
I could also do it this way, Disconnect 3,
show sessions, 3s not available, if I want to restore session, I could just simply select the
connection number. So 1
but as you can see, that's been closed.
So shows session 2 that was closed by the remote host, 4 that was closed, 5 that was closed.
So I have no active sessions at the moment if I telnet it back to the router and logged in control shift 6 x
to take me back,
show sessions
select session 1, I notice it resumes it and I am now on router 2.