This Instructable will give you clear idea about how to configure static IP address for raspberry Pi. Whenever you connect the Raspberry pi to your network the router assigns random IP address, this may become difficult to access your Raspberry pi via ssh . Every time you need to log on your router and have to check the IP address of Raspberry pi.So to overcome this we will configure the Raspberry pi to static ip address.
Before configuring the raspberry pi ,configure the static address in your router. The configuration in router varies from model to model. In our case we have configured in D-Link.To avoid IP conflict configure on both router and raspberry Pi
Log on to the router by entering the following address 192.168.1.1(this may change ) and enter user name and password .On the static IP address setting page mention MAC address of raspberry pi wireless network/or ethernet network and enter the IP address to which the you want to connect as shown in the images
Run sudo nano/etc/network/interfaces . This opens the configuration file for the network settings in the nano text editor.The screenshot is shown in the image1 and make changes from eth0 to wlan0 and manual to static as shown in image2, because we are using wireless. Next , add the following lines directly below the line you just altered.
address [your chosen IP address]
netmask [your netmask]
network [your destination]
broadcast [your broadcast range]
gateway [your gateway]
save your file and run sudo reboot to restart your Raspberry Pi with its new static IP address. The changes we have made will only take effect after a reboot.Hope its very clear instructable