nakshatra
Posts: 8
Joined: Mon Feb 03, 2014 8:04 am

static ip

Mon Mar 10, 2014 7:18 am

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??

User avatar
Richard-TX
Posts: 1549
Joined: Tue May 28, 2013 3:24 pm
Location: North Texas

Re: static ip

Mon Mar 10, 2014 7:24 am

yes
Richard
Doing Unix since 1985.
The 9-25-2013 image of Wheezy can be found at:
http://downloads.raspberrypi.org/raspbian/images/raspbian-2013-09-27/2013-09-25-wheezy-raspbian.zip

klricks
Posts: 7154
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: static ip

Mon Mar 10, 2014 1:01 pm

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.
Unless specified otherwise my response is based on the latest and fully updated RPiOS Buster w/ Desktop OS.

User avatar
DougieLawson
Posts: 39120
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: static ip

Mon Mar 10, 2014 11:53 pm

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.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

klricks
Posts: 7154
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: static ip

Tue Mar 11, 2014 12:15 am

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
Unless specified otherwise my response is based on the latest and fully updated RPiOS Buster w/ Desktop OS.

User avatar
Richard-TX
Posts: 1549
Joined: Tue May 28, 2013 3:24 pm
Location: North Texas

Re: static ip

Tue Mar 11, 2014 4:44 am

Just learn how to assign a static IP. There are places in this world that don't have DHCP.
Richard
Doing Unix since 1985.
The 9-25-2013 image of Wheezy can be found at:
http://downloads.raspberrypi.org/raspbian/images/raspbian-2013-09-27/2013-09-25-wheezy-raspbian.zip

User avatar
allfox
Posts: 452
Joined: Sat Jun 22, 2013 1:36 pm
Location: Guang Dong, China

Re: static ip

Tue Mar 11, 2014 7:37 am

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.

Return to “General discussion”