Friday, July 3, 2015

Static WIFI address

How to use Rpi with wifi dongle and access it with fixed ip

the coming steps will lead to full control of the Rpi with wifi


first of all you have to connect to Rpi via cable connected to the local Router  (disconnect the wifi dongle ) and find its ip address to connect it via SSH . (these easy steps will be discussed later)

secondly after connection and opening SSH connection
go to /etc/network/interfaces via this command

       sudo nano /etc/network/interfaces


you will find these lines as image

change manual to static 
then add these lines and configure them according to your network settings

   allow-hotplug wlan0

   auto wlan0

   iface wlan0 inet static

   address 192.168.1.22

   netmask 255.255.255.0

   gateway 192.168.1.1


don't forget to put your own wanted ip instead of 192.168.1.22

the final look of the file /etc/network/interfaces will be 


press Ctrl+x then Enter to save the file and exit from nano editor 


now you have to enter the data of wifi name (ssid) and password
go to /etc/wpa_supplicant/wpa_supplicant.conf

       sudo nano /etc/wpa_supplicant/wpa_supplicant.conf


copy this Template to the file and add wifi name instead of "wifi_name" and wifi password instead of "wifi_password"


   network={
            ssid="wifi_name"
            psk="wifi_password"
            key_mgmt=WPA-PSK
   }

press Ctrl+x then Enter to save the file and exit from nano editor
then reboot the Rpi to active these settings you can use this line to reboot successfully

   sudo reboot ; exit




for any questions don't hesitate to ask to seek for answer together .



---------------------
hint : i still have problem with global connection with the Rpi with static ip 
the problem is with DNS put iam seeking for solution and i will publish it "Inshaa Allah".







No comments:

Post a Comment