Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In a Java application, I'd like to use the computer's main connection for database connections and the VPN for all other tasks.

I was told I need to use routing table within the OS. I'm using Windows server 2008 and totally new to routing tables.

Is this a complicated task to do? I searched on the web but didn't find a lot of info about it. How can I achieve this?

share|improve this question
First please describe the network topology you have as otherwise it is very difficult to give a useful advice – Serge Oct 15 '12 at 18:41

Routing tables are not specific to Windows and are more often manipulated by network engineers on other systems, so you may get more information if you just google "static routing tables".

The basic idea is quite simple: when a packet appears, the system checks the table to know which network connection to use to send/foward the packet. Each table entry have 3 key parameters: the prefix (or network address + network mask), the next hop/interface and the metric. The packet's destination address is matched against the prefixes in the table and the longest prefix that matches wins (longest prefix matching) and the packet is send to the corresponding next hop (router ip address) or interface. Metrics are used to resolve ties.

Windows provides two flavours of routing table manipulation commands route and netsh. The latter is more powerful, but maybe to difficult to beginners. route /? will give you some simple help on the former.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .