The officially official Devuan Forum!

You are not logged in.

#1 2016-12-05 17:57:05

edbarx
Member
Registered: 2016-12-01
Posts: 20  

How to connect to Wifi without a network manager.

Introduction:
Sometimes an installation finishes without setting up a working network connection. In such cases, a user might find themselves requiring network access to get the necessary packages to properly setup Wifi.

Warning:
Some wifi manufactures do not cooperate with open source developers to publish the required information about their devices so that free software developers can write open drivers. In this case, either reverse engineering takes place when possible technically and legally, or a proprietary closed driver is provided.

For a list of Wifi makers and whether they provide open source drivers check the link: https://wiki.debian.org/WiFi

Note:
Please note that once you have a wifi driver installed you can use a network manager to manage your connection. If you decide to do that, comment any lines added to your /etc/network/interfaces as a result of this howto.

The Procedure for Wifis using encryption:

  1. Open a terminal and run nano to open /etc/network/interfaces.

    # nano /etc/network/interfaces
  2. For Wifi add these lines:

    iface wlan0 inet dhcp
    	wpa-ssid my_wifi_name
    	wpa-psk "my_very_hard_password"

    Replace my_wifi_name with your wifi's SSID and my_very_hard_password with your wifi password.

  3. Save and exit nano.

  4. To connect, use ifup as follows:

    # ifup wlan0

    Please note you may need to use another name for wlan0. You can list your network devices by running:

    ip link

    Ifup will display text informing the user whether a connection has been established.

To disconnect a connection established with ifup, run:

# ifdown wlan0

The Procedure for OPEN Wifis:

  1. First bring up the network interface wlan0 or whatever you have.

    #ifconfig wlan0 up
  2. Assuming your wifi hotspot's name, ESSID, is freeopenwifi, run:

    # iwconfig wlan0 essid freeopenwifi
  3. Run dhclient to assign an ip address so that the connection becomes useable.

    # dhclient wlan0

To disconnect a connection established with ifconfig and iwconfig, follow the following short procedure:

  1. First clear the DHCP lease with:

    # dhclient -r wlan0
  2. Then, either bring the connection down:

    # ifconfig wlan0 down

    OR force a null connection:

    # iwconfig wlan0 ap 00:00:00:00:00:00

Enjoy.  big_smile

Last edited by edbarx (2016-12-09 06:49:18)

Offline

#2 2016-12-06 13:30:09

catprints
Member
Registered: 2016-11-30
Posts: 145  

Re: How to connect to Wifi without a network manager.

I found this helpful. Thankyou. It was short and effective.


"The obstacle is the path."

Offline

#3 2017-05-29 06:21:54

Ozi
Member
From: Melbourne, Australia
Registered: 2017-03-15
Posts: 105  
Website

Re: How to connect to Wifi without a network manager.

http://kalos.mine.nu/setnet/

Setnet - Text-based User Interface tool for ethernet and wi-fi network configuration
   
        http://kalos.mine.nu/setnet/
        setnet
        wpasupplicant
        net-tools
        iputils-ping
        bind9-host
        traceroute

        Make sure wpasupplicant was running before starting setnet.sh

        run these in separate terminals:
        sudo ifup wlan0 &
        sudo setnet.sh

Offline

#4 2017-05-29 16:05:47

yeti
Member
From: I'm not here: U R halucinating
Registered: 2017-02-23
Posts: 334  

Re: How to connect to Wifi without a network manager.

Is /etc/network/interfaces a safe place for passwords?

I put mine in /etc/wpa_supplicant/wpa_supplicant.conf... see wpa_passphrase... and the interface definition in /etc/network/interfaces only contains...

iface wlan0 inet dhcp
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

Maybe having passwords in /etc/network/interfaces is ok too... if chmod-ed not to be world readable... what side effects might that have? Does it need to be o+r for some other functionality?


*๐š›๐š’๐š‹๐š‹๐š’๐š!*

Offline

#5 2017-06-12 20:35:26

stephen
Member
Registered: 2017-06-12
Posts: 1  

Re: How to connect to Wifi without a network manager.

Nice guide!

Though I'm a little curious why you switch between ip and ifconfig and not stick with just one or the other.  You mention the use of ip first, so why not stick with it?

For example,

ifconfig wlan0 up

is accomplished with

ip link set wlan0 up

.  And down:

ip link set wlan0 down

.

Offline

#6 2017-06-12 23:46:33

Somewhat Reticent
Member
Registered: 2017-04-06
Posts: 103  

Re: How to connect to Wifi without a network manager.

Does this handle priorities or hotplug?

Offline

#7 2017-06-13 01:25:51

mckaygerhard
Member
Registered: 2017-04-21
Posts: 283  
Website

Re: How to connect to Wifi without a network manager.

stephen wrote:

For example,

ifconfig wlan0 up

is accomplished with

ip link set wlan0 up

.  And down:

ip link set wlan0 down

.

the ip link way its better .. by example when some interface are gone due broken hotplug usb.. the ifconfig way does not work...

Last edited by mckaygerhard (2017-06-13 01:26:14)

Offline

Board footer