Connecting WIFI from terminal or Recovery on Debian system

Connecting to the wifi:-

Here in this post we are going to talk about how one can connect their system to the wireless network available in their vicinity. To do so, start the network manager that will cofigure the /etc/resolv.conf file for dns, Most of the people face the issue of can not find resolv.conf or can not resolve the host about which we are going to talk in the post later. provided, follow the steps to connect to wifi and PING google.com just to be sure that your packets are getting transmitted and being recieved at the other side. write the following commands at the terminal in the sequence...

STEPS:-
  •  term@terminal:~$ sudo ifconfig -a       //this will give you all the NIC           //available for your pc. lets say your wireless adapter is 'wlp0'
  • term@terminal:~$ sudo ifconfig wlp0 up //setting the adapter to up and listening
  • term@terminal:~$ sudo iwlist wlp0 scanning //this will give you the list of the available wifi networks select the one your want to connect. REMEMBER that the wifi should not be password configured. As it can only configure WEP passkeys and will not work for WPA/WPA2 password protected. lets say that your network name is 'NETWORK_NAME' which is shown as essid.
  • term@terminal:~$sudo iwconfig wlp0 'NETWORK_NAME' //now you are connected to the desired network.
  • term@terminal:~$ ping google.com //just to be sure that you are connected.
hopes this have helped you in connecting your system to the wifi. this will also work if you are trying to connect from the recovery terminal. Now if you are facing issues like resolv.conf is not a file or directory or you are not able to reach to the your system archive server. follow the following fix that may help you to get connected..

TO FIX RESOLV.CONF IS NOT A FILE OR DIRECTORY:-


/etc/resolv.conf is the file that your system uses to get the dns information required to travel to the servers. now i don't know what you did but somehow the file resolv.conf is missing from the /etc/ directory. To fix this create a resolv.conf file in the /etc/ directory, to do so you will need the root permission to read or write in this directory and set the read/write mode using the chmod command with root permission (use sudo to execute all commands). And for the file contents copy the following and save it, to do so you can use any editor that is available at your hand i prefer 'nano' editor. contents of the file is given below in red color copy paste it directly into the file...these are the publicly open google nameservers..

nameserver   8.8.8.8
nameserver   8.8.4.4

after copying save the file in read write mode. and if you are connected to the some network disconnect/connect it again and ping any server to see if you are connected. 

upgrade/update/install hung at 0%:

Now to fix the third issue that you might face is your update with aptitude/apt/apt-get might get hung at 0% that it cant reach the archive server. before proceeding further first check that your version of Operating System is still getting the update from the canonical or not. if not manually download the latest LTS or any supported version you want and install onto the system. The issue you are facing might because of the connection you are using is IPv6 and to change and you need to change it so that it enable IPv4 addinfo extraction.

 gai.conf: getaddrinfo file.

Now to fix the issue of apt-get/apt go to the /etc/ folder and follow these steps:-
  • term@terminal:~$ sudo nano gai.conf //this will open your file in read and write mode. after opening find and un-comment the following line  'precedence ::ffff:0:0/96  100' remember, do not uncomment any other line in the file. this might solve your issue in resolving the connection to the linux archive server.
 
_______________________________The End__________________________________
Hoping this would be helpful to you, if not, post your problem in the comment section and i will try to get back to you as soon as possible.

tell me, how do you like this solution? and what is there that i can improve...

follow me on hackerrank: www.hackerrank.com/satyansh_sagar

Comments

Popular posts from this blog

Contest Leaderboard: hackerrank problem (Level medium)

The Occupation: hackerrank problem

Placements: SQL Advance join (Hackerrank Problem)