PC1
ip 10.10.10.1 255.255.255.0 10.10.10.254
PC2
ip 20.20.20.1 255.255.255.0 20.20.20.254
PC3
ip 10.10.10.2 255.255.255.0 10.10.10.254
PC4
ip 20.20.20.2 255.255.255.0 20.20.20.254
ASW1
conf t
vlan 10
name v10
vlan 20
name v20
exit
int fa 3/0
switchport mode access
switchport access vlan 10
int fa 3/1
switchport mode access
switchport access vlan 20
int fa 3/2
switchport mode trunk
switchport trunk encapsulation dot1q
switchport trunk allowed vlan 1,10,20,1002-1005
int fa 3/3
switchport mode trunk
switchport trunk encapsulation dot1q
switchport trunk allowed vlan 1,10,20,1002-1005
ASW2
conf t
vlan 10
name v10
vlan 20
name v20
exit
int fa 3/0
switchport mode access
switchport access vlan 10
int fa 3/1
switchport mode access
switchport access vlan 20
int fa 3/2
switchport mode trunk
switchport trunk encapsulation dot1q
switchport trunk allowed vlan 1,10,20,1002-1005
int fa 3/3
switchport mode trunk
switchport trunk encapsulation dot1q
switchport trunk allowed vlan 1,10,20,1002-1005
DSW1
conf t
vlan 10
name v10
vlan 20
name v20
exit
int fa 3/2
switchport mode trunk
switchport trunk encapsulation dot1q
switchport trunk allowed vlan 1,10,20,1002-1005
int fa 3/3
switchport mode trunk
switchport trunk encapsulation dot1q
switchport trunk allowed vlan 1,10,20,1002-1005
int fa 3/14
switchport mode trunk
switchport trunk encapsulation dot1q
switchport trunk allowed vlan 1,10,20,1002-1005
spanning-tree vlan 10 root primary
spanning-tree vlan 20 root secondary
DSW2
conf t
vlan 10
name v10
vlan 20
name v20
exit
int fa 3/2
switchport mode trunk
switchport trunk encapsulation dot1q
switchport trunk allowed vlan 1,10,20,1002-1005
int fa 3/3
switchport mode trunk
switchport trunk encapsulation dot1q
switchport trunk allowed vlan 1,10,20,1002-1005
int fa 3/15
switchport mode trunk
switchport trunk encapsulation dot1q
switchport trunk allowed vlan 1,10,20,1002-1005
spanning-tree vlan 20 root primary
spanning-tree vlan 10 root secondary
R1
conf t
vlan 10
name v10
vlan 20
name v20
exit
int fa 3/14
switchport mode trunk
switchport trunk encapsulation dot1q
switchport trunk allowed vlan 1,10,20,1002-1005
int fa 3/15
switchport mode trunk
switchport trunk encapsulation dot1q
switchport trunk allowed vlan 1,10,20,1002-1005
int vlan 10
ip addr 10.10.10.254 255.255.255.0
no shu
int vlan 20
ip addr 20.20.20.254 255.255.255.0
no shu
int fa 0/0
ip addr 192.168.50.135 255.255.255.0
no shu
ip route 0.0.0.0 0.0.0.0 192.168.50.2
access-list 1 permit 10.10.10.0 0.0.0.255
access-list 1 permit 20.20.20.0 0.0.0.255
ip nat inside source list 1 int fa 0/0
int fa 0/0
ip nat outside
int vlan 10
ip nat inside
int vlan 20
ip nat inside