I feel like I've tried every tutorial out there and I still cannot make this work.
Can anyone shed some light on this topic?
iface eth0 inet static
restart your network.
I'd like to do it for wifi. Do I just substitute eth0 with wlan0?
No ... modify /etc/dhcpcd.conf
if you changed /etc/network/interfaces, bring it back to the original configuration.
Thanks for your help, but that doesn't seem to work.
Using ifconfig, the ip address hasn't changed at all.
I'd probably do this on the router (or whatever dhcp server you're using) by MAC address.
So I'm in student housing at my university. I don't own the router or have any permission to modify things. Is it still possible to do this?
If you cannot control the IP addresses given out by the dhcp, how will you know you're not assigning yourself an IP address that is used by something else?
Why do you need a static ip?
In a University, any ip is good so you can do your work. The same applies in the student housing.
But consider this...
Typically you only need a static ip address in a server application. This all works well in a home network where you have a router and access to the router settings. It becomes more difficult on a public network.
I'm building a robot that uses a RPi3. A dynamic ip makes it really hard to continually SSH into it to work on the robot. It'd be nice to have a static one so that I can leave the pi inside the robot while I work on it over the next month.
Does your Pi have to have internet access, or could you use it as a access point?
It does not have to have internet access. I just need to be able to execute a python program remotely.
Sounds like setting it up as a access point would be perfect for you then. Maybe even preferable. Doing so would allow you to SSH into the Pi using it's static IP address.