Ping from a switch

bencherbencher Member Posts: 7 ■□□□□□□□□□
Can you use the ping command from switch to a directly connected router.?

Comments

  • WebmasterWebmaster Admin Posts: 10,292 Admin
    If the switch has a vlan interface active (by default 'interface' vlan 1) with an IP address assigned that matches ip subnet of the router's interface. See step 3 in:
    icon_arrow.gifwww.techexams.net/techlabs/ccna/lab-switch-basics.shtml
  • bencherbencher Member Posts: 7 ■□□□□□□□□□
    if you place the place the port thats is connected to the router in a vlan and assign a ip address to that vlan. That will work too?
    Does it have to match or should it be in the same subnet?
  • WebmasterWebmaster Admin Posts: 10,292 Admin
    if you place the place the port thats is connected to the router in a vlan and assign a ip address to that vlan. That will work too?
    Actually that is what I suggested and what is described in the TechLab I linked to. However, you don't assign an ip address to 'a vlan', but to a 'vlan interface'. Which is a virtual interface that you can assign an ip address to, to allow you to telnet, ping, http, tracert, ssh the switch. Or vice versa You can only have one vlan interface active at one time, which by default is 'interface vlan 1'. But, yes, the actual interface to which the router is connected has to be in the same VLAN as the vlan interface.

    And yes, same subnet, not exact same IP. If you want to ping devices in other subnets (or for example ping or telnet the switch from other devices) 'outside' the ip subnet of the IP address you assigned to the vlan interface on the switch, you also need to configure the default gateway on the switch, as is also described in that TechLab.
Sign In or Register to comment.