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.

Is there a way to make all internet traffic go through one network connection when there are multiple connections?

I've connected my mobile broadband modem into my Ubuntu Jaunty box so that I now have two running connections: the mobile broadband and an ethernet connection.

The problem is that internet traffic is going through the ethernet connection rather than the mobile connection. Where I live, ISPs cap bandwidth after you have used your quota, and we have been capped at my house, so I need internet traffic to go through the faster mobile connection. I need access to the home network so disabling ethernet is not an option

share|improve this question

2 Answers 2

up vote 3 down vote accepted

You can do this with a static route

Details for how to do this can be found here http://www.ubuntugeek.com/howto-add-permanent-static-routes-in-ubuntu.html

You will define one route for your internal network to whichever interface that is attached to, and then you'll set the default route (0.0.0.0/0) to the other interface.

share|improve this answer
    
Ahh ok. Should either of them be going through the gateway of the home network? –  humble coffee Oct 26 '09 at 1:40
1  
Whatever needs to stay locally on your internal network. You've said that you cannot unplug the interface that is connected to your broadband modem because you need to be able to access other things on your network. So for that interface make a route that applies to traffic internal on your network. If your internal network is 192.168.1.0 with a netmask of 255.255.255.0 it would look like 192.168.1.0/24 and you would say anything from that route would use your broadband router/modem as the gateway. –  MDMarra Oct 26 '09 at 1:50
    
Success! Thanks heaps. It turned out that there was already an appropriate entry in the routing tables for the local network so I just needed to add the default entry for the mobile broadband modem. –  humble coffee Oct 26 '09 at 2:25

In Ubuntu you can also try selecting "Edit connections" from the Network Manager, edit the ethernet connection, under IPv4 Settings select Routes... and tick "Use this connection only for resources on its network".

The explanations of the option is "If enabled, this connection will never be used as the default network connection." This should achieve what you want. You could also defined separate connection profiles, one of which uses the ethernet as the default connection and another that doesn't.

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.