A switch virtual interface (SVI) is a VLAN of switch ports represented by one interface to a routing or bridging system. There is no physical interface for the VLAN and the SVI provides the Layer 3 processing for packets from all switch ports associated with the VLAN.
How Switch virtual interface SVI works:
This is much simpler than inter VLAN, but disadvantage is high cost of a layer-3 switch.
In SVI configuration we need a layer-3 switch, I use a 3640 router IOS and use the NM-16ESW module for layer-3 switching. The topology I used for switch virtual interface (SVI) is consist of one switch and two hosts one of them is in VLAN 10 and other is in VLAN 20. I have create two switch virtual interface s(SVI) on switch for VLAN 10 and 20, which are responsible for communicating these two VLANs.
Configuration for Switch:
SW#vlan database
SW(vlan)#vlan 10 name office1
SW(vlan)#vlan 20 name office2
SW(vlan)#exit
SW(config-if)#interface vlan 10
SW(config-if)#ip address 10.1.1.1 255.255.255.0
SW(config-if)#no shu
SW(config-if)#interface vlan 20
SW(config-if)#ip address 20.1.1.1 255.255.255.0
SW(config-if)#exit
SW(config)#ip routing
SW(config-if)#interface f0/0
SW(config-if)#no shutdown
SW(config-if)# switchport mode access
SW(config-if)# switchport access vlan 10
SW(config-if)#interface f0/1
SW(config-if)#no shutdown
SW(config-if)#switchport mode access
SW(config-if)# switchport access vlan 20
Configuration for Qemu1
tc@box:$ sudo su
root@box:$ Ifconfig eth0 10.1.1.2 netmask 255.255.255.0
root@box:$ Ifconfig eth0 10.1.1.2 netmask 255.255.255.0
root@box:$ Route add default gw 10.1.1.1 eth0
Configuration for Qemu2
tc@box:$ sudo su
root@box:$ Ifconfig eth0 20.1.1.2 netmask 255.255.255.0
root@box:$ Ifconfig eth0 20.1.1.2 netmask 255.255.255.0
root@box:$ Route add default gw 20.1.1.1 eth0
Results:
Ping from qemu1 to qemu2 is successful and voice versa.
Thanks.
hi i m your biggest fan... i like your blog..
ReplyDeletethis is very informative .. appreciate.. Superb...
and thanks again ..
keep it up..
thank you so much.. :)
ReplyDeletebud
ReplyDeleteunable to ping qemu1 to qemu2 host
ReplyDeletethat's a good one so far do you have any switch topology for Juniper
ReplyDeleteThanks
@(unable to ping qemu1 to qemu2 host)
ReplyDeleteMake sure u have completed above configuration and create SVI for yr VLANs .. thanks
Struggled a bit at first then noticed I missed the IP routing command issued at the global config mode. Works now.
Delete@ (that's a good one so far do you have any switch topology for Juniper)
ReplyDeletethanks for visiting, i ll create such lab in near future..
hi author, i got through all the procedures you are showing here however, when i got to this point:
ReplyDeleteSW(config-if)#interface f0/0
SW(config-if)#no shutdown
SW(config-if)# switchport mode access
there is no such command as switchport...! i tried this SW(config-if)# ? and SW(config-if)#sw? but theres none. What have i done wrong, i used the same image for 3640 you specified in your ealier post. I would greatly appreciate your help. thanks
please make sure you have use NM-16ESW module...!
Deleteyou know i typed all the configurations, but till now the 2 pcs are not reachable
ReplyDeleteit's not ever reading the gateway
ReplyDeleteu r surly missing something..kindly check again.
Deletewhat if we used 2 switches, each vlan in different switch , how the configuration looks like?
ReplyDeleteNice lab, I was able to ping GWs and hosts.
ReplyDeleteThx
-DP
There is no command like "ip routing" enabled in global config mode for inter vlan routing to happen
ReplyDeleteThe command is not shown here .. Its not 6509 e where the command is implicitly present and no need to configure
thank for the great job
ReplyDelete