If you have two network interface in your Ubuntu eth0 and usb0 and the default network interface is eth0 but you want to use usb0 for internet connection. To make this happen you must set usb0 as your default interface so that when you need to access something that isnt located in the eth0 interface local network, usb0 will be used. For example you have a phone and you want its data connection to be tethered to your Ubuntu desktop. Once connected to your desktop it registered as usb0. So now you have both eth0 and usb0 interface registered and you want usb0 to be used for internet connection but still want to be able to connect to a computer that resides in eth0 local network and eth0 network also have an internet connection. By default eth0 will always be used since it it will be more likely the default interface.

Now to set the default network interface in Ubuntu you need to check first if it is not already the default by using “ip route list”.

4th line tells what network interface is the current default and as you can see it tells us that the default one is eth0. To set usb0 as the default one we need to issue the command

change “[gateway ip]” with your gateway ip. If you dont know whats your gateway ip, issue the command “ls /var/lib/dhcp3”

now look for the last entry of the “usb0.lease”. With the list above we can get the gateway with issuing the command “cat /var/lib/dhcp3/dhclient-a03fa74b-68f5-48b4-97ea-40d9db334dcb-usb0.lease”

With the above info we can now determine that the gateway ip for usb0 is We just need to issue the command ip route change

“ip route list” shoud now look like this

Now all traffic will be directed to usb0 unless it is for a machine thats inside the eth0 network.