Link to home
Start Free TrialLog in
Avatar of VIBT
VIBTFlag for United States of America

asked on

Log telnet connections to Cisco switches?

In my environment I have a variety of Catalyst switches with:
IOS-XE 03.06.03E
IOS 12.2.53
IOS 12.2.35

I have them dumping logs to a syslog server.  I want to be able to log when someone connects to my switch.  When I show log I see lots of the state change messages and messages when I update the config, but no connection logs.

How do I configure my Cisco Switch to log when someone telnet or SSH connects to it?

Thanks!

VIBT
ASKER CERTIFIED SOLUTION
Avatar of Ernie Beek
Ernie Beek
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of VIBT

ASKER

Thanks!

I've successfully entered those commands.  I tried connecting successfully and unsuccessfully - both several times.  I still only see these entries for the last hour or so:

009607: Apr 14 09:09:55: %SYS-5-CONFIG_I: Configured from console by vty0 (xxx.xxx.xxx.xxx)
009608: Apr 14 09:10:09: %SYS-5-CONFIG_I: Configured from console by vty0 (xxx.xxx.xxx.xxx)
009609: Apr 14 09:34:50: %SYS-5-CONFIG_I: Configured from console by vty0 (xxx.xxx.xxx.xxx)
009610: Apr 14 10:13:44: %SYS-5-CONFIG_I: Configured from console by vty0 (xxx.xxx.xxx.xxx)
009611: Apr 14 10:15:34: %SYS-5-CONFIG_I: Configured from console by vty0 (xxx.xxx.xxx.xxx)

VIBT
Are those logged to the console or are these showing when you do a show logg?

There should be something showing like:
057222: Apr 14 08:31:48: %SEC_LOGIN-4-LOGIN_FAILED: Login failed [user: xxx] [Source: 10.x.x.x] [localport: 22] [Reason: Login Authentication Failed] at 08:31:48 CEST Thu Apr 14 2016
Avatar of VIBT

ASKER

When I show logg.

I am setup to just use a password to connect and another for enable.  Will that make a difference?

Thanks!

VIBT
What is your logging level set at?

show logging
Avatar of VIBT

ASKER

Looks like "debugging"

Syslog logging: enabled (0 messages dropped, 1 messages rate-limited, 0 flushes, 0 overruns, xml disabled, filtering disabled)
    Console logging: level debugging, 9611 messages logged, xml disabled,
                     filtering disabled
    Monitor logging: level debugging, 0 messages logged, xml disabled,
                     filtering disabled
    Buffer logging: level debugging, 9611 messages logged, xml disabled,
                    filtering disabled
    Exception Logging: size (4096 bytes)
    Count and timestamp logging messages: disabled
    File logging: disabled
    Trap logging: level informational, 9614 message lines logged
        Logging to xxx.xxx.xxx.xxx, 9614 message lines logged, xml disabled,
               filtering disabled
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of VIBT

ASKER

No.  Right now I just have a line password and an enable secret.  We are preparing to deploy Cisco ISE in the next couple of months to enable separate user aaa.

Is this why it is not logging anything for access attempts?

VIBT
that could be, I noticed a couple of incidents where that solved the problem.
Avatar of VIBT

ASKER

I'm setting up a test switch now.  I will try it and report back.
Thanks!
Avatar of VIBT

ASKER

Success!!  It looks like I did have to be using a local user and not just a line password to get it to log connection attempts.  Thanks!!!

2 Quick additional questions:

1. Is there a way to log "exist"s or disconnects?
2. I am seeing [Source: UNKNOWN] in the LOGIN_FAILED & LOGIN_SUCCESS messages (see "A" below).  Is there a way to configure this to capture the originating IP?  I see my IP address in the logs for configuring the switch (see "B" below).

A:
%SEC_LOGIN-4-LOGIN_FAILED: Login failed [user: ] [Source: UNKNOWN] [localport: 23] at Login Authentication Failed - BadUser

B:
%SYS-5-CONFIG_I: Configured from console by vty0 (xxx.xxx.xxx.xxx)

Thanks!

VIBT
Avatar of VIBT

ASKER

Thanks Ernie!
It is your choice, but you really do not use debugging mode for syslog if you plan to use that switch in production.
:)
My pleasure :)

Ad A (and 2): Could be a bug in this specific IOS version. I came across a number of incidents with that. Let me see if I can find the bud ID.

Ad 1: Mmmm, not sure. I would need to look for that.