LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-01-2014, 12:02 AM   #1
Banquo
Member
 
Registered: May 2012
Distribution: Peppermint OS
Posts: 65

Rep: Reputation: Disabled
Wireless internet works only when LAN is disconnected


I've been having an odd problem with my networking setup. I have 2 computers connected through a Linksys router with static IPs set for both machines. One is running Ubuntu 12.04.4 LTS the other, Windows 7. Using the wireless adapter for my internet connection works fine on the win7 machine but my Linux machine will only gain internet access when i disable the LAN interface.

The computer will connect to the wireless router but I can't get online. My wireless interfaces are both set to DHCP, as I share my wireless with others in the house. ANy idea as to what could be causing this?

P.S. I apologize for not knowing the correct logs/info to post here. I'm still quite the noob.
 
Old 02-01-2014, 04:18 AM   #2
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850
Hi,

I'm not sure how Ubuntu handles this situation when there is a wireless and a wired network available. As of my computer, it uses the "fastest possible connection", when I use the wireless LAN for datatransfer between my server and my laptop and then bring eth0 up on the laptop (which is connected to the same network), it will instantly use the connection via eth0 (which is much faster).

Question: to which LAN is your LAN interface connected? is it necessary to have the interface (eth0 probably) up? Is a cable connected?

If eth0 must be up but is not connected to the internet, you should try to find out if it's possible to configure something like a "preferred" connection for the internet. But this would depend on the tool you're using for managing the connections.

Markus
 
Old 02-01-2014, 05:13 AM   #3
ericson007
Member
 
Registered: Sep 2004
Location: Japan
Distribution: CentOS 7.1
Posts: 656

Rep: Reputation: 121Reputation: 121
As said above. Even on windows it will not use both at the same time, it will use the device setup as default gateway.

If you have a cable connected why would you want to use slow wifi anyway? So it is not really a problem, it is just the more logical choice
 
Old 02-01-2014, 06:10 AM   #4
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850
Quote:
Originally Posted by ericson007 View Post
As said above. Even on windows it will not use both at the same time, it will use the device setup as default gateway.
...
default gateway means something different. Each interface can have a default gateway which is the router for this subnet. This means even an interface to an internal network may have a default gateway which (probably) isn't connected to the internet.
Quote:
...
If you have a cable connected why would you want to use slow wifi anyway? So it is not really a problem, it is just the more logical choice
It would be no problem as long as both interfaces, wireless and wired, are in the same subnet. But sometimes you are connected with wireless and wired in different networks where wireless connects to the internet and maybe the wired network only to a homeserver in an internal network.
Lets wait what the OP tells us about his setup.

Markus
 
Old 02-01-2014, 07:30 AM   #5
Banquo
Member
 
Registered: May 2012
Distribution: Peppermint OS
Posts: 65

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by markush View Post
default gateway means something different. Each interface can have a default gateway which is the router for this subnet. This means even an interface to an internal network may have a default gateway which (probably) isn't connected to the internet.
It would be no problem as long as both interfaces, wireless and wired, are in the same subnet. But sometimes you are connected with wireless and wired in different networks where wireless connects to the internet and maybe the wired network only to a homeserver in an internal network.
Lets wait what the OP tells us about his setup.

Markus
Thank you all for the replies. Sorry for not being clearer. The LAN is used only for connecting my 2 computers ( for Samba shares, synergy etc). The wireless is shared with others in the house and the router is in another room. So, eth0 connects to a linksys router, which then connects to my windows machine. wlan0 connects to the wireless router, but there is not internet connection while connected unless i disable the eth0 interface.

Both the win7 and ubuntu machines have DHCP configured for the wireless interfaces. As I stated earlier, the windows machine handles both connections fine. the subnet mask for both networks is 255.255.255.0. Could this be causing a conflict with linix somehow?

Here is the output of ifconfig:

Code:
eth0      Link encap:Ethernet  HWaddr 3d:6a:c5:3f:48:66  
          inet addr:192.168.1.117  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::215:c5ff:fe3f:4866/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:823 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1171 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:67000 (67.0 KB)  TX bytes:99275 (99.2 KB)
          Interrupt:18 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:180 errors:0 dropped:0 overruns:0 frame:0
          TX packets:180 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:12178 (12.1 KB)  TX bytes:12178 (12.1 KB)

wlan0     Link encap:Ethernet  HWaddr 4a:14:8b:2d:4a:35  
          inet addr:192.168.1.115  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::21c:26ff:fe7f:c66/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:95 errors:0 dropped:0 overruns:0 frame:0
          TX packets:74 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:18867 (18.8 KB)  TX bytes:13844 (13.8 KB)
EDIT: i'm also usung the default Gnome network manager

Last edited by Banquo; 02-01-2014 at 07:40 AM.
 
