0

I want to do port fowarding of my raspberry Pi, so first I need to set static ip. I searched in Google but didn't find any easy answer.

1 Answers1

3

If you are using Raspbian then dhcpcd is used for network configuration. Just look into /etc/dhcpcd.conf. At the end you will find some examples for static IP configuration. For further information look at man dhcpcd.conf. For searching in Google you should use raspbian static ip address.

Ingo
  • 42,107
  • 20
  • 85
  • 197
  • 1
    How about etc/network/interfaces? I saw in some article about that?! – Thetips4you Oct 24 '19 at 17:18
  • 1
    Beware that older versions of Raspbian did not use dhcpcd, they used Debian's networking system; /etc/network/interfaces is part of the latter. If you are curious see man interfaces -- but do not use it, use dhcpcd.conf. – goldilocks Oct 24 '19 at 19:24
  • @goldilocks Do you wanted to address Thetips4you? Or do you asked me to update my answer and refer to an unsupported Raspbian version? If there are problems with Debian networking and dhcpcd I like to link to Differences between /etc/dhcpcd.conf and /etc/network/interfaces?. – Ingo Oct 24 '19 at 21:24
  • Yeah, that last comment was to the OP, and no, I don't think you need to show two different ways to accomplish this if the simpler one (dhcpcd.conf) works. Technically that comment (of mine) is a bit wrong in that you can make use of /etc/network stuff with the current dhcpcd service, but it isn't necessary here and may create unwanted complications. – goldilocks Oct 24 '19 at 22:51