Setting Static IP on Raspberry Pi
Posted 08-08-2021 at 06:43 PM by des_a
I fought and fought with the Raspberry Pi, trying to set a static IP. I really wanted it to have a static reservation on the DHCP server, like everything else. But, there is [a bug???] in the software that won't get any DHCP address, if you set a static reservation for it.
So the answer to set a static IP? It turned out to be simpler than I thought, but it took me awhile to figure out. Assuming it is a IPv4 address, here is what you do.
Modify rc.local to add a line right before the return statement. It should be as follows:
If I remembered the syntax right, that's it! Other things result in a network hang up where it will never get an IP, or worse, sometimes get a 169 IP.
So the answer to set a static IP? It turned out to be simpler than I thought, but it took me awhile to figure out. Assuming it is a IPv4 address, here is what you do.
Modify rc.local to add a line right before the return statement. It should be as follows:
Code:
ifconfig [adapter name] inet [ip address] netmask [netmask]
Total Comments 2
Comments
-
I set my ip static using nm-tui. I have Network Manager installed.
Posted 08-25-2021 at 05:41 AM by kermitdafrog8 -
Sorry for the late reply. I just finished what should be my final degree for now. Now, in the inbetween time, I have time for some more home work. Not "homework", but "home work".
Posted 06-22-2022 at 01:17 AM by des_a