需要两台交接机和PC机,同时将,交接机的1/0/1分别与PC联接
1# PC机IP:1.1.10.25/24 1.1.10.254
2#PC机IP:1.1.20.27/24 1.1.20.254

VLAN划分:10、20、30
VLAN网关:1.1.10.254/24、1.1.20.254/24
步骤一:创建VLAN 10 20 30,创建地址池,配置接口类型

1#
vlan 10
vlan 20 to 30
interface Vlan-interface10
ip address 1.1.10.254 255.255.255.0
#
interface Vlan-interface30
ip address 1.1.30.1 255.255.255.0
步骤二:交换机创建VLAN,配置上下联接口

interface GigabitEthernet1/0/1
port link-mode bridge
port access vlan 10
combo enable fiber
#
interface GigabitEthernet1/0/2
port link-mode bridge
port link-type trunk
port trunk permit vlan all
combo enable fiber
步骤三:增加静态路由
通过手工增加一条指向对方对接口的路由。

ip route-static 0.0.0.0 0 1.1.30.2
相同的配置将另外一台交接机进行不同vlan配置。
2#
vlan 10
#
vlan 20 to 30
interface Vlan-interface20
ip address 1.1.20.254 255.255.255.0
#
interface Vlan-interface30
ip address 1.1.30.2 255.255.255.0
interface GigabitEthernet1/0/1
port link-mode bridge
port access vlan 20
combo enable fiber
#
interface GigabitEthernet1/0/2
port link-mode bridge
port link-type trunk
port trunk permit vlan all
combo enable fiber
ip route-static 0.0.0.0 0 1.1.30.1
PC:配置网关 :1.1.20.254 255.255.255.0
PC客户端配置如下:


