When you install Debian on a machine to use it as a server, it's recommended to set a static IP address for it.
Tested under Debian 7.7.0.
To set a static IP and make this setting persists address, you MUST remove the installed Debian network manager. This program tends to do everything he can to keep the network connection, even delete your settings and reset your network connection automatically (Assigning the IP address via a DHCP server).
For this program avoids deleting your custom configuration, the easiest way is to remove it :
Bash
apt-get remove network-manager-gnome network-manager
Note : The network icon appear in the top bar has disappeared after uninstalling this program.
To configure your network interfaces, you must edit the "/etc/networks/interfaces" file.
Bash
vi /etc/network/interfaces
By default, you will find the following lines :
Note : This is the configuration of the network card loopback called "local loop". This information is displayed by the command "ifconfig".
Plain Text
auto lo iface lo inet loopback
Warning, don't delete these lines.
To configure your network interface (eth0), you must add the following lines :
Notes :
- Leave a blank line to separate the two interfaces.
Plain Text
auto eth0 iface eth0 inet static address 10.0.0.6 netmask 255.0.0.0 gateway 10.0.0.1
And edit the "/etc/resolv.conf" file for DNS servers :
Bash
vi /etc/resolv.conf
Plain Text
nameserver xx.xx.xx.xx nameserver xx.xx.xx.xx
Warning : DNS servers listed in the "/etc/resolv.conf" file will be overwritten by those received via DHCP, if you change the interface into "dhcp" instead of "static".
Bash
service networking restart
Check the network configuration by typing this :
Bash
ifconfig
If the IP address isn't correct, restart the machine :
Bash
reboot
Now, the IP address and DNS servers are correctly defined.
Linux 12/31/2016
Linux 12/26/2014
Linux 1/15/2014
Linux 1/11/2014
Pinned content
Contact
® InformatiWeb-Pro.net - InformatiWeb.net 2008-2022 - © Lionel Eppe - All rights reserved.
Total or partial reproduction of this site is prohibited and constitutes an infringement punishable by articles L.335-2 and following of the intellectual property Code.
You must be logged in to post a comment