how to mark connections to route multiple gateways?
Routing does not work at the port level, it only looks at the IP address.
What you can do is use iptables to mark packets and then use policy based routing to pick a different routing table.
Something like:
# iptables -A OUTPUT -t udp --dport 5160 -d 10.10.10.1 -t mangle -j MARK --set-mark 1
# echo 201 sip.out >> /etc/iproute2/rt_tables
# ip rule add fwmark 1 table sip.out
# ip route add 10.10.10.1 via 10.1.5.101 dev eth0:1 table sip.out
# ip route add 10.10.10.1 via 10.1.5.105 dev eth0:2
Examples of how can be found here