My home server has two interfaces named eth0 and eth1. eth0 is connected directly to an incoming WAN port, so the gateway of eth0 depends on the ISP's DHCP server. eth1 is connected to a router in my house, which is connected to another WAN port.
Below is the output of netstat -rn (with public addresses modified):
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
0.0.0.0 111.111.111.126 0.0.0.0 UG 0 0 0 eth0
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
111.111.111.126 0.0.0.0 255.255.255.128 U 0 0 0 eth0
What I need to do is being able to make outgoing connection with both interfaces to any public IP addresses, plus making one of the interfaces as a default one if there is no specified interface. For instance, curl www.google.com --interface eth1 fails in the current configuration. route add default gw 192.168.0.1 fixes that, but then curl www.google.com --interface eth0 breaks.