1 1
AVP

Wireless connection using command line instead of graphical tool

Recommended Posts

Hi,

 

I have armbian image with kernel 4.4.184-rockchip64. Now I want to connect with Wifi using commands but I dont know how to connect using commands. I am able to connect with WiFi using Graphical tool.

 

Below are my observations:

a) Instead of wlan0, p2p0 interface is used to connect with wireless network.

b) I am able to scan with wlan0 using below command:

       iw dev wlan0 scan

c) iw dev p2p0 scan gives output associated interface( the one connected using Graphical Tool).

d) I created wpa_supplicant.conf file and executing below command shows wpa_supplicant initialized but does not get IP address. 

      wpa_supplicant -Dnl0211 -iwlan0 -c/etc/wpa_supplicant.conf -B

 

Can anyone please tell me how to connect to any network without using Graphical tool. In my case p2p0 interface is used for Wireless Connection instead of wlan0 interface.

Share this post


Link to post
Share on other sites
23 minutes ago, AVP said:
 

Hi,

 

I have armbian image with kernel 4.4.184-rockchip64. Now I want to connect with Wifi using commands but I dont know how to connect using commands. I am able to connect with WiFi using Graphical tool.

 

Below are my observations:

a) Instead of wlan0, p2p0 interface is used to connect with wireless network.

b) I am able to scan with wlan0 using below command:

       iw dev wlan0 scan

c) iw dev p2p0 scan gives output associated interface( the one connected using Graphical Tool).

d) I created wpa_supplicant.conf file and executing below command shows wpa_supplicant initialized but does not get IP address. 

      wpa_supplicant -Dnl0211 -iwlan0 -c/etc/wpa_supplicant.conf -B

 

Can anyone please tell me how to connect to any network without using Graphical tool. In my case p2p0 interface is used for Wireless Connection instead of wlan0 interface.

 

nmtui

 

Share this post


Link to post
Share on other sites

As I mentioned in my query I want to connect using command line not any tool or something. nmtui pops out tool for manual selection.

I want to use commands similar like wpa_supplicant and the pass a .conf file which contains ssid,password etc.

Share this post


Link to post
Share on other sites

Network Manager is garbage.  We had to uninstall it and go with wpa_supplicant on our 90+ tinker boards that we have deployed.  Constant disconnects with Network Manager and wpa_supplicant works all the time.

Share this post


Link to post
Share on other sites

Hello,

 

could you please share your configuration files (interfaces and wpa_suplicant.conf) as an example on how to achieve WiFi connection using the wpa_supplicant method? 

 

Thanks.

Share this post


Link to post
Share on other sites
8 hours ago, Ravaz said:

Hello,

 

could you please share your configuration files (interfaces and wpa_suplicant.conf) as an example on how to achieve WiFi connection using the wpa_supplicant method? 

 

Thanks.

create /etc/wpa_supplicant/wpa_supplicant.conf with 

su -c "wpa_passphrase myssid my_very_secret_passphrase > /etc/wpa_supplicant/wpa_supplicant.conf"

myssid = your WiFi-name
my_very_secret_passphrase = you WiFi-Password

 

wlan0-part of /etc/network/interfaces:
 

# wlan0 static ip
auto wlan0
allow-hotplug wlan0
iface wlan0 inet static
address 192.168.6.126
netmask 255.255.255.0
gateway 192.168.6.1
dns-nameservers 8.8.8.8 8.8.4.4
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
wireless-mode Managed
wireless-power off

# or wlan0 dhcp
# auto wlan0
# iface wlan0 inet dhcp
# wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

also fill /etc/resolv.conf with

nameserver 8.8.8.8
nameserver 8.8.4.4

 

Share this post


Link to post
Share on other sites

Basically in 99.99% use case you can configure wifi with

 

wpa_passphrase <your-ssid> <your-passphrase> | wpa_supplicant -B -i wlan0 -c /dev/stdin

ifconfig wlan0 <your-ip> netmask <your-netmask>

route add default gw <your-router-address>

echo "nameserver 8.8.8.8" > /etc/resolv.conf

 

in some old very-deprecated rc startup file.

 

And remove nm ifup zeroconf dhcpd ... and other "wonderfull dynamic modern"  automatic bug generators ...

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
1 1