Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. If you'd prefer to explore, try our test area to get started. And see here for current known issues.

New Member

Access a router using a switch. Is it possible?

Hi, i'm Fabio and during my CCNA exam simulation i got the following question, but really, i diin't get what the problem is.

I have a topology  like:

PC -> swicth -> Router.

Following, the swicth configurations:

interface Vlan1
no ip address
shutdown
!
interface Vlan2
ip address 192.168.2.2 255.255.255.0
!
!
line con 0
!
line vty 0 4
password cisco
login
line vty 5 15
login
!

......

Following the Router configuration:


(....)

....

interface FastEthernet0/0
  ip address 192.168.1.10 255.255.255.0
  duplex auto
  speed auto

.....

line vty 0 4
password cisco
login

(....)

Router uses its FastEthernet 0/0 to communicates with switch.

So, whenever i try to telnet the router from the swicth (S# Telnet 192.168.1.10) all packets are dropped, but i was not able to understand the problem. Thanks in advance, king regards Fabio.

Everyone's tags (2)
1 ACCEPTED SOLUTION

Accepted Solutions
Hall of Fame Super Blue

Re: Access a router using a switch. Is it possible?

fabio.marino wrote:

Hi, i'm Fabio and during my CCNA exam simulation i got the following question, but really, i diin't get what the problem is.

I have a topology  like:

PC -> swicth -> Router.

Following, the swicth configurations:

interface Vlan1
no ip address
shutdown
!
interface Vlan2
ip address 192.168.2.2 255.255.255.0
!
!
line con 0
!
line vty 0 4
password cisco
login
line vty 5 15
login
!

......

Following the Router configuration:


(....)

....

interface FastEthernet0/0
  ip address 192.168.1.10 255.255.255.0
  duplex auto
  speed auto

.....

line vty 0 4
password cisco
login

(....)

Router uses its FastEthernet 0/0 to communicates with switch.

So, whenever i try to telnet the router from the swicth (S# Telnet 192.168.1.10) all packets are dropped, but i was not able to understand the problem. Thanks in advance, king regards Fabio.

Fabio

Is you switch a L2 switch or a L3 switch ?

If it is L2 then you either need to -

1) have the vlan interface, vlan 2 in your example, in the same subnet as the router or it won't work

or

2) setup a trunk on the switch and use 802.1q subinterfaces on the router. The router would then need a subinterface for the vlan 2 subnet.

Jon

4 REPLIES
New Member

Re: Access a router using a switch. Is it possible?

Hi Fabio,

For your requirement you need to allow Telnet on line vty, but before that first check the PING response from the switch, whether r u able to ping or not, if not. Here you also need to configure Default gateway in your switch as 192.168.2.2. After that configure below command in your configuration.

On Switch: Switch#config ter

                 switch(config)# line vty 0 4

                                     # transport output telnet ( This command is to allow outbond telnet, which you require to telnet your router)

                                     # transport input telnet   ( This command is to allow inbond telnet)

On router: router# Config ter

                        # line vty 0 4

                        # transport input telnet ( This command is to allow inbond telnet, which you will require when you try to telnet from switch)

                      

Hope this will work fine.

Regards,

Hardik

New Member

Re: Access a router using a switch. Is it possible?

Thanks Hardik, but i tried your suggestion and it doesn't work.

I'm able to ping and to telnet the FastEthernet router interface form the PC, but i'm not able to ping the same interface from the switch.

I'm no able to fix the problem but i think that something is wrong with the FastEthernet switch interface direct to the FastEthernet router interface.

First of all, tha FastEthernet router interface has a 192.168.1.10 ip address.

The PC NIC interface of the host has a 192.168.1.88 ip address. What about the ip address of the switch FastEthernet interface direct to the router? (Topology: PC->switch->Router)It doesn't have ip address,so,  when i try to ping the router from the switch, the ICMP echo request packet leave the switch,  doesn't have ip address in the source field and i  think this is the reason why ping doesn't work, more, the router doesn't know to who send back the ICMP echo reply. The same think for the telnet session. I think that to obtain this i need to configure the switch interface direct to the router as a routed interface (no switchport) but this is feasible only in L3 swicth, and is not my case.  Any idea? Is it right my throubleshoot? Thanks in advance, Fabio.

Hall of Fame Super Blue

Re: Access a router using a switch. Is it possible?

fabio.marino wrote:

Hi, i'm Fabio and during my CCNA exam simulation i got the following question, but really, i diin't get what the problem is.

I have a topology  like:

PC -> swicth -> Router.

Following, the swicth configurations:

interface Vlan1
no ip address
shutdown
!
interface Vlan2
ip address 192.168.2.2 255.255.255.0
!
!
line con 0
!
line vty 0 4
password cisco
login
line vty 5 15
login
!

......

Following the Router configuration:


(....)

....

interface FastEthernet0/0
  ip address 192.168.1.10 255.255.255.0
  duplex auto
  speed auto

.....

line vty 0 4
password cisco
login

(....)

Router uses its FastEthernet 0/0 to communicates with switch.

So, whenever i try to telnet the router from the swicth (S# Telnet 192.168.1.10) all packets are dropped, but i was not able to understand the problem. Thanks in advance, king regards Fabio.

Fabio

Is you switch a L2 switch or a L3 switch ?

If it is L2 then you either need to -

1) have the vlan interface, vlan 2 in your example, in the same subnet as the router or it won't work

or

2) setup a trunk on the switch and use 802.1q subinterfaces on the router. The router would then need a subinterface for the vlan 2 subnet.

Jon

New Member

Re: Access a router using a switch. Is it possible?

Thanks, now it all works (my switch is L2 switch).

Here my task:

1)I changed the ip address of the vlan 2 interface of the switch in order to be in tha same network of the router and host.

2)The fastethernet of the switch direct to router was set in trunk mode, and vlan 2 was set as native vlan

3)At the router interface direct to the swicth i created a subinterface Fa0/0.2, i fixed the encapsulation as dot1q, with native vlan2 and with ipaddress in the same network of the vlan 2 interface of the switch and host.

Thanks, regards Fabio.

4315
Views
0
Helpful
4
Replies