Internet over wireless while connected to a LAN network
Linux Newbie here, this is most likely a simple fix by anybody with experience. I am using Ubuntu 12.10. I can provide more details if needed.
I am having some trouble connecting to the internet and my lan network at the same time. I am connected wirelessly to my internet network, I am also hard wired into a home network that is not connected to the internet. While my lan is active i cannot connect to the internet, only to my network. If i disable my wired connection my wireless connection automaticly takes priority and i can connect to the internet again. I am woundering how to route my internet trafic through my wireless connection while still being able to connect to my wired network. Also, i am currently updating to the most recent Ubuntu |
Hi, My guess would be you have 2 default routes when both connections are enabled. To check this you should open a terminal .e.g gnome-terminal and ran sudo route -n and check if you have 2 default routes e.g.
0.0.0.0 192.168.1.254 0.0.0.0 UG 0 0 0 wlan0 0.0.0.0 192.168.1.254 0.0.0.0 UG 0 0 0 eth0 If so you need to remove the default route from the wired interface e.g eth0 if your using a static ip. If your using dhcp on the wired interface I suggest you setup a static ip via the /etc/network/interfaces file (example below) Code:
auto eth0 Code:
sudo /etc/init.d/networking restart Joel |
I dont seem to have two defaults, wlan1 seems to just be a lower priority then eth0, and I dont understand how to change that.
This is when just my wireless interface is active Destination*****Gateway*********Genmask*********Flags*Metric*Ref****Use*Iface 0.0.0.0**********192.168.0.1******0.0.0.0***********UG*****0******0********0 wlan1 192.168.0.0****0.0.0.0************255.255.255.0****U******9******0********0 wlan1 This is while both my wireless and wired connections are active Destination*****Gateway*********Genmask*********Flags Metric Ref****Use Iface 0.0.0.0**********172.16.42.1*****0.0.0.0*************UG****0******0********0 eth0 169.254.0.0*****0.0.0.0**********255.255.0.0********U*****1000**0********0 eth0 172.16.42.0*****0.0.0.0**********255.255.255.0*****U*****1******0********0 eth0 192.168.0.0*****0.0.0.0**********255.255.255.0*****U*****9******0********0 wlan1 |
Is eth0(172.16.42 network) interface receiving its ip settings from a dhcp server? If so, try disabling the gateway from your dhcp server settings..... other then that and not knowing the complete layout of your network that's all I can think of.
Also run this : Code:
sudo cat /etc/network/interfaces Joel |
Quote:
Im not sure about the dhcp server, i dont belive it is. Also, /etc/network/interface is mostly empty Code:
# interfaces(5) file used by ifup(8) and ifdown(8) |
try adding eth0 as a static ip
following this guide: http://www.sudo-juice.com/how-to-a-s...-ip-in-ubuntu/ and leave the gateway out, if the interface eth0 doesn't need internet access theres no need for it. |
Ok, i set up the wired connection as a static ip but my wired is still set to default, while my wireless is not default.
|
Have you done a reboot?
|
Quote:
Yes, also I somehow got it to work temporarily using Code:
route add default GW 192.168.0.1 wlan1 Ifconfig still gives the eth0 a metric of 0 and wlan1 a metric of 9. Nm-tool shows eth0 as default and wlan1 as non default. |
The dirty and nasty way to permanently add that command at startup is the following
sudo echo "route add default GW 192.168.0.1 wlan1" >> /etc/rc.local then Code:
cat /etc/rc.local I'm not sure why the default gateway keeps appearing on the eth0. |
All times are GMT -5. The time now is 07:44 AM. |