Jump to content

Wireless connection using command line instead of graphical tool


AVP

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.

Link to comment
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

 

Link to comment
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.

Link to comment
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

 

Link to comment
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 ...

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines