Galactic Civilizations 3
Change the IP address on Debian

Change the IP address on Debian

Category: Linux.
Posted by on the 09/07/2013.
Last update on the 09/07/2013.

Description

This tutorial explains how to change a static or dynamic IP address on Debian.

Introduction

This tutorial is intended for people under Debian or distributions based on it (Ubuntu, Xandros ...). All commands in this tutorial are executed as root. (su command). It does not require any prerequisites.

Static configuration of the network interface

We will set the IP address of the computer to 192.168.1.3. To do that, execute the following command:

nano /etc/network/interfaces

interfaces

auto lo
iface lo inet loopback

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

Configuration of the DNS resolution

If the IP address of your DNS server has changed, you can edit the file /etc/resolv.conf as following:

nano /etc/resolv.conf

resolv.conf

nameserver 192.168.1.1

Dynamic configuration of the network interface

If you want to have a dynamic configuration that uses the DHCP protocol, execute the following command:

nano /etc/network/interfaces

interfaces

auto lo
iface lo inet loopback

allow-hotplug eth0
iface eth0 inet dhcp

Now, we will change the IP address of the interface eth0. To do that, execute the following command:

dhclient eth0

Configuration of the locale resolution

In order to access to your computer with the name "tutorielsenfolie", you need to modify the configuration file /etc/hosts. To do that, execute the following command:

nano /etc/hosts

/etc/hosts

127.0.0.1 localhost
192.168.1.3 tutorielsenfolie

Restarting of your network interfaces

Now that we have finished configuring the network interface, we can restart it. To do that, execute the following command:

/etc/init.d/networking restart

You can check the configuration of your network interface with the following command:

ifconfig eth0

Here we consider that eth0 is the name of your network interface.

You like this tutorial ?
Like this website in order to promote it on facebook !

You like this tutorial ? Share it with your friends !
Partager sur Facebook Partager sur Twitter Partager sur Myspace Partager sur Stumbleupon Soumettre sur Reddit Partager sur Digg Ajouter à vos favoris Technorati Ajouter à vos favoris Live Ajouter à vos favoris Google Ajouter sur vos favoris Yahoo