vlan间路由
通过三层设备路由,使得不同的vlan间可以互相通信,但是仅仅允许单播通信
vlan间路由的方式:单臂路由 SVI(交换虚接口)
单臂路由
PC1
int g0/0
ip add 192.168.10.1 24
ip route-s 0.0.0.0 0.0.0.0 192.168.10.254 缺省路由可以发到任何路由(指目的ip和掩码全为0)且经过网关192.168.10.254
PC2
in g0/0
ipp add 192.168.20.1 24
ip route-s 0.0.0.0 0.0.0.0 192.168.20.254
in g0/0
undo shutdown 创建子接口前将物理接口in g0/0 undo shutdown
quit
in g0/0.10
ip add 192.168.10.254 24 子接口的IP为PC的网关
vlan-type dot1q vid 10 设置这个接口为哪个vlan服务
in g0/0.20
ip add 192.168.20.254 24
vlan-type dot1q vid 20
sw1
vlan 10 20
in g0/2
port link-type access
port access vlan 10
ing 0/3
port access vlan 20
in g0/1
port link-type trunk
port trunk permit vlan 10 20
R1
int g0/0
undo shutdown
in g0/0.10
ip add 192.168.10.1 24
vlan-type dot1q vid 10
in g0/0.20<