使用策略路由
比如陵袜慧vlan 10
ip access-list extended vlan10_gateway
permit ip 192.168.1.0 0.0.0.255 any
route-map routemap_vlan10
match ip vlan10_gateway
set ip next-hop 1.1.1.2 //尺答(s0/0/0的对端地址)
比如vlan20
ip access-list extended vlan20_gateway
permit ip 172.16.0.0 0.0.0.255 any
route-map routemap_vlan20
match ip vlan20_gateway
set next-hop 2.2.2.1 //(s0/0/1的对端地址)
#在子接口中绑好滚定route-map
int f0.1
ip policy route-map routemap_vlan10
interface f0.2
ip policy route-map routemap_vlan20