Many time while using Raspberry PI people come across a situation that they have to connect their PI to the Internet through the Local n/ws.Usually a systemis assigned with IPs those are dynamic(DHCP) i.e. any IP is assigned to the device during the connection setup and that's the case for PI also and it works fine also.But in certain cases yo may have to configure your PI with a static IP ,like suppose you want to make your PI a server.Here i have given the steps to add a static IP to your Pi.
Open the terminal and type
cd /etc/network
then
sudo pico interfaces
Then change the content to this,where you will have to set the corresponding values depending upon your network.
auto lo iface lo inet loopback iface eth0 inet static
address xx.xx.xx.xx network xx.xx.xx.xx broadcast xx.xx.xx.xx gateway xx.xx.xx.xxpress
ctrl+x
and then
y
to save and exit.
Now we have to set the DNS and that is done by esiting the file resolv.conf.So you can edit it by
sudo nano /etc/resolv.conf
and add below shown to the file and save it like before.
nameserver xx.xx.xx.xxNow reboot your system by giving command
reboot
That's all you are ready to go.
No comments:
Post a Comment