LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 04-28-2012, 11:31 AM   #1
52358
LQ Newbie
 
Registered: Apr 2012
Posts: 8

Rep: Reputation: Disabled
Unhappy Debian Networking Doesn't Work with Home Wifi


I've used Ubuntu for a few years at home and I use CentOS at work, but getting tired of Ubuntu's Unity interface and the general direction it's going I decided to switch my home computer to Debian, so I guess this makes me as a Debian noob.

Once I booted for the first time, I noticed that I did not have internet while connected to my home wifi. I thought at first that Comcast might be down again, but then I noticed all my other wifi devices worked fine with the router. I then connected to a neighbor's unsecured wifi, and the internet worked fine, so that rules out a problem with the wifi card.

I then got my laptop close to the router and connected them with an ethernet cable, disconnected from wifi, and I once again had internet. However, because I have a laptop, this is not a realistic solution.

I thought maybe I MAC address-blocked myself from my router, so I booted to my Windows partition and I was able to get online from my home wifi, so I ruled out that.

The only logical thing left is that my Debian system is somewhat misconfigured for that hotspot. So I went to System > Preferences > Network Connections > Wireless and deleted the profile for my hotspot, and reconnected, still nothing. I decided to give myself a manual IP, maybe there was a DHCP failure somewhere, still nothing. While connected I tried to go to 192.168.1.1, my router's config page, but I couldn't even access that.

here's my ifconfig:
Code:
eth0      Link encap:Ethernet  HWaddr 00:26:2d:52:eb:e0  
          inet addr:192.168.1.50  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::226:2dff:fe52:ebe0/64 Scope:Link
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:1809022 errors:0 dropped:0 overruns:0 frame:0
          TX packets:911273 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:2650615647 (2.4 GiB)  TX bytes:66119719 (63.0 MiB)
          Interrupt:16 

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:2040 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2040 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:195826 (191.2 KiB)  TX bytes:195826 (191.2 KiB)

wlan0     Link encap:Ethernet  HWaddr 70:1a:04:09:e2:c6  
          inet addr:192.168.1.4  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::721a:4ff:fe09:e2c6/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:122503 errors:0 dropped:0 overruns:0 frame:0
          TX packets:106758 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:154428357 (147.2 MiB)  TX bytes:13256951 (12.6 MiB
And here's what I got when I tried to ping the router:
Code:
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
From 192.168.1.50 icmp_seq=1 Destination Host Unreachable
(it says my local IP is 192.168.1.50, so I guess this means it's trying to ping through my ethernet connection, despite not being connected through ethernet at the time)

and finally netstat -nr
Code:
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
192.168.1.0     0.0.0.0         255.255.255.0   U         0 0          0 eth0
192.168.1.0     0.0.0.0         255.255.255.0   U         0 0          0 wlan0
169.254.0.0     0.0.0.0         255.255.0.0     U         0 0          0 eth0
0.0.0.0         192.168.1.1     0.0.0.0         UG        0 0          0 wlan0
This is as much troubleshooting as I remember from my networking classes, I really don't know what to do next. I'd really appreciate any feedback.
 
Old 04-28-2012, 12:17 PM   #2
Skaperen
Senior Member
 
Registered: May 2009
Location: WV, USA
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,248
Blog Entries: 28

Rep: Reputation: 161Reputation: 161
Try pinging an outside address to see if you get the response from 192.168.1.50 or from 192.168.1.4. You might use 8.8.4.4 or 8.8.8.8 (Google's public DNS array).
 
Old 04-28-2012, 12:39 PM   #3
52358
LQ Newbie
 
Registered: Apr 2012
Posts: 8

Original Poster
Rep: Reputation: Disabled
okay, I was able to fix it

I opened up /etc/network/interfaces

and noticed that eth0 was defined with the static IP 192.168.1.50 and looked something like this:
Code:
auto eth0
iface eth0 inet static
    address 192.168.1.50
    network 192.168.1.0
    netmask 255.255.255.0
    broadcast 192.168.1.255
    gateway 192.168.1.1
so I made it ask DHCP for an address instead by replacing the above with:
Code:
auto eth0
iface eth0 inet dhcp
Then I restarted networking by running
Code:
/etc/init.d/networking restart
and now everything works

Now I have no idea why that fixed it, but I figured that since when I pinged it told me that my IP was 192.168.1.50, I figured removing that might do something. I also don't understand why the configuration for eth0 was affecting wlan0, or more specifically only affecting it when connected to the device eth0 was last connected to (my router).
 
Old 04-28-2012, 02:18 PM   #4
Skaperen
Senior Member
 
Registered: May 2009
Location: WV, USA
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,248
Blog Entries: 28

Rep: Reputation: 161Reputation: 161
So what IP address did DHCP give you? Maybe what was happening is that the router blocks IP addresses that it has not assigned, at least if they are within the DHCP pool and not coming from the assigned MAC. If you prefer a static IP address, maybe one outside the pool (check the router configuration) would work.

If you just want static IP for internal purposes, adding another subnet with a second IP address in that range would work, such as 192.168.2.0/24 or 172.16.0.0/16 or 10.0.0.0/8 depending on how greedy you are Or try out IPv6 with huge subnets like fc00::/16.

In a pinch you can use the IPv6 autoconfigured scope local addresses that Linux gives fixed assignments to based on the MAC address (MS Windows does not do it that way). Do "ifconfig eth0 | grep fe80:" to see yours. These "fe80" addresses need "%eth0" appended when using them (or "%wlan0" or whatever interface you want it to use). This is a good way to test specific interfaces since normal addressing can go by way of other interfaces in many cases.
 
Old 03-13-2017, 08:11 AM   #5
urapain
LQ Newbie
 
Registered: Oct 2010
Location: Florida
Distribution: ubuntu redhat
Posts: 3

Rep: Reputation: 0
You can't properly test wifi while connected to the wired network. Your wired port (eth0) has 192.168.1.50. Your wifi (wlan0) has 192.168.1.4. That will never work because both numbers are from the same network.
 
  


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
Wifi doesn't work Kubuntu Arch 6 03-02-2011 07:26 PM
TL-WN821N Wifi usb doesn't work correctly on Debian Testing. Mortuus Linux - Hardware 0 08-14-2010 04:39 PM
[SOLVED] wifi doesn't work with debian on laptop mrj Debian 13 08-05-2009 11:19 PM
wifi doesn`t work ghodkiller Linux - Hardware 2 09-30-2008 01:25 PM
University wifi doesn't work to me khoma Linux - Wireless Networking 7 12-19-2007 07:51 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 08:15 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
Open Source Consulting | Domain Registration