Saturday, October 17, 2009

Routings...

So, image you have a happy wireless network which allows you to connect happily to the internet from your desktop machine.

But you also want to connect to a wired network which contains a Linux machine which won't connect to the wireless network for reason of not having a wireless adapter.

Easy you may thing, just connect the desktop to both networks and off you go. And it is that easy except that the connection from the Desktop to the internet via the wireless network is lost.

This is because the routing tables are set up to go through the wired network first, so the machine fails to find the internet (that is only my guess, but it certainly sounds plausible and the solution fits).

So, we just need to update the routing tables. These are displayed from an elevated command line with:
route print
And should show the active routes, with the network destination 0.0.0.0 as the two gateways. So all we have to do is to change the metric of the wireless network so it is less than that of the wired network with a command like:
route change 0.0.0.0 mask 0.0.0.0 192.168.1.1 metric 25 if 9
where if is the interface number of the wireless adapter from the Interface List, and metric is less than that of the wired adapter.

Easy...