- How to turn WiFi on/off?
- How to get list of available WiFi connections?
- How to connect WiFi that i want to connect with?
The best and easy option I like to use with CentOS is nmtui. (Ref: Redhat)
THIS IS NOT GUI, IT IS TUI (TEXT USER INTERFACE)
First you have to install nmtui,
# yum install NetworkManager-tui
This will option up what you are after.
Now you can go to Edit connection and itwill list out all the available WiFi connections for you. Then you can select what you want and Activate/Deactivate what ever you want.
To run the
ifconfig ... command , you should install the
net-tools is deprecated there is the
iw commands which answer your question:
How to turn WiFi on/off?
$ ip link set <interface> up $ ip link set <interface> down
How to get list of available WiFi connections?
$ iw dev <interface> scan | grep SSID
How to connect WiFi that i want to connect with?
wpa_supplicant configuration file with the following content:
ctrl_interface=/run/wpa_supplicant update_config=1 ap_scan=1
To add the SSID and the password, run:
$ wpa_passphrase "YOUR-SSID" YOUR-PASSWD >> /etc/wpa_supplicant/wpa_supplicant.conf
To connect run:
$ wpa_supplicant -i <interface> -c /etc/wpa_supplicant/wpa_supplicant.conf -B dhclient <interface>
You should be able to see if the drivers for the card are installed by using
And then to know if your interface is correctly detected and named you can use
You can then try to bring up the interface with ifup
If the interface does not come up correctly it might be because you're missing a configuration file like
Another alternative solution if it's something you only want to bring up once you can input the following commands :
ip link set dev <interface-name> up wpa_supplicant -B -i <interface-name> -c /etc/wpa_supplicant/wpa_supplicant.conf dhcpcd <interface-name>
If you are running CentOS 7: You may want to check if NetworkManager is already there available for you to use:
chkconfig NetworkManager on
service NetworkManager start
Issue command: nmtui
Go directly to "Active a connection" to check if you already can see your wireless network/wi-fi. If so, input your password.
You can also Edit a profile for the wi-fi you want to connect.
NOTE: if you cannot active a wi-fi, try the following: After above steps: /etc/init.d/network restart OR REBOOT/RESTART your box.
Here is my experience, for the following reasons:
- If you got connected to Wifi network when you have installed CentOS 7.
- After CentOS 7 entering into sleep mode OR accidental shutdown due to power drainage OR you have restarted & logged into CentOS 7
and if your wifi not working.
Don't install extra kernel module/do any tweaks/install any new packages
Just shutdown and boot again in CentOS 7. Your wifi will start working again.
This is what I realised after 6 hours of tweaks and tried everything out.