cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2343
Views
0
Helpful
10
Replies

Telnetting to switch

Mike Hagans
Level 1
Level 1

                   Hello,

I've configure the command below on a switch. when I try to telnet to it from a pc I get:

PC>telnet 172.16.2.31
Trying 172.16.2.31 ...Open

[Connection to 172.16.2.31 closed by foreign host]
PC>

Command on switch:

line vty 0 4

password cisco

login

line vty 5 15

login

!

!

end

line vty 0 4

password cisco

login

line vty 5 15

login

!

!

end

Any help would be great!

1 Accepted Solution

Accepted Solutions

Hmm - you don't have an IP address on your switch

Try:

#interface vlan1

#ip address 172.16.2.31 255.255.255.0

View solution in original post

10 Replies 10

Reza Sharifi
Hall of Fame
Hall of Fame

Hi,

If you are trying to login local to the switch, then add this commands and try again:

line vty 0 4

password cisco

login local

line vty 5 15

login local

username test password test

username test privilege 15.

HTH

cadet alain
VIP Alumni
VIP Alumni

Hi,

is the PC on a remote subnet ? if so you must configure the ip default-gateway command.

is your vlan interface up/up ----> sh ip int br 1 i Vlan

Can you ping this IP ?

Regards

Alain

Don't forget to rate helpful posts.

Don't forget to rate helpful posts.

I was actually having the issue on the LAN as well as on a remote LAN. I did not have the default gateway set on the switch so I configured that just now as well as the above commands to create a username and privledge. However, I'm still having the problem. I can ping the switch from the LAN and remote LAN. Just cannot telnet

Hi,

can you post the config and also the topology file.

Regards

Alain

Don't forget to rate helpful posts.

Don't forget to rate helpful posts.

I added the network I made in packet tracer. It's attached to the original post above. I'm trying to telnet from PC "Andy" in the Nashville LAN to the switch in that LAN. I'm also trying to telnet from PC "Jimmy Bob" in the Miami LAN.

Config to the Nashville Switch:

Switch#sh run
Building configuration...

Current configuration : 1084 bytes
!
version 12.1
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Switch
!
!
username user privilege 15 password 0 cisco
!
spanning-tree mode pvst
!
interface FastEthernet0/1
!
interface FastEthernet0/2
!
interface FastEthernet0/3
!
interface FastEthernet0/4
!
interface FastEthernet0/5
!
interface FastEthernet0/6
!
interface FastEthernet0/7
!
interface FastEthernet0/8
!
interface FastEthernet0/9
!
interface FastEthernet0/10
!
interface FastEthernet0/11
!
interface FastEthernet0/12
!
interface FastEthernet0/13
!
interface FastEthernet0/14
!
interface FastEthernet0/15
!
interface FastEthernet0/16
!
interface FastEthernet0/17
!
interface FastEthernet0/18
!
interface FastEthernet0/19
!
interface FastEthernet0/20
!
interface FastEthernet0/21
!
interface FastEthernet0/22
!
interface FastEthernet0/23
!
interface FastEthernet0/24
!
interface Vlan1
no ip address
!
ip default-gateway 172.16.2.17
!
!
line con 0
!
line vty 0 4
password cisco
login local
line vty 5 15
password cisco
login local
!
!
end

I see I did not have vlan 1 configured with an IP but I just added that and had the same problem.

Ah I thought that was too easy...

Can you ping the default gateway from the switch?

Can you sit on the switch and telnet to yourself?

i.e.

switch>telnet 172.16.2.31

Hmm - you don't have an IP address on your switch

Try:

#interface vlan1

#ip address 172.16.2.31 255.255.255.0

I got it working now... Did not have an IP assigned... Actually I did but failed to notice the error "bad mask" because .31 is the broadcast address on my 172.16.2.16/28 network. that along with creating the username and default gateway etc worked..

Thanks everyone!

Still learning