VLAN实验
- 拓扑图
- 配置和分析
- 分析
- 配置
- LSW1
- LSW2
- R1
- 测试
- dhcp获取ip
- ICMP测试
拓扑图
配置和分析
分析
从题目来看,因为 pc 1 3都是vlan2而且还是不同网段,pc 2 4 5 6在同一网段,所以可以将pc 1 2 5 4 6分在一个网段
pc4不通5 6 ,那就在5 6 的混杂接口上不允许4通过
配置
LSW1
pc1和pc3的接口正常配access就行了,LSW1与LSW2直接可以直接设置trunk干道允许所有
[LSW1-Ethernet0/0/1]port hybrid untagged vlan 3 to 6
[LSW1-Ethernet0/0/1]port hybrid tagged vlan 2
[LSW1-Ethernet0/0/4]port hybrid pvid vlan 3
[LSW1-Ethernet0/0/4]port hybrid untagged vlan 2 to 6
[LSW1-Ethernet0/0/6]port hybrid pvid vlan 4
[LSW1-Ethernet0/0/6]port hybrid untagged vlan 2 to 6
LSW2
[LSW2-Ethernet0/0/2]port hybrid pvid vlan 5
[LSW2-Ethernet0/0/2]port hybrid untagged vlan 2 3 5 只允许 2 3 5 通过
[LSW2-Ethernet0/0/3]port hybrid pvid vlan 6
[LSW2-Ethernet0/0/3]port hybrid untagged vlan 2 3 6 只允许 2 3 6 通过
[LSW2]int e0/0/1
[LSW2-Ethernet0/0/1]port link-type trunk
[LSW2-Ethernet0/0/1]port trunk allow-pass vlan 2 to 6 干道可以直接允许所有
[LSW1]int e0/0/2
[LSW1-Ethernet0/0/2]port link-type trunk
[LSW1-Ethernet0/0/2]port trunk allow-pass vlan 2 to 6
R1
[R1]ip pool 1
Info: It's successful to create an IP address pool.
[R1-ip-pool-1]network 192.168.1.0 mask 24
[R1-ip-pool-1]gateway-list 192.168.1.1
[R1-ip-pool-1]ip pool 2
Info: It's successful to create an IP address pool.
[R1-ip-pool-2]network 192.168.2.0 mask 24
[R1-ip-pool-2]gateway-list 192.168.2.1
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip address 192.168.1.1 24
[R1-GigabitEthernet0/0/0]dhcp select global
[R1]int g0/0/0.1
[R1-GigabitEthernet0/0/0.1]dot1q termination vid 2 这个给pc3的vlan 2
[R1-GigabitEthernet0/0/0.1]ip address 192.168.2.1 24
[R1-GigabitEthernet0/0/0.1]arp broadcast enable 注意这个命令不要忘了,子接口是不能发广播的所以要手动开启arp广播
[R1-GigabitEthernet0/0/0.1]dhcp select global
测试
dhcp获取ip
ICMP测试
pc2通 pc 4 5 6
pc 4 不通pc 5 6
pc 5 不通pc 6