0

I'm trying to set a Static IP for my Raspberry Pi 3 Model B+ and I have been referring to the following documentation:

https://www.raspberrypi.org/learning/networking-lessons/rpi-static-ip-address/

I want to have a static IP for my Pi when I connect it via a WiFi or a LAN cable. I basically want both the options to have the same Static IP. What I do not understand is the following:

In my /etc/dhcpcd.conf, I see some IPV6 configurations like this:

#interface eth0
#static ip_address=192.168.0.10/24
#static ip6_address=bc62:31d6:abzu:b92a::ee/53
#static routers=192.168.0.1
#static domain_name_servers=192.168.0.1 8.8.8.8 bc62:31d6:abzu:b92a::1

Can I completely remove the ip6_address? In the documentation link that I posted above, there is something related to wlan0 - Is this the setting related to WiFi?

1

If you really MUST How to set up Static IP Address shows how to do it.

You CAN NOT set 2 interfaces to have the same address. Again if you REALLY want to use the same static IP address for interfaces if only 1 is connected you can use a fallback See How to set up networking/WiFi but this is not a great idea - you would NEED to stop WiFi from connecting.

I feel obliged to point out that there is no NEED to set static IP addresses - I haven't done this since 1980, unless configuring a DHCP server. I don't know what the IP of my 7 Pi or 3 Macs or other devices are, and don't care - I access them by name, and make the routers do their job!

You can remove ip6 if you aren't using them - there is even less need for static ip6 addresses

  • The plan is for me to set up a Kubernetes cluster on my RasPi's. I will be having 7 of them booted up and I think from an operation point of view, I thought it might make sense to have a static ip for all of them. Could you please justify why there is no need for a static ip? I appreciate your comments! – sparkr Apr 21 '18 at 7:33
  • There are several reasons. 1. the most important if you ever need to use a different network (at a different place - I take my Pi to friends houses, or just change ISP) you have to change everything. 2. I have a fist full of SD Cards - I can plug any one into any Pi, copy them etc, which is difficult if each is set to a static IP. If you are running a cluster that is never going to move this may be one of the few valid exceptions. – Milliways Apr 21 '18 at 7:46
  • I have just worked on too many networks over the years, and people who try to pick an IP just create problems - virtually all networks have a DHCP server, and this can be configured to always give the same IP to specified MAC. – Milliways Apr 21 '18 at 7:47
  • Is there a way to ssh using the host name? I don't want to set a static ip, but I would like to ssh using the hostname? I guess I could do this or? – sparkr Apr 21 '18 at 7:57
  • I did just change the hostname and I can now ssh into my pi using pi@myhostname.local – sparkr Apr 21 '18 at 8:03

protected by Community Mar 26 at 8:51

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.