图中PC1,PC3在vlan2,PC2在vlan3,PC4,PC5在vlan4,PC6在vlan5中,PC1,PC3所在接口为access。由分析知PC2,PC4,PC5,PC6所在接口为hybrid,交换机与路由器之间为hybrid,交换机与交换机之间为trunk
步骤:
1.交换机上创建VLAN
2.交换机上各接口划分到对应vlan
3.trunk干道
4.vlan间路由-----路由器子接口(单臂路由)
Sw1:
Sw2:
Sw3:
R1:
[r1-GigabitEthernet0/0/0.1]int g0/0/0
[r1-GigabitEthernet0/0/0]ip address 192.168.2.1 24
[r1]int g0/0/0.1
[r1-GigabitEthernet0/0/0.1]dot1q termination vid 2
[r1-GigabitEthernet0/0/0.1]arp broadcast enable
[r1-GigabitEthernet0/0/0.1]ip address 192.168.1.1 24
做DHCP地址池
[r1]dhcp enable
[r1]ip pool v2
[r1-ip-pool-v2]network 192.168.1.0 mask 24
[r1-ip-pool-v2]gateway-list 192.168.1.1
[r1-ip-pool-v2]dns-list 114.114.114.114
[r1-ip-pool-v2]q
[r1]ip pool v3
[r1-ip-pool-v3]network 192.168.2.0 mask 24
[r1-ip-pool-v3]gateway-list 192.168.2.1
[r1-ip-pool-v3]dns-list 114.114.114.114
[r1-ip-pool-v3]q
[r1]int g0/0/0.1
[r1-GigabitEthernet0/0/0.1]dhcp select global
[r1-GigabitEthernet0/0/0.1]int g0/0/0
[r1-GigabitEthernet0/0/0]dhcp select global
5.测试