HCIP关于交换机vlan实验

实验要求:

HCIP关于交换机vlan实验_第1张图片

 搭建:

HCIP关于交换机vlan实验_第2张图片

 首先根据题意划分vlan 如图所示

sw1

[sw1-Ethernet0/0/2]port link-type acc
[sw1]vlan batch 2 to 6
[sw1-Ethernet0/0/2]port default vlan 2


[sw1]int e 0/0/3
[sw1-Ethernet0/0/3]por
[sw1-Ethernet0/0/3]port l
[sw1-Ethernet0/0/3]port link-t
[sw1-Ethernet0/0/3]port link-type h
[sw1-Ethernet0/0/3]port link-type hybrid 
[sw1-Ethernet0/0/3]po
[sw1-Ethernet0/0/3]port de
[sw1-Ethernet0/0/3]port d 
[sw1-Ethernet0/0/3]port un      
[sw1-Ethernet0/0/3]po     
[sw1-Ethernet0/0/3]port hy
[sw1-Ethernet0/0/3]port hybrid un
[sw1-Ethernet0/0/3]port hybrid untagged 2 4 5 6
                                        ^
Error: Unrecognized command found at '^' position.
[sw1-Ethernet0/0/3]port hybrid untagged vlan 2 4 5 6
[sw1-Ethernet0/0/3]port hybrid pvid vlan 3



[sw1-Ethernet0/0/2]int e 0/0/4
[sw1-Ethernet0/0/4]port link-type trunk 
[sw1-Ethernet0/0/4]port trunk all
[sw1-Ethernet0/0/4]port trunk allow-pass val
[sw1-Ethernet0/0/4]port trunk allow-pass vl 
[sw1-Ethernet0/0/4]port trunk allow-pass vlan 2 to 6

[sw1-Ethernet0/0/1]port link-type hybrid 
[sw1-Ethernet0/0/1]port hybrid tagged vlan 2
[sw1-Ethernet0/0/1]port hybrid untagged vlan 3 to 6

[sw1-Ethernet0/0/1]dis this
#
interface Ethernet0/0/1
 port hybrid tagged vlan 2
 port hybrid untagged vlan 3 to 6
#
return

sw2

[sw2-Ethernet0/0/2]port link-type access 
[sw2-Ethernet0/0/2]port default vlan 2

[sw2-Ethernet0/0/3]port link-type hybrid 
[sw2-Ethernet0/0/3]port hybrid untagged vlan 3 to 5
[sw2-Ethernet0/0/3]port hybrid pvid  vlan 4

[sw2-Ethernet0/0/1]port link-type trunk 
[sw2-Ethernet0/0/1]po
[sw2-Ethernet0/0/1]port t
[sw2-Ethernet0/0/1]port trunk all
[sw2-Ethernet0/0/1]port trunk allow-pass v
[sw2-Ethernet0/0/1]port trunk allow-pass vlan 
[sw2-Ethernet0/0/1]port trunk allow-pass vlan 2 to 6

sw3

[sw3]vlan batch 2 to 6

[sw3-Ethernet0/0/2]port link-type hybrid 
[sw3-Ethernet0/0/2]port hybrid untagged vlan 3 4 5  

[sw3-Ethernet0/0/2]port hybrid pvid vlan 5

[sw3-Ethernet0/0/3]port link-type hybrid
[sw3-Ethernet0/0/3]port hybrid pvid vlan 6
[sw3-Ethernet0/0/3]port hybrid  untagged vlan 3 6 


[sw3-Ethernet0/0/1]port link-type  trunk 
[sw3-Ethernet0/0/1]port trunk allow-pass vlan 2 to 6

在路由器上的虚拟链路0/0/0.1来控制vlan2  物理链路0/0/0 控制 vlan 3 to6   由于 3到6为一个网段,所以要将标签剥离并开启dhcp才能为同一网段

R1

[R1]int g 0/0/0.1
[R1-GigabitEthernet0/0/0.1]dot1q termination vid 2
[R1-GigabitEthernet0/0/0.1]arp v
[R1-GigabitEthernet0/0/0.1]arp b 
[R1-GigabitEthernet0/0/0.1]arp broadcast en
[R1-GigabitEthernet0/0/0.1]arp broadcast enable 
[R1-GigabitEthernet0/0/0.1]ip add 192.168.2.1 24

[R1-GigabitEthernet0/0/0]ip add 192.168.1.1 24

[R1]dis ip interface brief 
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 3
The number of interface that is DOWN in Physical is 2
The number of interface that is UP in Protocol is 3
The number of interface that is DOWN in Protocol is 2

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              192.168.1.1/24       up         up        
GigabitEthernet0/0/0.1            192.168.2.1/24       up         up        
GigabitEthernet0/0/1              unassigned           down       down      
GigabitEthernet0/0/2              unassigned           down       down      
NULL0                             unassigned           up         up(s)     

[R1]dhcp enable 
[R1]ip pool vlan2
[R1-ip-pool-vlan2]netw
[R1-ip-pool-vlan2]network 192.168.2.0 mask 24
[R1-ip-pool-vlan2]ga
[R1-ip-pool-vlan2]gateway-list 192.168.2.1
[R1-ip-pool-vlan2]q
[R1]ip p
[R1]ip poo               
[R1]ip pool v3to6
Info: It's successful to create an IP address pool.
[R1-ip-pool-v3to6]ne
[R1-ip-pool-v3to6]netw        
[R1-ip-pool-v3to6]network 192.168.1.0 mask 24
[R1-ip-pool-v3to6]ga
[R1-ip-pool-v3to6]gateway-list 192.168.1.1   
[R1-ip-pool-v3to6]q
[R1]int g0/0/0 
[R1-GigabitEthernet0/0/0]dhc
[R1-GigabitEthernet0/0/0]dhcp se
[R1-GigabitEthernet0/0/0]dhcp select gl
[R1-GigabitEthernet0/0/0]dhcp select global 
[R1-GigabitEthernet0/0/0]q
[R1]int g0/0/0.1
[R1-GigabitEthernet0/0/0.1]dhcp
[R1-GigabitEthernet0/0/0.1]dhcp se
[R1-GigabitEthernet0/0/0.1]dhcp select go
[R1-GigabitEthernet0/0/0.1]dhcp select gl
[R1-GigabitEthernet0/0/0.1]dhcp select global 

你可能感兴趣的:(HCIP)