hcip课的VLAN 实验

hcip课的VLAN 实验_第1张图片
要求如图,那么先分配一下vlan
hcip课的VLAN 实验_第2张图片
接下来,配置交换机

首先需要在sw1-3上创建vlan2到vlan6 (略)

先配置sw1:
[sw1]interface Ethernet0/0/1
[sw1-Ethernet0/0/1]p l a
[sw1-Ethernet0/0/1]port default vlan 2
[sw1-Ethernet0/0/1]int e 0/0/2
[sw1-Ethernet0/0/2]p l h
[sw1-Ethernet0/0/2]port hybrid pvid vlan 3
[sw1-Ethernet0/0/2]port hybrid untagged vlan 2 to 6
[sw1-Ethernet0/0/2]int
[sw1-Ethernet0/0/2]int g 0/0/2
[sw1-GigabitEthernet0/0/2]p l t
[sw1-GigabitEthernet0/0/2]port trunk allow-pass vlan all

sw2:
[sw2]int g 0/0/1
[sw2-GigabitEthernet0/0/1]p l t
[sw2-GigabitEthernet0/0/1]port trunk allow-pass vlan all
[sw2-GigabitEthernet0/0/1]int e 0/0/1
[sw2-Ethernet0/0/1]p l a
[sw2-Ethernet0/0/1]port default vlan 2
[sw2-Ethernet0/0/1]int e 0/0/2
[sw2-Ethernet0/0/2]p l h
[sw2-Ethernet0/0/2]port hybrid untagged vlan 2 to 5
[sw2-Ethernet0/0/2]int g 0/0/2
[sw2-GigabitEthernet0/0/2]p l t
[sw2-GigabitEthernet0/0/2]port trunk allow-pass vlan all
[sw2-GigabitEthernet0/0/2]

sw3:
[sw3]interface g 0/0/2
[sw3-GigabitEthernet0/0/2]p l t
[sw3-GigabitEthernet0/0/2]port trunk allow-pass vlan all
[sw3-GigabitEthernet0/0/2]int e 0/0/1
[sw3-Ethernet0/0/1]p l h
[sw3-Ethernet0/0/1]port hybrid pvid vlan 5
[sw3-Ethernet0/0/1]port hybrid untagged vlan 2 to 5
[sw3-Ethernet0/0/1]int e 0/0/2
[sw3-Ethernet0/0/2]p l h
[sw3-Ethernet0/0/2]port hybrid pvid vlan 6

接着在配置一下sw1上的 g0/0/1:
[sw1]int g 0/0/1
[sw1-GigabitEthernet0/0/1]p l h
[sw1-GigabitEthernet0/0/1]port hybrid untagged vlan 3 to 6
[sw1-GigabitEthernet0/0/1]port hybrid tagged vlan 2

然后配置DHCP:

[r1]dhcp enable
Info: The operation may take a few seconds. Please wait for a moment.done.
[r1]ip pool xbox
Info: It’s successful to create an IP address pool.
[r1-ip-pool-xbox]network 192.168.1.0 mask 255.255.255.0
[r1-ip-pool-xbox]gateway-list 192.168.1.254
[r1-ip-pool-xbox]dns-list 114.114.114.114 8.8.8.8
[r1-ip-pool-xbox]q
[r1]ip pool playstation
Info: It’s successful to create an IP address pool.
[r1-ip-pool-playstation]network 192.168.2.0 mask 255.255.255.0
[r1-ip-pool-playstation]gateway-list 192.168.2.254
[r1-ip-pool-playstation]dns-list 114.114.114.114 8.8.8.8
[r1-ip-pool-playstation]q
[r1]interface GigabitEthernet 0/0/0.1
[r1-GigabitEthernet0/0/0.1]dot1q termination vid 2
[r1-GigabitEthernet0/0/0.1]ip add 192.168.1.254 24
[r1-GigabitEthernet0/0/0.1]dhcp select global
r1-GigabitEthernet0/0/0.1]arp broadcast enable
[r1-GigabitEthernet0/0/0.1]int g 0/0/0
[r1-GigabitEthernet0/0/0]ip add 192.168.2.254 24
[r1-GigabitEthernet0/0/0]dhcp select global

设置电脑自动获取ip:
hcip课的VLAN 实验_第3张图片
hcip课的VLAN 实验_第4张图片

hcip课的VLAN 实验_第5张图片
hcip课的VLAN 实验_第6张图片
hcip课的VLAN 实验_第7张图片
hcip课的VLAN 实验_第8张图片
ping一下
hcip课的VLAN 实验_第9张图片

hcip课的VLAN 实验_第10张图片
hcip课的VLAN 实验_第11张图片
大概…做完了吧

你可能感兴趣的:(hcip课的VLAN 实验)