WARNING: This page is archived and not updated. Please bear in mind any information may be incorrect and any code may not work. Use at your own risk.
James Gardner: Home > Blog > 2007 > Debian Static IP Address

Debian Static IP Address

Posted:2007-07-09 19:13
Tags:Uncategorized

To set up a static IP address edit /etc/network/interfaces so that it looks something like this:

# The primary network interface
allow-hotplug eth0
iface eth0 inet static
    address 192.168.46.3
    netmask 255.255.255.0
    network 192.168.46.0
    broadcast 192.168.46.255
    gateway 192.168.46.1

Then use the commands:

ifdown eth0
ifup eth0

You can see your network adapters and IP addresses with ifconfig. You can restart networking with sudo /etc/init.d/networking restart. You can change a hostname by editing /etc/hostname. I'd restart afterwards, then you can check your hostname with the hostname command.

(view source)

James Gardner: Home > Blog > 2007 > Debian Static IP Address