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 ║
╚═════════════════════════════════════════════════════════════════════════════╝
1
  • 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. Dec 11, 2012 at 16:47

1 Answer 1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.