cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
11021
Views
0
Helpful
4
Replies

Access a router using a switch. Is it possible?

fabio.marino
Level 1
Level 1

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.

1 Accepted Solution

Accepted Solutions

Jon Marshall
Hall of Fame
Hall of Fame

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

View solution in original post

4 Replies 4

shahhardik
Level 1
Level 1

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

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.

Jon Marshall
Hall of Fame
Hall of Fame

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

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.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Review Cisco Networking products for a $25 gift card