#!/bin/sh
ip rule add from x.y.z.a lookup eth1
ip rule add to x.y.z.a lookup eth1
ip rule add from x.y.z.b lookup eth2
ip rule add to x.y.z.b lookup eth2
ip route flush table eth1
ip route add x.y.z.a dev eth1 scope link table eth1
ip route add x.y.z.0/26 dev eth1 proto kernel scope link src x.y.z.a table eth1
ip route add default via x.y.z.1 dev eth1 table eth1
ip route flush table eth2
ip route add x.y.z.b dev eth1 scope link table eth2
ip route add x.y.z.0/26 dev eth2 proto kernel scope link src x.y.z.b table eth2
ip route add default via x.y.z.1 dev eth2 table eth2