LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 01-10-2014, 08:17 PM   #1
karnage219
LQ Newbie
 
Registered: Jan 2014
Posts: 5

Rep: Reputation: Disabled
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

Last edited by karnage219; 01-10-2014 at 08:28 PM.
 
Old 01-10-2014, 09:18 PM   #2
jrosco
Member
 
Registered: Aug 2010
Location: Australia
Posts: 37

Rep: Reputation: 4
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
iface eth0 inet static
address 192.168.0.103
netmask 255.255.255.0
broadcast 192.168.0.255
You'll have to restart the network service after adding modifying the network file

Code:
sudo /etc/init.d/networking restart
Hope this helps.

Joel

Last edited by jrosco; 01-10-2014 at 09:21 PM.
 
Old 01-10-2014, 11:01 PM   #3
karnage219
LQ Newbie
 
Registered: Jan 2014
Posts: 5

Original Poster
Rep: Reputation: Disabled
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
 
Old 01-10-2014, 11:31 PM   #4
jrosco
Member
 
Registered: Aug 2010
Location: Australia
Posts: 37

Rep: Reputation: 4
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
And post the output here.

Joel
 
Old 01-11-2014, 12:06 AM   #5
karnage219
LQ Newbie
 
Registered: Jan 2014
Posts: 5

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by jrosco View Post
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
And post the output here.

Joel


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)
auto lo
iface lo inet loopback
 
Old 01-11-2014, 12:33 AM   #6
jrosco
Member
 
Registered: Aug 2010
Location: Australia
Posts: 37

Rep: Reputation: 4
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.
 
Old 01-11-2014, 01:13 AM   #7
karnage219
LQ Newbie
 
Registered: Jan 2014
Posts: 5

Original Poster
Rep: Reputation: Disabled
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.
 
Old 01-11-2014, 01:59 AM   #8
jrosco
Member
 
Registered: Aug 2010
Location: Australia
Posts: 37

Rep: Reputation: 4
Have you done a reboot?
 
Old 01-11-2014, 02:09 AM   #9
karnage219
LQ Newbie
 
Registered: Jan 2014
Posts: 5

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by jrosco View Post
Have you done a reboot?

Yes, also I somehow got it to work temporarily using
Code:
route add default GW 192.168.0.1 wlan1
The problem is that this is said to only hold true until a reboot. I need it to permanently stay like this.

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.
 
Old 01-11-2014, 02:31 AM   #10
jrosco
Member
 
Registered: Aug 2010
Location: Australia
Posts: 37

Rep: Reputation: 4
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
and ensure that command is on the last line. Now reboot and see if that helps.

I'm not sure why the default gateway keeps appearing on the eth0.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Mint 9 Internet connection goes on and off even though connected to wireless network hajiang Linux - Wireless Networking 5 01-06-2012 03:20 AM
connected to wireless network but no internet acces gb84 Linux - Networking 1 09-21-2009 02:16 PM
Slack 12.2 Connected to wireless network but not internet maniac matt Slackware 3 01-02-2009 05:37 AM
wireless network says its connected, but internet doesn't load (knoppix) ralphbluecoat Linux - Wireless Networking 3 09-09-2007 12:26 PM
Wireless lan connected but no internet XJNick Linux - Wireless Networking 5 08-07-2005 10:35 PM


All times are GMT -5. The time now is 01:46 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration