LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 07-07-2015, 07:07 AM   #1
Archy1
Member
 
Registered: Jan 2014
Distribution: Debian
Posts: 95

Rep: Reputation: 2
Can connect to wifi but not to Internet with nm-applet.


I just installed Debian 8 amd64 on my laptop and when I go to nm-applet to connect to wifi and it connects just fine (I can ping my gateway) but I can't ping external IP address or resolve names.

After I run as root:
Code:
# dhcpclient wlan0
RTNETLINK answers: File exists
I can access the Internet and resolve names just fine but logging in as root and running "dhcpclient wlan0" every time I turn on the computer is getting annoying.

How can I avoid having to go through the whole "dhcpclient wlan0" mess every time?

Last edited by Archy1; 07-11-2015 at 10:30 AM.
 
Old 07-07-2015, 07:18 AM   #2
cynwulf
Senior Member
 
Registered: Apr 2005
Posts: 2,727

Rep: Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367
I haven't used nm-applet (or network manager) for years. I assume you're using nm-applet because you're running a window manager? If so then how are you starting it?
 
Old 07-08-2015, 05:05 AM   #3
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
...and how did you install networkmanager?

could it be a permission issue?

could it be you have to disable all network-related systemctl/netctl-services before enabling networkmanager?
 
Old 07-08-2015, 05:34 AM   #4
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,791

Rep: Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140
Do you have a default route defined?
Code:
ip addr
Code:
ip route
Is your Network Manager connection configured as DHCP or using static addresses? (The configuration file located in /etc/NetworkManager/system-connections/ might us here.)
 
Old 07-11-2015, 10:56 AM   #5
Archy1
Member
 
Registered: Jan 2014
Distribution: Debian
Posts: 95

Original Poster
Rep: Reputation: 2
An update.

