How to make a static route when using two internet connections?

0

I have asked a question here on how to choose which applications will use a 3G internet connection and which applications will use the LAN.

User harrymc gave a very complete and interesting answer, pointing that this is possible using static routes for certain websites.

Now, lets say I want to access google.com only through my 3G internet connection. How would that static root look like?

  • google has the IP: 173.194.39.180

  • here is a print of my route table, the 3G Modem has the IP: 10.81.132.96

╔═════════════════════════════════════════════════════════════════════════════╗
║ IPv4 Route Table                                                            ║
║ =========================================================================== ║
║ Active Routes:                                                              ║
║ Network Destination        Netmask          Gateway       Interface  Metric ║
║           0.0.0.0          0.0.0.0      192.168.2.1    192.168.2.102     20 ║
║           0.0.0.0          0.0.0.0     10.81.132.97    10.81.132.111    286 ║
║      10.81.132.96  255.255.255.224         On-link     10.81.132.111    286 ║
║     10.81.132.111  255.255.255.255         On-link     10.81.132.111    286 ║
║     10.81.132.127  255.255.255.255         On-link     10.81.132.111    286 ║
║         127.0.0.0        255.0.0.0         On-link         127.0.0.1    306 ║
║         127.0.0.1  255.255.255.255         On-link         127.0.0.1    306 ║
║   127.255.255.255  255.255.255.255         On-link         127.0.0.1    306 ║
║       192.168.2.0    255.255.255.0         On-link     192.168.2.102    276 ║
║     192.168.2.102  255.255.255.255         On-link     192.168.2.102    276 ║
║     192.168.2.255  255.255.255.255         On-link     192.168.2.102    276 ║
║         224.0.0.0        240.0.0.0         On-link         127.0.0.1    306 ║
║         224.0.0.0        240.0.0.0         On-link     192.168.2.102    276 ║
║         224.0.0.0        240.0.0.0         On-link     10.81.132.111    286 ║
║   255.255.255.255  255.255.255.255         On-link         127.0.0.1    306 ║
║   255.255.255.255  255.255.255.255         On-link     192.168.2.102    276 ║
║   255.255.255.255  255.255.255.255         On-link     10.81.132.111    286 ║
╚═════════════════════════════════════════════════════════════════════════════╝

webmasters

Posted 2012-12-11T16:35:00.360

Reputation: 141

Here is a web site that makes ASCII tables for you, it was written by a SuperUser User. I updated your table to use it.

– Scott Chamberlain – 2012-12-11T16:47:59.900

Answers

0

should be somthing like:

route add 173.194.39.180 255.255.255.255 10.81.132.96 1

note that since you are routing to a single address, the netmask is 32bit (eg:255.255.255.255). you may want to tweak the metric parameter (the trailing 1), but since you have a 0.0.0.0/0 route with a metric of 1, the system may never use your new route. routing decisions usually take metric into account.

Frank Thomas

Posted 2012-12-11T16:35:00.360

Reputation: 29 039