Menu
InformatiWeb Pro
  • Index
  • System admin
  • Virtualization

Login

Registration Password lost ?
FR
  • Windows Server
    • WMS 2012
    • WS2012 R2
    • WS2016
  • Citrix
    • Citrix NetScaler Gateway
    • Citrix XenApp / XenDesktop
    • Citrix XenServer
  • VMware
    • VMware ESXi
    • VMware vSphere
    • VMware Workstation
  • Microsoft
    • Hyper-V
  • RAID
    • Adaptec SmartRAID
  • UPS
    • APC Back-UPS Pro
  • InformatiWeb Pro
  • System admin
  • Linux
  • Define a private static IP address on a Debian server
  • Linux
  • 05 March 2015 at 13:31 UTC
  • InformatiWeb

Define a private static IP address on a Debian server

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.

  1. Uninstall the network manager (networkmanager)
  2. Configure the network interfaces manually
  3. Restart the network service to apply the changes

1. Uninstall the network manager (networkmanager)

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.

 

2. Configure the network interfaces manually

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".

 

3. Restart the network service to apply the changes

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.

Share this tutorial

Partager
Tweet

To see also

  • Debian / Ubuntu - Configure a DNS server (BIND)

    Linux 12/12/2014

    Debian / Ubuntu - Configure a DNS server (BIND)

  • Debian / Ubuntu - Monitor your server with Monit

    Linux 12/20/2014

    Debian / Ubuntu - Monitor your server with Monit

  • StartSSL - Renew your SSL certificates

    Linux 9/8/2016

    StartSSL - Renew your SSL certificates

  • Ubuntu - Install a complete web server

    Linux 1/31/2014

    Ubuntu - Install a complete web server

Comments

You must be logged in to post a comment

Share your opinion

Pinned content

  • Software (System admin)
  • Linux softwares
  • Our programs
  • Terms and conditions
  • Share your opinion

Contact

  • Guest book
  • Technical support
  • 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.