I was looking at bringing up an interface like this in /etc/network/interfaces (this is on debian), with the gateway outside the subnet:iface eth0 inet staticaddress 10.100.10.99netmask 255.255.255.0gateway 10.100.0.1but ifup --verbose eth0 only gives me this error message:ifconfig eth0 10.100.10.99 netmask 255.255.255.0 route add default gw 10.100.0.1  eth0SIOCADDRT: No such processFailed to bring up eth0Of course, changing the netmask to 255.255.0.0 works just fine.Is that even possible, or is there something else that's the problem? Is there a way to get more information out of ifup?  I see one post on the internet that suggests it should work.
does the gateway have to be on the subnet?
networking
Another way of approaching this question is: if you can't reach your default-gateway router on a local network, how do you send packets through it?  You'd have to send them through another router.For some background, remember that an IP packet typically contains the source and destination addresses: where it comes from, and where it wants to go.  It's usually up to the routers to decide how it gets there.So when you send your IP packet through your off-network default gateway router, one of two things would need to happen.The local-network router knows how to reach the default-gateway router, and it agrees with your idea that your packet should be sent through the default-gateway router to get to its destination.  In that case, why not just use the local-network router as your default gateway?The local-network router thinks (by default) that your packet should be sent through some other router to get to its destination.  In this case you have to have some way to tell it otherwise.  This capability exists, and is called source routing... but it is considered a security risk, and most routers are configured to ignore it.Finally, in my experience, the Linux iproute (ip) tool will not let you add a route if the gateway cannot be reached directly via a local network interface.A couple of source-routing references:http://tools.ietf.org/html/draft-reitzel-ipv4-source-routing-is-evil-00http://lwn.net/Articles/232781/