2015/01/08

Multi-gateway network conection

Cofiguring multi-gateway network connection from user's perspective

Declare:
- end-user's perspective.
- using Win-7.
- 2 network devices. (cable-ethernet & wifi ethernet)
- 1 gateway to local servers. (wired interface)
- 1 gateway to internet. (wireless interface)


Conventional way to do this is to manually switch between 2 network interface. It is a proper way, but not a smart way to work in mobile environment nowadays.

As you should know that notebook (or PC, or any devices) has to determine its way to connect to the internet, this "way" is known to be "route". After notebook knows its route, it saves the route into its memory. Series of routes (might be simplified) which has been saved called "routing-table".
To simplify the terms here for you to understand; imagine that you want to go to Mall-A in downtown which has many route you can take, since you're new in town, you don't know which way to go, then you asks someone for direction, direction given is the route. You're not confident with the answer and decide to ask another one for another route which quite a bit different but has same destination. Collection of this routes called routing-table.

Here's simple steps to "tune" your notebook routing-table to allow both network interfaces for different connection purposes.

1. Connect both interface, and determine its ip address and its default gateway.
2. open command prompt with administrative privilege.
3. type "route print" in cmd, to show your notebook's routing table.

default routing table would be:
Network destination: 0.0.0.0
Netmask: 0.0.0.0
Gateway: a.b.c.d (one of your network card's IP address)

the idea is to change these value to "re-route" your network traffic.

4. delete existing route for 0.0.0.0
route del 0.0.0.0 0.0.0.0 
5. reroute your traffic.
route add a.b.c.d mask w.x.y.z m.n.o.p
route add 0.0.0.0 mask 0.0.0.0 q.r.s.t
a.b.c.d => your local server's IP prefix
w.x.y.z => network mask
m.n.o.p & q.r.s.t => your gateways ip address.
6. test your connection.
connect both interfaces.
ping to your local servers.
ping to internet.
you can apply various methods to determine that your both interfaces' up and route properly as you decide.

Good luck!

No comments:

Post a Comment