Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 ║
╚═════════════════════════════════════════════════════════════════════════════╝
share|improve this question
    
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 Dec 11 '12 at 16:47

1 Answer 1

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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