HCIP第二次实验(vlan实验)
由题可分析 1和3 是一个vlan的 2一个vlan 4和 5一个vlan 6 一个vlan
具体看图如何配置
例如r1 上配置:
[sw1]vlan batch 2 to 5
[sw1-Ethernet0/0/1]port link-type access
[sw1-Ethernet0/0/1]port default vlan 2
[sw1-Ethernet0/0/2]port link-type hybrid
[sw1-Ethernet0/0/2]port hybrid untagged vlan 3 to 5
[sw1-Ethernet0/0/3]port link-type trunk
[sw1-Ethernet0/0/3]port trunk allow-pass vlan all
[sw1-GigabitEthernet0/0/1]port link-type hybrid
[sw1-GigabitEthernet0/0/1]port hybrid tagged vlan 2
[sw1-GigabitEthernet0/0/1]port hybrid untagged vlan 3 to 5
然后是路由器配置
[r1-GigabitEthernet0/0/0]ip address 192.168.1.1 24
[r1-GigabitEthernet0/0/0.1]ip address 192.168.2.1 24
[r1-GigabitEthernet0/0/0.1]dot1q termination vid 2
[r1-GigabitEthernet0/0/0.1]arp broadcast enable
[r1]ip pool a
[r1-ip-pool-a]network 192.168.1.0 mask 24
[r1-ip-pool-a]gateway-list 192.168.1.1
[r1-ip-pool-a]dns-list 4.4.4.4
[r1]ip pool b
[r1-ip-pool-b]network 192.168.2.0 mask 24
[r1-ip-pool-b]gateway-list 192.168.2.1
[r1-ip-pool-b]dns 4.4.4.4
[r1-GigabitEthernet0/0/0]dhcp select global
[r1-GigabitEthernet0/0/0.1]dhcp select global