Page 1 of 1

static ip

Posted: Mon Mar 10, 2014 7:18 am
by nakshatra
hi friends,
am currently working out on Raspberry pi as a low cost HD Surveillance camera.now i want to create a static ip address to my pi and then access the live streaming with that.can i do that??

Re: static ip

Posted: Mon Mar 10, 2014 7:24 am
by Richard-TX
yes

Re: static ip

Posted: Mon Mar 10, 2014 1:01 pm
by klricks
Use IP to MAC address reservations via DHCP instead of static in your router. It is easier to set up that way as the RPi always gets the same IP address and there is no configuration needed on the RPi itself.

Re: static ip

Posted: Mon Mar 10, 2014 11:53 pm
by DougieLawson
klricks wrote:Use IP to MAC address reservations via DHCP instead of static in your router. ...
If your router supports that. Most routers I've used don't have that feature.

Re: static ip

Posted: Tue Mar 11, 2014 12:15 am
by klricks
DougieLawson wrote:
klricks wrote:Use IP to MAC address reservations via DHCP instead of static in your router. ...
If your router supports that. Most routers I've used don't have that feature.
The routers I have used over the past several years have that feature. My old WRT54G did not have it, but could be added by flashing a 3rd party firmware. DD-WRT

Re: static ip

Posted: Tue Mar 11, 2014 4:44 am
by Richard-TX
Just learn how to assign a static IP. There are places in this world that don't have DHCP.

Re: static ip

Posted: Tue Mar 11, 2014 7:37 am
by allfox
Hey guys, this topic is about how to assign a static IP to Pi, not about router nor about DHCP.

I agree that router could have an easier UI to get the job done, but before we push out our own option on the topic, I believe we should just answer the original poster's request. After that we could discus if there is a better option.

To assign a static IP to Pi, you need to edit /etc/network/interfaces
You would find:

Code: Select all

iface eth0 inet dhcp
Edit this line to:

Code: Select all

iface eth0 inet static
  address 192.168.0.2
  netmask 255.255.255.0
  gateway 192.168.0.1
Of course, don't just copy my address to your Pi.

If you use WIFI and LAN at the same time, and sometime you can't get a static IP after reboot, uninstall the ifplugd package.