Old 02-01-2014, 07:44 AM   #6
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850
This cannot work! Your wireless router and your linksys-router are in the same subnet. It is quite clear that your Ubuntu uses the fastest connection to the 192.168.1.0/24 Network which is via eth0. As I understand (this is the same as I wrote in post #4) that the linksys-router has no internet-connection. You should put this internal network into it's own subnet, for example 192.168.3.0/24 which means that the Linksys-router would have (as an example) the IP-adress 192.168.3.1, Ubuntu's eth0 192.168.3.2 and the Windows-LAN interface 192.168.3.3 and all a subnet-mask of 255.255.255.0

Most likely this will solve your connectivity problem.

An additional remark: you don't need the Linksys-router as long as it doesn't connect to another subnet. You can use the router as a switch without an own IP-address or use a switch instead.

Markus

Last edited by markush; 02-01-2014 at 07:47 AM.
 
Old 02-01-2014, 07:53 AM   #7
Banquo
Member
 
Registered: May 2012
Distribution: Peppermint OS
Posts: 65

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by markush View Post
This cannot work! Your wireless router and your linksys-router are in the same subnet. It is quite clear that your Ubuntu uses the fastest connection to the 192.168.1.0/24 Network which is via eth0. As I understand (this is the same as I wrote in post #4) that the linksys-router has no internet-connection. You should put this internal network into it's own subnet, for example 192.168.3.0/24 which means that the Linksys-router would have (as an example) the IP-adress 192.168.3.1, Ubuntu's eth0 192.168.3.2 and the Windows-LAN interface 192.168.3.3 and all a subnet-mask of 255.255.255.0

Most likely this will solve your connectivity problem.

An additional remark: you don't need the Linksys-router as long as it doesn't connect to another subnet. You can use the router as a switch without an own IP-address or use a switch instead.

Markus
Yes, I am using the router as a switch, but I am confused on one point. The IPs you suggested would result in me using the same subnet mask (255.255.255.0) as before. Shouldn't this be different?
 
Old 02-01-2014, 08:03 AM   #8
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 2,324
Blog Entries: 1

Rep: Reputation: 447Reputation: 447Reputation: 447Reputation: 447Reputation: 447
With the cards on the same subnet you'll have routing issues. Some complex firewall rules can cope with that complexity on a per IP basis, but you can solve a lot of issues by putting each device type on different subnets. Linux has a default route which might help prioritize your routing.
 
Old 02-01-2014, 08:13 AM   #9
Banquo
Member
 
Registered: May 2012
Distribution: Peppermint OS
Posts: 65

Original Poster
Rep: Reputation: Disabled
I have changed the subnet for the LAN to 255.255.255.248 and adjusted the IPs accordingly. Still no love. In the network manager I have the "Use this connection only for resources on it's network" option enabled. AM i correct in assuming this keeps the LAN from connecting to an outside network?

Last edited by Banquo; 02-01-2014 at 08:15 AM.
 
Old 02-01-2014, 08:16 AM   #10
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850
Quote:
Originally Posted by Banquo View Post
Yes, I am using the router as a switch, but I am confused on one point. The IPs you suggested would result in me using the same subnet mask (255.255.255.0) as before. Shouldn't this be different?
The subnet-mask of 255.255.255.0 means the part of the IP-address left of the last dot (192.168.3) is the network-address and the rest (right from the last dot) is the host-address. 192.168.2.0 and 192.168.3.0 are therefore in different networks when using a 255.255.255.0 mask.

Markus
 
Old 02-01-2014, 08:18 AM   #11
Banquo
Member
 
Registered: May 2012
Distribution: Peppermint OS
Posts: 65

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by markush View Post
The subnet-mask of 255.255.255.0 means the part of the IP-address left of the last dot (192.168.3) is the network-address and the rest (right from the last dot) is the host-address. 192.168.2.0 and 192.168.3.0 are therefore in different networks when using a 255.255.255.0 mask.

Markus
AH, I see now
 
Old 02-01-2014, 08:45 AM   #12
Banquo
Member
 
Registered: May 2012
Distribution: Peppermint OS
Posts: 65

Original Poster
Rep: Reputation: Disabled
The subnet mask of 255.255.255.248 would still work per your suggestion, right?
 
Old 02-01-2014, 09:12 AM   #13
Banquo
Member
 
Registered: May 2012
Distribution: Peppermint OS
Posts: 65

Original Poster
Rep: Reputation: Disabled
Here is the output of route

Code:
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         192.168.1.254   0.0.0.0         UG    0      0        0 wlan0
link-local      *               255.255.0.0     U     1000   0        0 wlan0
192.168.1.0     *               255.255.255.0   U     2      0        0 wlan0
192.168.1.208   *               255.255.255.248 U     0      0        0 eth0
 
Old 02-01-2014, 09:25 AM   #14
Banquo
Member
 
Registered: May 2012
Distribution: Peppermint OS
Posts: 65

Original Poster
Rep: Reputation: Disabled
I have been forsaken.....
 
Old 02-01-2014, 09:30 AM   #15
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850
Quote:
Originally Posted by Banquo View Post
The subnet mask of 255.255.255.248 would still work per your suggestion, right?
Yes, with a subnet-mask of 255.255.255.248 the addresses 192.168.3.1 up to 192.168.3.6 would be in the same network, the network-address would be 192.168.3.0 and the broadcast-address 192.168.3.7

With the output of route 192.168.1.254 should be the IP-address of your wireless router. But you'll have to put eth0 into a different network. The network 192.168.1.208/29 overlaps with the wlan0 network. The 3. number in the IP-address must be different from 1 in order to have another subnet.

Read here

Markus
 
  


Reply

Tags
connection, lan, networking, wan


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
Ubuntu server works on LAN but can not get to the internet or the internet to it. techyjpt Linux - Networking 20 05-08-2012 03:41 PM
Virtualmin configurated, only works for lan, not internet. Ronin_tekorei Linux - Server 1 07-09-2009 07:41 PM
Kubuntu - LAN works but not Internet anjanesh Linux - Networking 12 01-13-2009 12:07 AM
LAN works, but Internet does not connect digiplaya Linux - Networking 7 11-29-2003 06:07 PM
LAN works but Internet doesn't ???? El Croat Mandriva 11 08-24-2003 04:56 AM


All times are GMT -5. The time now is 09:31 PM.

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