2x Cisco 2960 Switch
6x PC (2 PC/VLAN)
1x Cisco 2811 Router
Router (192.168.1.1/24)
|
| Trunk
|
Switch1 (Trunk) -------- Switch2 (Trunk)
| |
| |
VLAN 10: VLAN 20:
- PC1 (192.168.10.10/24) - PC3 (192.168.20.10/24)
- PC2 (192.168.10.11/24) - PC4 (192.168.20.11/24)
VLAN 30:
- PC5 (192.168.30.10/24)
- PC6 (192.168.30.11/24)
| Thiết bị | VLAN | IP Address | Subnet Mask | Gateway |
|---|---|---|---|---|
| PC1 | 10 | 192.168.10.10 | 255.255.255.0 | 192.168.10.1 |
| PC2 | 10 | 192.168.10.11 | 255.255.255.0 | 192.168.10.1 |
| PC3 | 20 | 192.168.20.10 | 255.255.255.0 | 192.168.20.1 |
| PC4 | 20 | 192.168.20.11 | 255.255.255.0 | 192.168.20.1 |
| PC5 | 30 | 192.168.30.10 | 255.255.255.0 | 192.168.30.1 |
| PC6 | 30 | 192.168.30.11 | 255.255.255.0 | 192.168.30.1 |
Switch1>enable
Switch1#configure terminal
Switch1(config)#vlan 10
Switch1(config-vlan)#name VLAN10_Management
Switch1(config-vlan)#exit
Switch1(config)#vlan 20
Switch1(config-vlan)#name VLAN20_Users
Switch1(config-vlan)#exit
Switch1(config)#vlan 30
Switch1(config-vlan)#name VLAN30_Guests
Switch1(config-vlan)#exit
Switch1(config)#interface FastEthernet0/1
Switch1(config-if)#switchport mode access
Switch1(config-if)#switchport access vlan 10
Switch1(config-if)#exit
Switch1(config)#interface FastEthernet0/2
Switch1(config-if)#switchport mode access
Switch1(config-if)#switchport access vlan 10
Switch1(config-if)#exit
Switch1(config)#interface FastEthernet0/3
Switch1(config-if)#switchport mode access
Switch1(config-if)#switchport access vlan 20
Switch1(config-if)#exit
Switch1(config)#interface FastEthernet0/24
Switch1(config-if)#switchport mode trunk
Switch1(config-if)#switchport trunk allowed vlan 10,20,30
Switch1(config-if)#exit
PC1> ping 192.168.10.11 # Ping từ PC1 đến PC2 (cùng VLAN 10)
PC3> ping 192.168.20.11 # Ping từ PC3 đến PC4 (cùng VLAN 20)
PC5> ping 192.168.30.11 # Ping từ PC5 đến PC6 (cùng VLAN 30)
PC1> ping 192.168.20.10 # Ping từ PC1 đến PC3 (khác VLAN)
PC1> ping 192.168.30.10 # Ping từ PC1 đến PC5 (khác VLAN)
Switch1#show vlan brief
Switch1#show interfaces trunk
Switch1#show interfaces status