How do I set a static IP in Debian Linux?

NogginBoink

Diamond Member
Feb 17, 2002
5,322
0
0
My newly installed Debian box is working with a DHCP lease, but I need it to have a static IP address.

I managed to change the IP address with ifconfig but the machine reverted back to a dynamic IP address after a reboot.

I'm a Linux newbie; how do I set my machine to use a static IP address?
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
/etc/network/interfaces

Or you can set a static reservation on your DHCP server so it gets the same address every time.
 

nweaver

Diamond Member
Jan 21, 2001
6,813
1
0
also, man interfaces

with that statement, I'll also comment about how I love that all the commands have a man page (if they are installed via apt) and that more then 95% of those man pages are good enough to get you through anything you need.
 

DarkThinker

Platinum Member
Mar 17, 2007
2,822
0
0
Ya, I have my router give my machines a static IP based on MAC addresses, that saves me from having to put that in any OS configurations.