I'm trying to set up proper networking on Ubuntu 12.04 LTS with 4 ethernet connections. Each connection is on a different subnet and two of the subnets are connected to other subnets. For example, one ethernet port is connected to the 192.168.2.x subnet and can also reach the 192.168.4.x subnet on that connection.
I'm successfully setting up static IP addresses, gateways, etc. However, connections from outside a subnet (i.e. a VPN on the 192.168.2.x subnet) always go out on the default gateway. When that default gateway is not the gateway for that particular subnet, the external VPN connections fail.
I've had some luck using iproute to create some functionality, but I'm in the dark about the best approach to resolving the issue in a long-term way.