HCIP之路---vlan实验

HCIP之路---vlan实验_第1张图片

先在每个交换机上都创建vlan 2 3 4 5 6

1、pc2/4/5/6同一网段,pc1/3与2/4/5/6不在同一网段

设置1/3 --- 192.168.1.0/24

2/4/5/6 --- 192.168.2.0/24

sw1上配置

[SW1-GigabitEthernet0/0/3]dis this
#
interface GigabitEthernet0/0/3
 port link-type access
 port default vlan 2
#
return

[SW1-GigabitEthernet0/0/4]dis this
#
interface GigabitEthernet0/0/4
 port hybrid pvid vlan 3
 port hybrid tagged vlan 3
 port hybrid untagged vlan 4 to 6
#
return

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

[SW1-GigabitEthernet0/0/2]dis this
#
interface GigabitEthernet0/0/2
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094
#
return

sw2

[SW2]int g 0/0/1
[SW2-GigabitEthernet0/0/1]dis this
#
interface GigabitEthernet0/0/1
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094
#
return

[SW2-GigabitEthernet0/0/2]dis this
#
interface GigabitEthernet0/0/2
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094
#
return

[SW2-GigabitEthernet0/0/3]dis this
#
interface GigabitEthernet0/0/3
 port link-type access
 port default vlan 2
#
return

[SW2-GigabitEthernet0/0/4]dis this
#
interface GigabitEthernet0/0/4
 port hybrid pvid vlan 4
 port hybrid tagged vlan 4
 port hybrid untagged vlan 3 6
#
return

sw3

[SW3-GigabitEthernet0/0/1]dis this
#
interface GigabitEthernet0/0/1
 port link-type trunk
 port trunk allow-pass vlan 2 to 6
#
return

[SW3-GigabitEthernet0/0/2]dis this
#
interface GigabitEthernet0/0/2
 port hybrid pvid vlan 5
 port hybrid tagged vlan 5
 port hybrid untagged vlan 3
#
return

[SW3-GigabitEthernet0/0/3]dis this
#
interface GigabitEthernet0/0/3
 port hybrid pvid vlan 6
 port hybrid tagged vlan 6
 port hybrid untagged vlan 2 to 4
#
return

2、

R1

[R1-GigabitEthernet0/0/0]dis this
[V200R003C00]
#
interface GigabitEthernet0/0/0
 ip address 192.168.2.1 255.255.255.0
 dhcp select global
#
return

[R1-GigabitEthernet0/0/0.1]dis this
[V200R003C00]
#
interface GigabitEthernet0/0/0.1
 dot1q termination vid 2
 ip address 192.168.1.1 255.255.255.0
 arp broadcast enable
 dhcp select global
#
return

pc1

HCIP之路---vlan实验_第2张图片

pc2

HCIP之路---vlan实验_第3张图片

pc3

HCIP之路---vlan实验_第4张图片

pc4

HCIP之路---vlan实验_第5张图片

pc5

HCIP之路---vlan实验_第6张图片

pc6

HCIP之路---vlan实验_第7张图片

测试

pc2可以访问4/5/6

HCIP之路---vlan实验_第8张图片

HCIP之路---vlan实验_第9张图片

pc4可以访问5,不能访问6

HCIP之路---vlan实验_第10张图片

HCIP之路---vlan实验_第11张图片

pc5不能访问6

HCIP之路---vlan实验_第12张图片

pc1/3可以访问2/4/5/6

HCIP之路---vlan实验_第13张图片

HCIP之路---vlan实验_第14张图片

你可能感兴趣的:(网络)