cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3517
Views
0
Helpful
5
Replies

Cisco IP routing on L3 switches

YekinKebo
Level 1
Level 1

I'm trying to make sure I understand the full capability of using the "ip routing" command on a L3 switch. Enabling "ip routing" ONLY enable inter-vlan routing assuming the SVI of the switch is the gateway of the VLAN. If I have some switch down the line with with SVI for VLAN 1 and 2, traffic is still being routed all the way to the gateway of the VLAN before being routed to the other VLAN.

5 Replies 5

balaji.bandi
Hall of Fame
Hall of Fame

yes correct, Only Layer 3 - where routing take place will have routing base information, how to route to other network.

 

If other device not capable of holding any routing information, and acting as Layer 2, then it rely on Layer 3 device for routing.

 

Make sense ?

 

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

Giuseppe Larosa
Hall of Fame
Hall of Fame

Hello @YekinKebo ,

your understanding is correct even if a device on the path would be able to route the packet to the destination, the frame is first sent to the default gateway configured on the end user device because the frame has a destination MAC address = DEF GW MAC address.

Once the frame reach the L3 switch   the frame header is rewritten using the appropriate info Source MAC = Switch SVI in destination VLAN Y, destination MAC = MAC address of host in destination subnet learned via ARP. The MAC address is used to find out the right exit interface using the CAM table.

The IP header has TTL field decremented by 1 and the header checksum is recomputed ( actually increased by 1) apart from this the IP packet is not changed.

 

Hope to help

Giuseppe

 

Joseph W. Doherty
Hall of Fame
Hall of Fame

"Enabling "ip routing" ONLY enable inter-vlan routing assuming the SVI of the switch is the gateway of the VLAN."

Incorrect (because of "ONLY" [and/or perhaps your usage/meaning of "gateway"]).  Enabling IP routing routes between all interfaces with IPs (which could be SVI or "routed" interfaces or even loopback interfaces) and also routes based on the contents of the route table (which might be populated by static routes and/or routing protocols).

The foregoing doesn't matter whether the interface is being used by a VLAN or otherwise connected hosts (e.g. latter might be done via a routed interface too).

However, if the switch supports VRF, routing would only be between interfaces within the same VRF, unless you configure route leaking between them.

(BTW, remember, although not much used, L3 devices might proxy ARP, i.e. they [the hosts] don't need, then, to have a configured gateway.)

"If I have some switch down the line with with SVI for VLAN 1 and 2, traffic is still being routed all the way to the gateway of the VLAN before being routed to the other VLAN."

I'm unsure what you're asking.  This is another switch?

When switches "share" a network (usually via VLAN, but not always), and each have an interface with IP on the shared network, an interface acting as a gateway for hosts, if it believes the other L3 device has a better path to the packet's destination can (optionally) send a redirect ICMP message to the host informing it to use the other L3 device's IP for that destination.

In case where the receiving router does have a "connected" interface to the destination network, normally it would always consider that the best way to route to it.  (I'm unsure whether this can be overridden, as "connected" interfaces have the "best" metric to the interface's network.)

 

PS:

"I'm trying to make sure I understand the full capability of using the "ip routing" command on a L3 switch."

More or less, it makes the switch into a router  (generally of much greater capacity than a like priced router, although often, with less "advanced" features).  What's described, above, also applies to "routers", although they don't generally have SVIs, unless you're dealing with router with embedded L2 switch modules.

Perhaps a review of some concepts might be helpful. In traditional terminology a switch was a layer 2 device. It used layer 2 information (destination mac address, source mac address) to populate forwarding tables and to forward traffic.

When you enable ip routing on a switch you add layer 3 capability. It can now make forwarding decisions using layer 3 information.

When you enable ip routing on a switch you immediately get recognition of locally connected IP subnets and inter vlan routing for those subnets.

When you enable ip routing you also get the capability of processing static routes for destinations that are not locally connected.

When you enable ip routing you also get the capability of running dynamic routing protocols and learning about remote subnets.

When you enable ip routing you also get the capability of having a default route to forward to destination which do not match any specific entry in the routing table.

If you enable ip routing on  a switch you get all of these capabilities. Your switch may use all of them or use only some of them. But all are possible when you enable ip routing on a switch.

HTH

Rick

"When you enable ip routing you also get the capability of having a default route to forward to destination which do not match any specific entry in the routing table."

Rick, is of course, correct, but as an "advanced" concept, just wanted to note a "default route" is just the extreme case of a route.  I.e. the default route is a route that is the aggregate for all networks, not just an aggregate of some networks.

I mention this, because when learning about routing, I was initially a bit confused by actual networks being specific, but routing entries are always "wildcards" that might correspond to a specific network prefix or to a network aggregate.

For example, the route entry 10.1.1.0/24 might match an actual network that's also 10.1.1.0/24 but it could also match the following specific networks: 10.1.1.0/25, 10.1.1.128/27, 10.1.1.160/27 and 10.1.1.192/26.  Basically, any networks within the 10.1.1.0/24 range.

So, the default route matches any network prefix not otherwise matched with a more specific prefix.

Again, the default route is just processed like any other route entry, it just encompasses the whole network address space.