Setup Static IP On Debian

clickclickbang
clickclickbang used Ask the Experts™
on
I've recently installed Debian and am trying to figure out how to configure Debian to assume a static local IP. My network isn't anything fancy, just a LinkSys router that serves as my DHCP server. I have my windows computer set to a local IP 192.168.1.100 and would like to do the same for my new Debian server so that I can SSH into the same local IP. I would like to setup this in Debian itself as oppose to mapping the IP based upon the MAC address though the router.

Thanks for any ideas!

~ C
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
type this: pico /etc/networking/interfaces

now change your nic to read something like this:

# The primary network interface
auto eth0
iface eth0 inet static
        address 10.0.0.254
        netmask 255.255.255.0
        network 10.0.0.0
        broadcast 10.0.0.255
        gateway 10.0.0.1

Commented:
errr, it's pico /etc/network/interfaces

when finished press Ctrl-X, then 'y', then 'Enter' to save changes.
Commented:
the above is correct... the interfaces file is located at /etc/network/interfaces

Also if your network is 192.168.1.0, you would much rather a configuration like this assuming you want your linux box at 101 since your windows is at 100 and your router is at 192.168.1.1... but you can obviously change it to what you want/need:

auto eth0
iface eth0 inet static
address 192.168.1.101
netmask 255.255.255.0
gateway 192.168.1.1

Best of Luck,
Aaron

Author

Commented:
Awesome stuff! Thanks guys!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial