Freedom Penguin

Linux Software Reviews, Discussion and Articles

  • About Us
    • Privacy Policy
    • Disclosure
    • Contact Us
  • Categories
    • How To
    • Quick Tips
    • Opinion
    • News
    • Just Ask Matt
    • Distro Review
    • The Linux Crowd
    • Software
    • Networking
    • Cloud
  • Linux FoSS Shirts
You are here: Home / Articles / Networking / WiFi Without Network Manager Frippery

WiFi Without Network Manager Frippery

09.09.2024 by Jed Reynolds //

Back in my day, sonny…there was a time when you could make your networking work without the network manager applet. Not that I’m saying the NetworkManager program is bad, because it actually has been getting better. But the fact of the matter is that I’m a networking guy and a server guy, so I need keep my config-file wits sharp. So take out your pocket knife and let’s start to whittle.

Begin by learning and making some notes about your interfaces before you start to turn off NetworkManager. You’ll need to write down these 3 things:

1) Your SSID and passphrase.
2) The names of your Ethernet and radio devices. They might look like wlan0, wifi0, eth0 or enp2p1.
3) Your gateway IP address.

Next, we’ll start to monkey around in the command line… I’ll do this with Ubuntu in mind.

So, let’s list our interfaces:

$ ip a show

Note the default Ethernet and wifi interfaces:
ip-a-show

It looks like our Ethernet port is eth0. Our WiFi radio is wlan0. Want to make this briefer?

$ ip a show | awk  '/^[0-9]: /{print $2}'

The output of this command will look something like this:

lo:
eth0:
wlan0:

Your gateway IP address is found with:

route -n

It provides access to destination 0.0.0.0 (everything). In the below image it is 192.168.0.1, which is perfectly nominal.

route-n
Let’s do a bit of easy configuration in our /etc/networking/interfaces file. The format of this file is not difficult to put together from the man page, but really, you should search for examples first.
interfaces
Plug in your Ethernet port.

Basically, we’re just adding DHCP entries for our interfaces. Above you’ll see a route to another network that appears when I get a DHCP lease on my Ethernet port. Next, add this:

 

auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
auto wlan0
iface wlan0 inet dhcp

 

To be honest, that’s probably all you will ever need. Next, enable and start the networking service:

sudo update-rc.d networking enable

 

sudo /etc/init.d/networking start

Let’s make sure this works, by resetting the port with these commands:

sudo ifdown eth0

 

sudo ip a flush eth0

 

sudo ifup eth0

This downs the interface, flushes the address assignment to it, and then brings it up. Test it out by pinging your gateway IP: ping 192.168.0.1. If you don’t get a response, your interface is not connected or your made a typo.

Let’s “do some WiFi” next! We want to make an /etc/wpa_supplicant.conf file. Consider mine:

network={
ssid="CenturyLink7851"
scan_ssid=1
key_mgmt=WPA-PSK
psk="4f-------------ac"
}

Now we can reset the WiFi interface and put this to work:

sudo ifdown wlan0

 

sudo ip a flush wlan0

 

sudo ifup wlan0

 

sudo wpa_supplicant -Dnl80211 -c /root/wpa_supplicant.conf -iwlan0 -B

 

sudo dhclient wlan0

That should do it. Use a ping to find out, and do it explicitly from wlan0, so it gets it’s address first:

 

$ ip a show wlan0 | grep "inet"

192.168.0.45

$ ping -I 192.168.0.45 192.168.0.1

Presumably dhclient updated your /etc/resolv.conf, so you can also do a:

ping -I 192.168.0.45 www.yahoo.com

Well guess what - you’re now running without NetworkManager!

Jed Reynolds
Jed Reynolds
Jed Reynolds has been known to void warranties and super glue his fingers together. When he is not doing photography or fixing his bike, he can be found being a grey beard programmer analyst for Candela Technologies. Start stalking him at https://about.me/jed_reynolds.

Categories // Networking

Follow Freedom Penguin

Affiliate Disclosure

Freedom Penguin is a partner with the eBay Partner Network, an affiliate program designed to provide means for a site to earn advertising fees by advertising and linking to eBay.com.

Freedom Penguin is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com

Copyright © 2019 · Modern Studio Pro on Genesis Framework · WordPress · Log in

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish.Accept Reject Read More
Privacy & Cookies Policy

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these cookies, the cookies that are categorized as necessary are stored on your browser as they are as essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may have an effect on your browsing experience.

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these cookies, the cookies that are categorized as necessary are stored on your browser as they are as essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may have an effect on your browsing experience.

Necessary Always Enabled

Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.

Non-necessary

Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.