07-20-2021 01:48 PM
Three switches are linked together via trunk port. SW1 can ping SW3. But after adding command “ip routing” at SW3, the SW3 lost connection to SW1. Anyone can explain it? Thanks
SW3-------SW2-------SW1
SW3
Vlan10 10.1.1.3/24
Ip default-gateway 10.1.1.1
SW1
Vlan10 10.1.1.1/24
07-20-2021 02:12 PM
If the switches are functioning as layer-2 only with one address for management, all you need is the "Ip default-gateway" command.
Maybe you lose connection because the ip route command is pointing to a different device. Can you post "sh run"?
HTH
07-20-2021 05:00 PM
When a switch is operating as a L2 switch it uses the ip default-gateway command to enable access to remote subnets. When a switch is configured with ip routing to becomes a L3 switch then the default-gateway command is ignored. At that point the L3 switch needs a default route, usually this is provided by a static default route (or perhaps provided by configuring some dynamic routing protocol to run on the switch). It is not clear to me in the original post that either a static default route or a dynamic routing protocol has been configured. Can the original poster provide clarification on this?
07-20-2021 06:24 PM - edited 07-20-2021 06:26 PM
Hi Rick, I think you are right. Thank you for your reply!
BTW, can we say "ip routing" is only command to make layer2 switch become layer 3 switch?
07-21-2021 02:13 AM
You are welcome.
Yes you can say that ip routing is the only command that makes a layer 2 switch become a layer 3 switch. Once it is a layer 3 switch some other commands are probably needed. But the only thing involved in changing from L2 to L3 is whether ip routing is enabled or not.
07-21-2021 07:44 AM - edited 07-21-2021 07:45 AM
Yes, "ip routing" is the only command to turn that on. However, you still need routes. If it is in L2 mode, the "ip default-gateway" command is all you need as @Richard Burts correctly mentioned. What you need to do it put in a route statement so that the device has a default route before you turn on L3 routing. As an example, if now you have "ip default-gateway 10.1.1.1", you should enter "ip route 0.0.0.0 0.0.0.0 10.1.1.1" before "ip routing". I am guessing you are connecting to the device from a different IP network than where the management IP of the switch in question.
07-22-2021 01:01 PM
Thank you all for analysis.
BTW, in this case, SW1 is layer 3 switch and SW2 and SW3 are layer2 switch. If SW2 is configured as layer3 switch without other config change, what result it can cause?
07-23-2021 02:02 AM
You ask an interesting question. If a switch has been operating as a layer 2 switch (either sw2 or sw3) it may have multiple vlans defined but it will have only a single vlan interface configured. It forwards user traffic based on destination mac address. The switch will use "ip default-gateway" for the configured vlan interface to be able to communicate with remote subnets (respond to ping, etc). If you configure ip routing on the switch it has no impact on the switch forwarding user traffic based on destination mac address. But with no other config changes it will no longer user ip default-gateway and so will no longer be able to respond to ping from remote subnets. Adding a static default route would restore the ability to respond to ping etc.
07-23-2021 05:09 AM
The change you are talking about only affects the switch you are modifying. If you use an 'ip route' command to assign a default route the same as the 'ip default-gateway' so traffic to the management interface should work the same as before. The switch will only start doing actual IP routing when you have hosts directing traffic to it.
07-23-2021 03:14 PM
Hello @Leftz ,
you have received excellent explanations of the changes needed for restoring connectivity to/from remote IP subnets specially from @Richard Burts .
However , your original question looks like to be confined within VLAN 10
>>
But after adding command “ip routing” at SW3, the SW3 lost connection to SW1. Anyone can explain it? Thanks
SW3-------SW2-------SW1
SW3
Vlan10 10.1.1.3/24
Ip default-gateway 10.1.1.1
SW1
Vlan10 10.1.1.1/24
Even if SW3 with ip routing will ignore the ip default-gateway 10.1.1.1 command and it will need a default static route pointing to 10.1.1.1, this should not make SW3 unable to ping 10.1.1.1 as they are in the same VLAN 10 carried over the L2 trunks.
As suggested by @Elliot Dierksen you may have lost connection to SW3 if your telnet/SSH session was started from a host in a remote subnet.
to be noted to be able to reach remote subnets also SW1 must be a L3 switch with multiple SVI interface VLANs configured.
When ping within VLAN 10 if SW3 knows SW1 MAC address SW2 will act as a L2 switch ( even if it would be configured as L3)
Hope to help
Giuseppe
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: