2

I have a Ubuntu 10.10 laptop running two VirtualBox machines that I want to use to demonstrate how an application can connect to a networked database. I use a stand-alone (not connected to the Internet) billion route to ensure the IP addresses of the virtual machines stay constant.

I need to connect the host computer to the Internet but I understand that network-manager automatically uses the wired network for Internet connections.

How can I force network-manager to use a wireless or USB tethered device for the Internet connection while maintaining a wired connection?

2 Answers 2

4

Create a new wired connection that is the same as the one you have already. Then edit the connection and go to IPv4 Settings -> Routes -> Use this connection only for resources on its network and tick the box.

enter image description here

The connection will use another connection for general Internet traffic.

5
  • This method did work for me. I plugged in the router that doesn't have an internet connection. I created the new connection and copied the MAC address to the new connection. I changed from eth0 to the new connection but was not able to connect to the internet. I also tried another wireless connection (sim card type) but still no connection.
    – Col
    Dec 21, 2011 at 23:51
  • Sorry that should read DID NOT work for me.
    – Col
    Dec 21, 2011 at 23:52
  • The point of this change is that the wired connection does not provide an internet connection, just the connection for the network. When you connect the wireless, that provides an internet connection, so anything not on the wired network is directed to the wireless one. Dec 22, 2011 at 0:09
  • This change sounds like it will not suit. I need the wired connection to maintain consistent IPs for the host and virtual machines so they are all on the wired network (VM bridged adapter). The only way I can connect to the internet is via wireless.
    – Col
    Dec 22, 2011 at 0:24
  • It works for me for configuring my router and being online at the same time.
    – sup
    May 5, 2012 at 17:48
1

I'd suggest setting up a route for the IP address of the server.

Assume that we're on the server, with both wired(eth0) and wireless (wlan0) interfaces up. If the IP address of the database node (that you want to access wirelessly) is 192.168.59.40. Then, do:
sudo ip route add 192.168.59.40 dev wlan0

This tells the system that packets destined for 192.168.59.40 have a low "cost" route, and that it's out through wlan0.

You can undo this via:
sudo ip route del 192.168.59.40 dev wlan0

And, of course, read man ip before you do anything.

1
  • I tried this but I still cannot connect to the internet. When I plug the laptop into the router that doesn't have an internet connection it gets an IP of 192.168.1.100. I used the command 'sudo ip route add 192.168.1.100 dev wlan0'. The 'route -n' command shows me that there is a new entry. The 'route -n' command shows the current wlan0 IP as 192.168.1.0. I tried this IP too but I still am unable to connect.
    – Col
    Dec 21, 2011 at 23:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .