-1

I have a switch supporting both L2 and L3 Switching. It is connected to one router (so L3) and one device using L2 switching.

[Source] ==== L2 ==== [Router] ---- L3 ---- [Switch] ==== L2 ==== [Target]

===== many links, ----- single address

So the question is, in case all the routers uses the same vlan, is it possible for one interface to do both L2 switching and L3 switching? What I mean is, does the standard allow this (I will not complicate this by including switch/router model, just trying to keep it on a theoretical level)? Both the router and the switch is needed, since the router is integrated in other hardware.

In case this work I would then let the next hop address to the router be the gateway address to the interface on the switch. Would this be possible?

patrik
  • 171
  • 1
  • 6

1 Answers1

3

Can a switch supporting both L2 and L3 serve as L2 switch and L3 switch at the same time? - Yes.

is it possible for one interface to do both L2 switching and L3 switching? - There's no such thing as Layer 3 switching. When a Layer 3 switch is switching packets then it's acting as a switch. When it's routing packets then it's acting as a router. Layer 2 and Layer 3 are two different layers. Switching occurs at Layer 2. Routing occurs at Layer 3.

If you already have a router then you don't need to use the routing (Layer 3) capability of the switch at all.

joeqwerty
  • 109,901
  • 6
  • 81
  • 172
  • 1
    ...but there may be significant performance related reasons to route certain network segments at a L3 switch even if another router is present. – EEAA Sep 14 '16 at 12:22
  • The main problem is distance and cabling here, so both the switch and the router is needed for practical purposes. The idea was to connect the "L2 Device" to the switch and the router to the switch and thus creating a connection between the nodes. The vlan would be the same. Would this be possible? And yes, I know that the term Layer 3 switching is misleading, but I prefer to let the switch worry about implementation. – patrik Sep 14 '16 at 12:26
  • Yes, that would certainly work, and it has nothing to do with L3 constructs. Just VLANS, which any L2 switch worth its salt will be able to handle with ease. – EEAA Sep 14 '16 at 12:47
  • @EEAA So this means that it would be enough to use the switching (layer 2) capabilities of the switch? In that case, would I need to define a static route (to the switch) in the router or ipv4 addresses in the switch for this? – patrik Sep 14 '16 at 12:51
  • Layer 2 knows nothing about IP addresses. As long as all of your devices are on the same subnet and L2 network segment, it should just work. Give it a try! – EEAA Sep 14 '16 at 12:52