对的,这是可能的。
您做错了什么,很可能是在路由器上标记帧,但中继将 VLAN 1 设为本机。
要确认您使用的中继设置:
show interfaces trunk
我喜欢保持子接口 ID 与 VLAN 编号匹配,尽管这不是必需的。使用如下配置:
! Switch
! Port to Laptop
interface Fax/x
switchport mode access
switchport access vlan 1
spanning-tree portfast
description Port to PC
! Port to Netgear
interface Fax/x
switchport mode access
switchport access vlan 1
spanning-tree portfast
description Port to Netgear
! Port to Cisco router
interface Fax/x
switchport trunk encapsulation dot1q
switchport mode trunk
spanning-tree portfast trunk
description port to Cisco router
对于路由器:
! Router
! Port to switch
interface E0/0.1
encapsulation dot1q 1 native
ip add 192.168.0.70 255.255.255.0
description VLAN1 to Netgear
interface E0/0.10
encapsulation dot1q 10
ip add 192.168.10.70 255.255.255.0
description VLAN10
interface E0/0.20
encapsulation dot1q 20
ip add 192.168.20.70 255.255.255.0
description VLAN20
ip routing
ip route 0.0.0.0 0.0.0.0 192.168.0.1
显然,将 IP 替换为子网中所需的 IP。