To run the ifconfig ... command , you should install the net-tools package.
Because the net-tools is deprecated there is the ip and 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?
Create a 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 lspci -k
And then to know if your interface is correctly detected and named you can use ip link 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 /etc/sysconfig/network-scripts/ifcfg-<interface-name>
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:
  1. If you got connected to Wifi network when you have installed CentOS 7.
  2. 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.

Your Answer

 
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of serviceprivacy policy and cookie policy, and that your continued use of the website is subject to these policies.