Debian: How to Change IP Address
By nick | Tech Support22 Oct 2011
Here’s a quick example of how you can change your IP Address or other network settings under Debian via command line, this will be required if you’re setting up a system without a graphical interface.
As always there is more than one way to do things, however this method is simple and works.
These commands should be issues as root, you can get here by logging in directly as the root user or by using the su command.
Open your interfaces settings file with your favourite text editor:
nano /etc/network/interfaces
Figure out what settings you want to use and edit the template below, replacing the content of your interfaces.
file:
auto lo
iface lo inet loopback
allow-hotplug eth0
auto eth0
iface eth0 inet static
address 192.168.1.100
netmask 255.255.255.0
broadcast 192.168.1.255
gateway 192.168.1.1
dns-domain lan
dns-nameservrs 192.168.1.1
Then to apply these new settings you can either reboot or issue the command below:
service networking restart
This assumes that you’re familiar with using the basic nano editor, your default network interface is eth0 and that this is on a newly installed system; you probably don’t want to replace the entire file if the system has other interfaces already configured.