2

setup

I want to enable inter-vlan routing on L3 switch. I have accomplished this by the following commands executed on Gig1/0/16 and Gig1/0/10 and setting the respective (192.168.x.1) as gateway on the devices belonging to vlan x. Then inter-vlan routing works.

ip routing

interface vlan 30

ip address 192.168.30.1 255.255.255.0

no shutdown

exit

interface vlan 20

ip address 192.168.20.1 255.255.255.0

no shutdown

exit

interface vlan 10

ip address 192.168.10.1 255.255.255.0

no shutdown

exit

interface vlan 99

ip address 192.168.99.1 255.255.255.0

no shutdown

exit

However in my script the professor uses an additional command

S1(config)#interface Fa0/40

S1(config-if)#no switchport

S1(config-if)#ip address 10.30.30.1 255.255.255.0

As I understand it one port should become a routing port and this port can then be used to route traffic between vlans via the L3 switch. But which port should I take? I tried it with Gig1/0/16 but it did not work.

1
  • 2
    You enable routing by running ip routing and configuring IP addresses on any combination of SVIs on VLANs or routed ports. End of story.
    – Zac67
    Mar 15 at 21:22

1 Answer 1

3

When IP routing is enabled (global ip routing command) on the layer-3 switch, it will default to route between the layer-3 SVIs. There is no reason to configure a different interface to be able to route between the VLANs.

The interface the instructor configured is to route from the layer-3 switch to another router.

You need to also create the VLANs with the global vlan <vlan number> (not the same as the SVI interface Vlan<vlan number>) command, and you need to have one or more interfaces up in each VLAN (switchport mode access and switchport access vlan <vlan number> interface commands) to activate each VLAN.

2
  • So in my setup the no switchport command is not necessary if all I want is to enable inter-vlan routing
    – Rubus
    Mar 15 at 21:26
  • Correct. Your SVIs are addressed as layer-3 virtual interfaces (you could also have layer-2 SVIs), and the no switchport command makes a layer-2 physical interface a layer-3 physical interface. IP routing defaults to routing between all properly addressed layer-3 interfaces. You would need to put in other configurations to block the default routing between the layer-3 interfaces.
    – Ron Maupin
    Mar 15 at 22:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.