Provide Layer 3 connectivity by using Switch Virtual Interface

Requirements
  • GNS3
  • Cisco IOS image(c3725-adventerprisek9-mz.124-15.T5 in this example)
  • NM-16ESW switching module for EtherSwitch
Topology

SVI

PC Setting

On PC1

PC1(config)#no ip routing
PC1(config)#ip default-gateway 192.168.20.254
PC1(config)#interface fastEthernet 0/0
PC1(config-if)#ip address 192.168.10.1 255.255.255.0
PC1(config-if)#no shutdown

On PC2

PC2(config)#no ip routing
PC2(config)#ip default-gateway 192.168.20.254
PC2(config)#interface fastEthernet 0/0
PC2(config-if)#ip address 192.168.20.1 255.255.255.0
PC2(config-if)#no shutdown
Switch Setting

Add vlan

ESW1(config)#ip routing
ESW1(config)#vlan 10
ESW1(config-vlan)#exit
ESW1(config)#vlan 20
ESW1(config-vlan)#exit

Configure access mode

ESW1(config)#interface fastEthernet 1/1
ESW1(config-if)#switchport mode access
ESW1(config-if)#switchport access vlan 10
ESW1(config-if)#exit
ESW1(config)#interface fastEthernet 1/2
ESW1(config-if)#switchport mode access
ESW1(config-if)#switchport access vlan 20
ESW1(config-if)#exit

Add a default gateway for the VLAN

ESW1(config)#interface vlan 10
ESW1(config-if)#ip address 192.168.10.254 255.255.255.0
ESW1(config-if)#exit
ESW1(config)#interface vlan 20
ESW1(config-if)#ip address 192.168.20.254 255.255.255.0
ESW1(config-if)#exit

Check vlan setting

ESW1#show ip interface brief
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet1/1            unassigned      YES unset  up                    up
FastEthernet1/2            unassigned      YES unset  up                    up
...
Vlan1                      unassigned      YES NVRAM  administratively down down
Vlan10                     192.168.10.254  YES manual up                    up
Vlan20                     192.168.20.254  YES manual up                    up
Test connectivity

From PC2

PC2#ping 192.168.10.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.10.1, timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 108/354/1056 ms
Save configuration
ESW1#write
Building configuration...
[OK]
Show Comments