cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1644
Views
0
Helpful
2
Replies

ssh not working in router on stick, over packet tracer

Gagan
Level 1
Level 1

Hello All,

 

I was creating a simple topology, in which i am creating a router on stick design, for l2 vlan to communicate with other vlans on the same l2 switch.

I have 3 subinterfaces on the router end, and consequently 3 vlans on the switch end. Port connecting to router from switch is in trunk. One of the vlans on the switch (vlan 101) has been made a management vlan, by creating an interface for the same and assigning an ip on it.

 

Now since the default gateway on the switch end , should be of the same subnet as the SVI, i configured same subnet ip address on one of the subinterface of router, which are connected to the trunk port of the switch

 

i have configured both line vty 0 4 and generated rsa keys on both switch and router. And i am able to ping every interface and ip from both switch and router. but i still am not able to ssh into router from switch. It asks for password, but does not log you in. And it is not a password fault (it was a very simple one).

 

Do we need to explicitly define management interface or something like that. Also if i am not wrong, we can ssh into subinterfaces, right?

Config for switch:

=============

campus_switch#sh run

Building configuration...

 

Current configuration : 1388 bytes

!

version 12.2

no service timestamps log datetime msec

no service timestamps debug datetime msec

no service password-encryption

!

hostname campus_switch

!

!

!

ip domain-name networking

!

!

spanning-tree mode pvst

spanning-tree extend system-id

!

interface FastEthernet0/1

!

interface FastEthernet0/2

switchport access vlan 2

switchport mode access

!

interface FastEthernet0/3

!

interface FastEthernet0/4

!

interface FastEthernet0/5

switchport access vlan 5

switchport mode access

!

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

switchport mode trunk

!

interface FastEthernet0/21

!

interface FastEthernet0/22

!

interface FastEthernet0/23

!

interface FastEthernet0/24

!

interface GigabitEthernet0/1

!

interface GigabitEthernet0/2

!

interface Vlan1

no ip address

shutdown

!

interface Vlan101

mac-address 0060.3eb1.0801

ip address 1.1.1.2 255.255.255.0

!

ip default-gateway 1.1.1.3

!

!

!

!

line con 0

!

line vty 0 4

login

transport input ssh

transport output ssh

line vty 5 15

login

!

!

!

!

end

 

 

campus_switch#

============

 

Config on router

 

============

campus_router#sh run

Building configuration...

 

Current configuration : 1232 bytes

!

version 12.4

no service timestamps log datetime msec

no service timestamps debug datetime msec

no service password-encryption

!

hostname campus_router

!

!

!

!

!

!

!

!

no ip cef

no ipv6 cef

!

!

!

username admin secret 5 $1$mERr$OQFMHbWC8dq9oQi8jqEzJ1

!

!

!

!

!

!

!

!

ip domain-name networking

!

!

spanning-tree mode pvst

!

!

!

!

!

!

interface Loopback0

ip address 11.11.11.11 255.255.255.0

!

interface FastEthernet0/0

no ip address

duplex auto

speed auto

!

interface FastEthernet0/0.1

encapsulation dot1Q 101

ip address 1.1.1.3 255.255.255.0

!

interface FastEthernet0/0.2

encapsulation dot1Q 2

ip address 10.2.2.2 255.255.255.0

!

interface FastEthernet0/0.5

encapsulation dot1Q 5

ip address 10.5.5.5 255.255.255.0

!

interface FastEthernet0/1

ip address 192.168.10.1 255.255.255.0

duplex auto

speed auto

!

interface Serial0/2/0

no ip address

clock rate 2000000

shutdown

!

interface Serial0/2/1

no ip address

clock rate 2000000

shutdown

!

interface Vlan1

no ip address

shutdown

!

ip classless

!

ip flow-export version 9

!

!

!

!

!

!

!

!

line con 0

!

line aux 0

!

line vty 0 4

login local

transport input ssh

transport output ssh

line vty 5 15

login local

transport input ssh

transport output ssh

!

!

!

end

 

 

campus_router#

============

2 Replies 2

Gagan
Level 1
Level 1

Just to add in this, when a PC is connected to switch, i am able to ssh in the switch itself. (added username and password, with local login command, in the line vty 0 4). but still not able to ssh in the router, it says login invalid, after asking for password

 

i removed the local login command from line vty 0 15, and added login command, with the password specified in vty. That seems to have done the job.