Apparently I can use the Internet just fine as long as I never switch to another tty (e.g. ctrl+alt+f6), once I switch to another tty (even if I don't log in) I have to run "dhcpclient wlan0" as root. However, after I run that I can switch ttys all I want and the Internet won't go out.

EDIT: I just found out that if I close my laptop lid shut, I have to redo "dhcpclient wlan0" to get Internet again (but once again it automatically connects to the LAN).

Quote:
Originally Posted by cynwulf View Post
I assume you're using nm-applet because you're running a window manager? If so then how are you starting it?
Lightdm logs me into an LXDE on openbox session and nm-applet appears in the system tray, already connected to my router via wifi (and I can access the Internet until I switch ttys).

Quote:
Originally Posted by ondoho View Post
...and how did you install networkmanager?
Code:
apt-get install network-manager network-manager-gnome
ip addr:
Code:
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
    link/ether xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    inet 169.254.7.94/16 brd 169.254.255.255 scope link eth0:avahi
       valid_lft forever preferred_lft forever
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    inet 192.168.1.14/24 brd 192.168.1.255 scope global dynamic wlan0
       valid_lft 85639sec preferred_lft 85639sec
    inet6 fe80::260a:64ff:feab:e5b9/64 scope link 
       valid_lft forever preferred_lft forever
ip route:
Code:
default via 192.168.1.1 dev wlan0 
default dev eth0  scope link  metric 1002 
default via 192.168.1.1 dev wlan0  proto static  metric 1024 
169.254.0.0/16 dev eth0  proto kernel  scope link  src 169.254.7.94 
169.254.0.0/16 dev wlan0  scope link  metric 1000 
192.168.1.0/24 dev wlan0  proto kernel  scope link  src 192.168.1.14
cat /etc/NetworkManager/system-connections/MY-SSID:
Code:
[connection]
id=MY-SSID
uuid=eb018dcc-4a3a-4377-954e-2d7ba9fab6d6
type=wifi
timestamp=1436267949

[wifi]
ssid=MY-SSID
mode=infrastructure
mac-address=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
security=802-11-wireless-security

[wifi-security]
key-mgmt=wpa-psk
psk=xxxxxxxxxxxxxxxxxxxxxxxxxxxxx

[ipv4]
method=auto

[ipv6]
method=auto
ip6-privacy=0
Note that I ran all these commands after I had gone to another tty and issues "dhcpclient wlan0" as root.

Last edited by Archy1; 07-17-2015 at 05:31 PM.
 
Old 07-11-2015, 04:54 PM   #6
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,791

Rep: Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140
Quote:
An update.

Apparently I can use the Internet just fine as long as I never switch to another tty (e.g. ctrl+alt+f6), once I switch to another tty (even if I don't log in) I have to run "dhcpclient wlan0" as root. However, after I run that I can switch ttys all I want and the Internet won't go out.

EDIT: I just found out that if I close my laptop lid shut, I have to redo "dhcpclient wlan0" to get Internet again (but once again it automatically connects to the LAN).
Your NM connection is defined as a system-wide connection (as opposed to user connection), so I would expect it to be available in other VT's. As ondoho suggested, have you stopped using other network services? Is the wlan0 interface excluded in /etc/network/interfaces?

So, just to check that the device is not unmanaged...
Code:
cat /etc/network/interfaces
Code:
nmcli dev status
 
Old 07-12-2015, 10:47 AM   #7
Archy1
Member
 
Registered: Jan 2014
Distribution: Debian
Posts: 95

Original Poster
Rep: Reputation: 2
Quote:
Originally Posted by ferrari View Post
As ondoho suggested, have you stopped using other network services?
Sorry to display my ignorance but how would I do that?

Quote:
Is the wlan0 interface excluded in /etc/network/interfaces?

So, just to check that the device is not unmanaged...
Code:
$ cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
iface eth0 inet dhcp
Code:
$ nmcli dev status
DEVICE  TYPE      STATE      CONNECTION 
wlan0   wifi      connected  MY-SSID   
eth0    ethernet  unmanaged  --         
lo      loopback  unmanaged  --
Should I add
Code:
# WLAN
auto wlan0
iface wlan0 inet dhcp
to "/etc/network/interfaces"?

Last edited by Archy1; 07-17-2015 at 05:29 PM.
 
Old 07-12-2015, 12:35 PM   #8
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by Archy1 View Post
Sorry to display my ignorance but how would I do that?
sorry i'm not using debian, but on my archlinux system i once had a rather similar problem, which turned out to be that there were conflicting services (now that debian is using systemd, too, there is more common ground) for dns resolving, iirc.
anyhow, for me something like
Code:
# systemctl stop dhcpcd.service
# systemctl disable dhcpcd.service
solved it.

and before & after you should always have a look with e.g.
Code:
systemctl status dhcpcd
btw, have you tried:
Code:
$ ping google.com
$ ping 8.8.8.8
if the latter is succesful, but not the former, that means you have a dns problem - you are connected to the internet, but domain names are not being resolved.

but in any case you should consult the debian wiki.
which i'm sure you have done before posting here.
 
Old 07-12-2015, 01:44 PM   #9
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,791

Rep: Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140
Quote:
Should I add
Code:

# WLAN
auto wlan0
iface wlan0 inet dhcp

to "/etc/network/interfaces"?
No, don't add the wlan0 interface to /etc/network/interfaces, otherwise NM will treat it as unmanaged (as with your wired ethernet interface).

When you switch VT, check the connectivity status again with
Code:
nmcli dev status
Maybe you still are connected. Do the ping tests that ondoho suggested as well in that VT.
 
Old 07-17-2015, 05:25 PM   #10
Archy1
Member
 
Registered: Jan 2014
Distribution: Debian
Posts: 95

Original Poster
Rep: Reputation: 2
Some more updates.

Changing VTs was a miss attributed cause. The Internet stops working after about 100 seconds of uptime. I just normally switch VTs quickly so I attributed it to that.

I created this Bourne script to test when the Internet goes out:
Code:
#!/bin/sh
counter=5
while [ $counter -gt 0 ]; do
    echo ""
    cat /proc/uptime | cut -c 1-3
    echo ""
    echo "google.com:"
    ping -q -c 1 google.com | grep loss
    sleep 1

    echo ""
    cat /proc/uptime | cut -c 1-3
    echo ""
    echo "8.8.8.8:"
    ping -q -c 1 8.8.8.8 | grep loss
    sleep 1

done
Here's the output:
Code:
60.

google.com:
1 packets transmitted, 1 received, 0% packet loss, time 0ms

61.

8.8.8.8:
1 packets transmitted, 1 received, 0% packet loss, time 0ms

62.

google.com:
1 packets transmitted, 1 received, 0% packet loss, time 0ms

63.

8.8.8.8:
1 packets transmitted, 1 received, 0% packet loss, time 0ms

64.

google.com:
1 packets transmitted, 1 received, 0% packet loss, time 0ms

## [Redundant output snipped]

96.

google.com:
1 packets transmitted, 1 received, 0% packet loss, time 0ms

97.

8.8.8.8:
1 packets transmitted, 1 received, 0% packet loss, time 0ms

98.

google.com:
1 packets transmitted, 0 received, +1 errors, 100% packet loss, time 0ms

103

8.8.8.8:
1 packets transmitted, 0 received, +1 errors, 100% packet loss, time 0ms

105

google.com:
## COMMENT: [CTRL-C entered]
So something either executes to stop Internet access around that time or finishes executing something to stop Internet access.

Before Internet loss:
Code:
$ systemctl status dhcpcd

● dhcpcd.service
   Loaded: not-found (Reason: No such file or directory)
   Active: inactive (dead)

$ nmcli dev status

DEVICE  TYPE      STATE      CONNECTION 
wlan0   wifi      connected  MY-SSID   
eth0    ethernet  unmanaged  --         
lo      loopback  unmanaged  --
The output is identical after Internet loss. Keep in mind that I can still access network resources on the LAN (like my router), yet I can not ping external address by IP so it looks like this is more than a DNS problem.

I didn't run the systemctl stop and disable commands as the status argument didn't find the service loaded.

Last edited by Archy1; 07-17-2015 at 05:33 PM.
 
Old 07-17-2015, 07:40 PM   #11
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,791

Rep: Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140
Quote:
Changing VTs was a miss attributed cause. The Internet stops working after about 100 seconds of uptime. I just normally switch VTs quickly so I attributed it to that.
As I suspected. A system-wide NM connection is exactly that.

Quote:
The output is identical after Internet loss. Keep in mind that I can still access network resources on the LAN (like my router), yet I can not ping external address by IP so it looks like this is more than a DNS problem.
So, your wifi connection remains associated. So, not a NetworkManager issue. Check if you still have a valid default route when that occurs and can still ping the router. If that checks out but you can't reach the internet then that would suggest a router issue.

Last edited by ferrari; 07-17-2015 at 07:41 PM.
 
Old 07-29-2015, 01:45 PM   #12
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
well it's a bit late now, but in addition to what has been suggested already:

i vaguely remember something about certain wifi cards having similar problems with encryption.
there was workarounds; but first, one way to troubleshoot is to temporarily completely disable encryption and see how that works.
that would be somewhat hardware/driver related and you should also check
Code:
dmesg
before and after connection loss.

anyhow with your newly gained insight, have you made further searches into your problem?

also the info requested here would be good, if you want further assistance.

Last edited by ondoho; 07-29-2015 at 01:46 PM.
 
  


Reply



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
NetworkManager applet won't connect to Internet peter576 Linux - Newbie 7 05-11-2015 01:34 PM
Linux mint 12 will not connect to wifi internet or android wifi tethers wilspeak Linux - General 4 06-06-2012 12:40 AM
Can connect to the internet with wifi Jack7359 Linux - Networking 8 06-03-2011 08:21 PM
How to connect to Internet by WiFi zxcvar Linux - Wireless Networking 1 08-20-2008 12:00 PM
Wifi@Home can't connect to internet mlr266 Linux - Newbie 6 11-24-2004 05:48 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 12:07 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