当前位置:网站首页>Switch basic experiment

Switch basic experiment

2022-07-01 12:12:00 Caker

The experimental requirements

 Insert picture description here

 According to the title requirements 
1、pc1  and  PC3 The interface is access,pvlan  vlan2;

   pc2/4/5/6 In the same network segment ; among pc2 You can visit pc4/5/6;

    but pc4 You can visit pc5, Cannot access pc6.

2、pc5 Cannot access pc6
 So divide 4 individual vlan
PC1 and PC3 stay VLAN2, Use access Interface 

PC2 stay VLAN3, Use hybrid Interface 

PC4/5 stay VLAN4, Use hybrid Interface 

PC6 stay VLAN5, Use hybrid Interface 

The planning is completed as shown in the figure
 Insert picture description here

The experimental steps

1、 Create... On the switch vlan

stay SW1 On

[sw1]vlan batch 2 to 5

stay SW2 On

[sw1]vlan batch 2 to 5

stay SW3 On

[sw1]vlan batch 2 to 5

2、 Each interface on the switch is divided into corresponding interfaces vlan in

stay SW1 On

[sw1]int e0/0/3
[sw1-Ethernet0/0/3]port link-type access 
[sw1-Ethernet0/0/3]port default vlan 2

[sw1]int e0/0/4
[sw1-Ethernet0/0/4]port hybrid pvid vlan 3
[sw1-Ethernet0/0/4]port hybrid untagged vlan 3 to 5

stay SW2 On

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

[sw2]int e0/0/4
[sw2-Ethernet0/0/4]port hybrid pvid vlan 4
[sw2-Ethernet0/0/4]port hybrid untagged vlan 3 to 4

stay SW3 On


[sw3]int e0/0/2
[sw3-Ethernet0/0/2]port hybrid pvid vlan 4
[sw3-Ethernet0/0/2]port hybrid untagged vlan 3 to 4

[sw3]int e0/0/3
[sw3-Ethernet0/0/3]port hybrid pvid vlan 5
[sw3-Ethernet0/0/3]port default vlan 3 5

3、 trunk main rd

stay SW1 On

[sw1]int e0/0/2
[sw1-Ethernet0/0/2]port link-type trunk 
[sw1-Ethernet0/0/2]port trunk allow-pass vlan all 

stay SW2 On

[sw2]int e0/0/1
[sw2-Ethernet0/0/1]port link-type trunk 
[sw2-Ethernet0/0/1]port trunk allow-pass vlan all 

[sw2]int e0/0/2
[sw2-Ethernet0/0/2]port link-type trunk 
[sw2-Ethernet0/0/2]port trunk allow-pass vlan all 

stay SW3 On

[sw3]int e0/0/1
[sw3-Ethernet0/0/1]port link-type trunk 
[sw3-Ethernet0/0/1]port trunk allow-pass vlan all 

4、 DHCP obtain IP

route DHCP The pool is built , stay g0/0/0 Interface matching VLAN3/4/5,g0/0/0.1 matching vlan2
To configure DHCP pond

[r2]dhcp enable 
[r2]ip pool v2
[r2-ip-pool-v2]gateway-list 192.168.1.1
[r2-ip-pool-v2]network 192.168.1.0 mask 24

[r2]ip pool v345
[r2-ip-pool-v345]gateway-list 192.168.2.1
[r2-ip-pool-v345]network 192.168.2.0 mask 24

although vlan3/4/5 Of vlan Different , But they 3 Is the same broadcast domain , So match directly with a physical interface
vlan2 Directly use sub interface to identify tag matching

[r2]int g0/0/0
[r2-GigabitEthernet0/0/0]ip address 192.168.2.1 255.255.255.0
[r2-GigabitEthernet0/0/0]dhcp select global 

[r2]int g0/0/0.1
[r2-GigabitEthernet0/0/0.1]dot1q termination vid 2
[r2-GigabitEthernet0/0/0.1]arp broadcast enable 
[r2-GigabitEthernet0/0/0.1]dhcp select global 

stay SW1 The hybrid interface used on is vlan2 tagging

[sw1]int e0/0/1
[sw1-Ethernet0/0/1]port hybrid tagged vlan 2
[sw1-Ethernet0/0/1]port hybrid untagged vlan 3 to 5

adopt ipconfig Command view ip
With PC2 For example
 Insert picture description here

5. Test connectivity

PC2 visit PC1
 Insert picture description here
PC2 visit PC3
 Insert picture description here
PC2 visit PC4
 Insert picture description here

PC2 visit PC5
 Insert picture description here

PC2 visit PC6
 Insert picture description here
PC4 You can visit PC5, Cannot access PC6
PC4 visit PC5
 Insert picture description here
PC4 visit PC6
 Insert picture description here

原网站

版权声明
本文为[Caker]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202160033094106.html