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
pc2
pc3
pc4
pc5
pc6
测试
pc2可以访问4/5/6
pc4可以访问5,不能访问6
pc5不能访问6
pc1/3可以访问2/4/5/6