Pages

Saturday, October 29, 2011

Change from DHCP to static IP on Debian

Fisrt, you need to edit a file using this command
# nano /etc/network/interfaces
Here is what my file looks like
This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
iface eth0 inet static
address 10.10.10.200
netmask 255.255.255.0
gateway 10.10.10.1
network 10.10.10.0
broadcast 10.10.10.255
Once it's done, it's time to configure your DNS servers with this command:
 # nano /etc/resolv.conf
An example of what the file could look like using Google's DNS:
nameserver 8.8.8.8
nameserver 8.8.4.4
To apply the changes, fire up this command:
# /etc/init.d/networking restart

No comments:

Post a Comment