From your description, My guesstimate is that either you encountered a bug in NetworkManager or a driver issue. I'm inclined to believe it's the second case because (a) you mentioned 'internet went "down" randomly' (b) your wireless hardware is a relatively new model made by Realtek.

If I were you, I would:

Firstly, I would try to do a fresh install of Debian 9 to see if newer version of NetworkManager and improved driver code in a newer kernel would help. In fact, this device's PCI ID was first seen in kernel v3.18 and the driver 'rtl8821ae' is backported to Linux 3.16 according to this page.

I did some additional testing last night and it appears each time I log out and change desktop environments (Gnome -> LXDE; vice-versa) and not necessarily reboot is when the Network Manager updates/wipes my nameservers. (Hadn't initially considered this to be the culprit, hence the assumption of it being a random disconnect).

I wasn't doing anything special to switch environments; I installed them both via commandline and used Debian's repositories for both.. since its a new install I was testing out GUI to see which one I liked best.I'd log out of my session, hit the wheel and select which GUI I wanted to log into.

I did a shut down, power up & never lost connectivity and didn't have to intervene to get online.

With that said, is this type of situation still requiring of new drivers? If so, I'd like to try better drivers opposed to doing an install of Debian 9.Presumably, these are what I'll need, correct? https://github.com/lwfinger/rtlwifi_new ... /rtl8821ae If so, how do I get them to my system?

d3viant wrote:......it appears each time I log out and change desktop environments (Gnome -> LXDE; vice-versa) and not necessarily reboot is when the Network Manager updates/wipes my nameservers.

I think it might be that each time NetworkManager.service is restarted it will re-autogenerate /etc/resolv.conf. And the nameserver it will put in comes from NetworkManager's connection profile, which can be configured by 'Edit Connections...' - '<connection>' - 'IPv4/6 Settings'.Since you are mixing ifupdown and NetworkManager by setting "managed=true", I guess you might have some related pseudo 'connection' avalible for configuration in 'Edit Connections...'. I haven't verified myself since this mixed setup is usually considered pretty strange.

d3viant wrote:(Hadn't initially considered this to be the culprit, hence the assumption of it being a random disconnect).With that said, is this type of situation still requiring of new drivers?

Well, if this is the case I would take back the suspiction on drivers... I guess it will be easier if we go all the way back to beginning where the first problem appeared. That is, after a fresh install you "...immediately had no connection.", which is the part we should investigate. Normally if it works, when you click the NM icon in the system tray, you would see a list of nearby access points, and if you select one, it should connect. So it would help a lot if you could describe what exactly happened at that moment.

And as for now, if you verify that if you revert to "managed=false" and remove all configuration from /etc/network/interfaces, would you be greeted with the exact same behaviour as right after a fresh install? If this is the case, then we can start from here and hopefully we'll be able to fix the issue cleanly.

d3viant wrote:......it appears each time I log out and change desktop environments (Gnome -> LXDE; vice-versa) and not necessarily reboot is when the Network Manager updates/wipes my nameservers.

I think it might be that each time NetworkManager.service is restarted it will re-autogenerate /etc/resolv.conf. And the nameserver it will put in comes from NetworkManager's connection profile, which can be configured by 'Edit Connections...' - '<connection>' - 'IPv4/6 Settings'.

I disabled ipv6 from the wifi gui.

Since you are mixing ifupdown and NetworkManager by setting "managed=true", I guess you might have some related pseudo 'connection' avalible for configuration in 'Edit Connections...'. I haven't verified myself since this mixed setup is usually considered pretty strange.

This is uncharted territory for me, I was desperate and tried to get creative I set managed=false, restarted network manager and so far, so good!

I just installed Deluge and went to start some torrents, I'm not getting any activity (which ended up being because the seeders were simply slow) so I inspected /var/log/syslog... I think I found the problem (not sure why I didn't look here in the first place..) -- I got the drivers *from* the Debian site and stuck em on a USB so they loaded during install.

wlan0: Failed to initialize driver interface

Since the error is complaining about wlan0 (remember, I manually enabled this in /etc/network/interfaces to originally get online?) I went and changed that to wlan1.. knocked me offline.

Changed it back.. all is good.. for a few minutes. I just had a Debian popup asking me to re-auth my wifi. From syslog:

No, nothing changed with the key or router.I *do* have two wifi cards: 1 internal and 1 dongle. I use the dongle because it is significantly faster than the onboard wifi for some reason.I was not trying to use both at once. I was actually only using Firefox when this occurred.

UPDATE:It's been a while and I've been periodically checking syslog, so far, this is the only type of activity I'm regularly seeing:

d3viant wrote:I set managed=false, restarted network manager and so far, so good!setting NetworkManager to managed=false means this is no longer taken, correct?

No, setting "managed=false" will instruct NM to get out of the way for ifupdown. In this case, you would see wlan0 listed as "Device not managed" in the systray nm-applet menu. As long as wlan0 is still configured in /etc/network/interfaces, ifupdown will try to take over.

d3viant wrote:wlan0: Failed to initialize driver interface

At which moment did you see this message? Is it right after installation before you put wlan0 configurations in /etc/network/interfaces?

I guess both the above quoted message and "pre-shared key may be incorrect" indicated some problem with wpa-supplicant. In fact I'm pretty much out of idea at this point, since a problem with wpa-supplicant is a rare occurence to me. And although the keyword 'driver' in the above quoted message actually means userspace drivers such as 'wext' or 'nl80211', I still wouldn't be at all surprised if it is the kernel device driver — which is our initial suspicion — that is actually acting up. This still a real possibility since your internal wireless card is using backported kernel driver, and the external dongle R8188EU is also highly vulnerable to device driver issues — Cheap realtek USB wifi dongles have notoriously buggy firmware and linux kernel drivers.

I'm terribly sorry for not being able to provide specific solutions to the wpa-supplicant problem. But as stated above, the root cause might be elsewhere.

Slow progress.. syslog is no longer filling up with the wlan0: Failed to initialize driver interface every few seconds.

This still a real possibility since your internal wireless card is using backported kernel driver, and the external dongle R8188EU is also highly vulnerable to device driver issues — Cheap realtek USB wifi dongles have notoriously buggy firmware and linux kernel drivers.

Uh oh, I paid $5 for it!In your opinion, what's the best dongle for a Linux system? I'm not against spending more money on one, I just happened to have it laying around as a backup when I realized my new laptop had a crappy connection.

I'm terribly sorry for not being able to provide specific solutions to the wpa-supplicant problem. But as stated above, the root cause might be elsewhere.

You've been super helpful! Thanks for offering any tips at all, every little bit helps!

If this continues, I'm going to detach the dongle and work on the internal wifi and see if that clears up any issues.

So somehow "pure NetworkManager" mode now works, and the initial problem "...installed Debian and immediately had no connection." is intermittent.

d3viant wrote:In your opinion, what's the best dongle for a Linux system?

I can't give a definitive answer, because I've yet to have a wireless card that gave 100% reliable record in Linux, some better, some worse. From all the USB Wi-Fi dongles I've had, I would say Ralink RT5370 and Atheros AR9271 based USB dongles gave me the least troubles overall. But these two chips are all discontinued, which means they are less likely to appear on large B2C sites or a local radioshack. But it's still quite possible to buy dongles with these chipsets on sites such as aliexpress or ebay.

d3viant wrote:is this type of situation still requiring of new drivers? If so, I'd like to try better drivers opposed to doing an install of Debian 9

If you don't have a particular use case that requires Debian 8, I would recommend doing a fresh install of Debian 9 since I believe rtl8821ae's driver status would be much improved in Linux 4.9.

d3viant wrote:...when I realized my new laptop had a crappy connection.

Well, if your laptop is new, that's another reason to install Debian 9.

orythem27 wrote:So somehow "pure NetworkManager" mode now works, and the initial problem "...installed Debian and immediately had no connection." is intermittent.

Could this be somehow related to the fact that the OS originated from an ISO and not a CD?

orythem27 wrote:If you don't have a particular use case that requires Debian 8, I would recommend doing a fresh install of Debian 9 since I believe rtl8821ae's driver status would be much improved in Linux 4.9.

The dist upgrade path isn't recommended, in this case?

I'm definitely not pressed on Debian 8; this is my first taste of Debian and I wanted the latest stable release. The ISO's on the Debian site all pointed at 8. (I did read, that the ISO's aren't as up-to-date as the live CDs, which is fine - I don't mind the extra effort. It's a good learning experience.)

There is a "freeze," on 9 according to this wiki: https://wiki.debian.org/DebianStretch and 8 has more recent updates than 9 - is this definitely the best route to go? It being a "testing" distro is a little concerning to me.. I appreciate a good challenge but I'd also like to use Debian as my daily driver.

Based on this thread: viewtopic.php?f=30&t=133065 I'm not sure I'm ready to use Debian 9. I really don't know what I'm doing just yet. Though, if I encounter catastrophe and need to wipe Debian I will probably consider 9. For future reference, is it available on ISO? I could only locate 8.8 for amd64.

d3viant wrote:Could this be somehow related to the fact that the OS originated from an ISO and not a CD?

By "ISO" and "CD" did you refer to a USB flash drive and a physical CD/DVD-R disc? Personally I can't see any difference.

d3viant wrote:The dist upgrade path isn't recommended, in this case?

Well, consider that your Debian 8 installation is kinda 'fresh', you wouldn't lose much work by doing a complete reinstall anyway. I think most people won't have any issue with dist-upgrade, but personally I would prefer a fresh reinstall to "further" ensure a bug-free experience.

d3viant wrote: 8 has more recent updates than 9

Debian 8 is the current stable release means that it will only receive bug fixes in its lifetime. There will be no new feature or major software version updates. From this point view, the term "stable" in "Debian stable" actually means "not changing" rather than "crashproof".

d3viant wrote:...is this definitely the best route to go? It being a "testing" distro is a little concerning to me...

Better support for recent hardware is already a pretty strong argument. And although technically it's still in the "testing" phase, I would say that it's already so close to being released that the possibility of encountering a bug is pretty low.

d3viant wrote:I appreciate a good challenge but I'd also like to use Debian as my daily driver.

If you hang around in various linux forums, you will see a lot of people claiming that Debian unstable is actually fully qualified as a daily driver. As for Debian testing, there are even more people considering it as "rock solid". By that logic, a freezed debian testing close to release would be "bedrock solid".

d3viant wrote:For future reference, is it available on ISO? I could only locate 8.8 for amd64.

d3viant wrote:Based on this thread: viewtopic.php?f=30&t=133065 I'm not sure I'm ready to use Debian 9.

To be honest, I'm having slight trouble understanding what the OP is asking in this thread. Gparted is available in stretch. And the question regarding security repos, because stretch is not yet the current stable release, it won't receive critical security patches in a timely manner, as stated in https://www.debian.org/releases/stretch/. In fact, this is one of the major arguments against using testing, especially in security sensitive use cases, such as a computer directly exposed with a public IP address.

When it is configured properly NetworkManager is a wonderful program. Otherwise it can drive a user nuts. From my own experience and watching threads on this forum I'm convinced that most problems with NetworkManager are self induced. What many users do in frustration is to disable or remove NetworkManager and install Wicd. Neither is better than the other but it gives you a fresh configuration.

Both NetworkManager and Wicd are simply front end GUI's for wpa_supplicant which does the actual work. If you are using a desktop, you don't need either NetworkManager or Wicd which you found out with your scripts in /etc/network/interfaces. I have run my desktop like this for years and prefer it. You've probably seen this but here: How to use a WiFi interface

orythem27 wrote:By "ISO" and "CD" did you refer to a USB flash drive and a physical CD/DVD-R disc? Personally I can't see any difference.

USB. I initially assumed they were the same thing, but users around the web insist the iso/usb is out of date.

Debian 8 is the current stable release means that it will only receive bug fixes in its lifetime. There will be no new feature or major software version updates. From this point view, the term "stable" in "Debian stable" actually means "not changing" rather than "crashproof".... Better support for recent hardware is already a pretty strong argument. And although technically it's still in the "testing" phase, I would say that it's already so close to being released that the possibility of encountering a bug is pretty low.

Ah, I see your point!

If you hang around in various linux forums, you will see a lot of people claiming that Debian unstable is actually fully qualified as a daily driver. As for Debian testing, there are even more people considering it as "rock solid". By that logic, a freezed debian testing close to release would be "bedrock solid".

As for now you can download the "testing" ISO images at [url]http://cdimage.debian.org/cdimage/weekly-builds/

I'm considering the dist upgrade first, it took a super long time for Gnome to download during initial install and I would like to *try* and avoid such happening again.Though, if unsuccessful, which is best to download from here? http://cdimage.debian.org/cdimage/weekl ... 64/iso-cd/ the netinst gets the files off the web, and the xfce installs a desktop environment...?

And the question regarding security repos, because stretch is not yet the current stable release, it won't receive critical security patches in a timely manner, as stated in https://www.debian.org/releases/stretch/. In fact, this is one of the major arguments against using testing, especially in security sensitive use cases, such as a computer directly exposed with a public IP address.

[/quote]This is a concern of mine, as I regularly torrent. How much risk is involved for a casual internet user (I don't venture into the dark web or anything like that)

Bulkley - Thanks for the links, I actually haven't come across these yet!Is it safe to say Networkmanager isn't pre-configured on Debian?

It is to a point. I don't think it is configured to be as user friendly as I have found in other distros. I've tried a number of live-CD's in which NetworkManager simply works. When I tried it in a Debian install I made a mistake (or two) answering questions that came up and wound up with NetworkManager demanding for an extra password every time I logged on. With my present /etc/network/interfaces configuration wpa_supplicant connects to my Wifi router during the boot process even before I log in.

A desktop computer generally doesn't travel anywhere and only has one Wifi connection to make. Thus, it does not need a GUI Wifi tool. Just remember to hide your /etc/network/interfaces if you put in anything you don't want your neighbourhood scriptkiddy to see like a password.