1

World,

So, I will be working on Raspberry Pi device (not sure which device to consider) and I am confused whether to choose a dynamic IP address for my device or assign a Static IP. Which one will be better, things which I want to can do remotely would be:

  • Sending/Receiving Data to Server
  • Accessing Data which is stored locally on Pi

What will be the pros and cons?

1
  • 1
    This question is strictly off-topic as it is opinion based. Lots of Pi users want static addresses. In my opinion this is misplaced. There are valid reasons to use a static address, but Raspbian, by default, is set up to get a dynamic address using DHCP. If the Pi is connected to a router choose dynamic. If you are running an isolated network static amy be appropriate. Commented Feb 4, 2016 at 9:00

3 Answers 3

4

I always recommend setting a static IP in your home router. Setting a static IP in the OS will bite you in the rear end at some point in time.

Installing Samba/Avahi to adress your pi via its hostname. This way you don't need to remember an IP.

2
  • 1
    That's a different question as a whole really, I would advise "owncloud" Commented Mar 16, 2016 at 20:45
  • Why the sudden and unexplained downvotes? Commented Jun 30, 2016 at 21:11
2

Usually, on a lan the hosts (clients) receive a dynamic ip and the servers a static one.

Pro: you don't need to bother with local name resolution and can always connect to the pi using the very same ip address.

Con: if you change your network topology (say, another subnet), if the pi's fixed address is hard coded in it's config file, you will have a hard time connecting to it. Not impossible, but you will need to reconfigure a host (client) to be able to make a connection. Solution for that, configure the pi to configure its interface with dhcp and, on the dhcp server, make an entry for the pi's MAC address so that it will always receive the ip of your choice.

1

With a default Raspbian installed: There's no need to get any IP address if your dns and dhcp are properly configured and working.

Set your hostname in /etc/hostname, reboot and use that one for every connection to your pi and you don't have problems using both IPv6 and IPv4.

EDITED.

1
  • 1
    This is not necessarily true. It depends upon certain things you have neglected to mention (see the part of Havner's answer about Avahi). Commented Feb 4, 2016 at 15:07

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.