VLAN实验
实验要求:
1.全网可达
2.PC通过DHCP获取地址
实验步骤:
1.判断广播域(有四个)
2.配置LSW1
[LSW1]vlan batch 10 20
[LSW1-GigabitEthernet0/0/1]port link-type access
[LSW1-GigabitEthernet0/0/1]port default vlan 10
[LSW1-GigabitEthernet0/0/2]port link-type access
[LSW1-GigabitEthernet0/0/2]port default vlan 20
[LSW1-GigabitEthernet0/0/3]port link-type trunk
[LSW1-GigabitEthernet0/0/3]port trunk allow-pass vlan 10 20
3.配置LSW2
[LSW2-GigabitEthernet0/0/1]port link-type access
[LSW2-GigabitEthernet0/0/1]port default vlan 10
[LSW2-GigabitEthernet0/0/1]int g 0/0/2
[LSW2-GigabitEthernet0/0/2]port link-type access
[LSW2-GigabitEthernet0/0/2]port default vlan 20
[LSW2-GigabitEthernet0/0/3]port link-type trunk
[LSW2-GigabitEthernet0/0/3]port trunk allow-pass vlan 10 20
- 配置R1
[R1]int g 0/0/0.10
[R1-GigabitEthernet0/0/0.10]ip add 192.168.1.254 24
[R1-GigabitEthernet0/0/0.10]dot1q termination vid 10
[R1-GigabitEthernet0/0/0.10]arp broadcast enable
[R1-GigabitEthernet0/0/0.10]q
[R1]int g 0/0/0.20
[R1-GigabitEthernet0/0/0.20]ip add 192.168.2.254 24
[R1-GigabitEthernet0/0/0.20]dot1q termination vid 20
[R1-GigabitEthernet0/0/0.20]arp broadcast enable
[R1]int g 0/0/1.10
[R1-GigabitEthernet0/0/1.10]ip add 192.168.3.254 24
[R1-GigabitEthernet0/0/1.10]dot1q termination vid 10
[R1-GigabitEthernet0/0/1.10]arp broadcast enable
[R1]int g 0/0/1.20
[R1-GigabitEthernet0/0/1.20]ip add 192.168.4.254 24
[R1-GigabitEthernet0/0/1.20]dot1q termination vid 20
[R1-GigabitEthernet0/0/1.20]arp broadcast enable
- 配置地址池
[R1]dhcp enable
[R1]ip pool 1
[R1-ip-pool-1]network 192.168.1.0 mask 24
[R1-ip-pool-1]gateway-list 192.168.1.254
[R1]ip pool 2
[R1-ip-pool-2]network 192.168.2.0 mask 24
[R1-ip-pool-2]gateway-list 192.168.2.154
[R1]ip pool 3
[R1-ip-pool-3]network 192.168.3.0 mask 24
[R1-ip-pool-3]gateway-list 192.168.3.254
[R1]ip pool 4
[R1-ip-pool-4]network 192.168.4.0 mask 24
[R1-ip-pool-4]gateway-list 192.168.4.254
[R1]display ip pool
- 调用地址池
[R1]int g 0/0/0.10
[R1-GigabitEthernet0/0/0.10]dhcp select global
[R1-GigabitEthernet0/0/0.10]int g 0/0/0.20
[R1-GigabitEthernet0/0/0.20]dhcp select global
[R1-GigabitEthernet0/0/0.20]int g 0/0/1.10
[R1-GigabitEthernet0/0/1.10]dhcp select global
[R1-GigabitEthernet0/0/1.10]int g 0/0/1.20
[R1-GigabitEthernet0/0/1.20]dhcp select global
5.测试