The first time I worked on a layer 3 switch I went to go an configure OSPF on the layer 3 switch or also called a “swouter”.
When I ran “router ospf 1” then command line spit back this error: “IP routing not enabled”. You can see the screenshot below of the error:
It turns out that Layer 3 switches need to have routing enabled because it is disabled by default! But what is the command to enable routing on the layer 3 switch?
The command is:
ip routing
Yes. That’s all it takes to enable routing on the layer 3 switch! Once you have done that you should be able to finish setting up OSPF or any other routing protocol you wish!
In packet tracer the layer 3 switch I used was a “3560-24PS”.
Here’s an example of a layer 3 switch being setup:
- en
- conf t
- ip routing
- host 4.4.4.4
- !
- int lo0
- ip address 4.4.4.4 255.255.255.255
- no shut
- !
- int vlan1
- ip address 192.168.2.2 255.255.255.252
- no shut
- !
- int vlan30
- ip address 192.168.30.1 255.255.255.0
- no shut
- !
- int vlan40
- ip addres 192.168.40.1 255.255.255.0
- no shut
- !
- int fa0/1
- switchport access vlan 30
- !
- int fa0/2
- switchport access vlan 40
- !
- int gig0/1
- switchport access vlan 1
- !
- exit
- !
- router ospf 1
- router-id 4.4.4.4
- !
- network 4.4.4.4 0.0.0.0 area 2
- network 192.168.2.2 0.0.0.0 area 2
- network 192.168.30.1 0.0.0.0 area 2
- network 192.168.40.1 0.0.0.0 area 2\
- end
- wr
- !
Leave a Reply