Flexion.Org
Bad grammar and typos for total strangers
Wiki › Debian Network Interfaces
Wiki Index All Recent Edit Bottom

Debian Network Interfaces and Hosts

1.   Network Interfaces and Hosts
1.1   Set the Network Interfaces
1.2   Set the Hostname

Network Interfaces and Hosts

This page is really just a quick reference for myself when setting up a host with static IP addresses.

Set the Network Interfaces

To configure a static IP address for a NIC, edit the /etc/network/interfaces file...

 nano /etc/network/interfaces

...and insert something like below.

Sample

 auto eth0
 iface eth0 inet static
   address 192.168.1.77
   netmask 255.255.255.0
   network 192.168.1.0
   broadcast 192.168.1.255
   gateway 192.168.1.1

If you also want to add the IP address 192.168.1.78 to interface eth0 you should add the following.

  auto eth0:0
  iface eth0:0 inet static
    address 192.168.1.78
    netmask 255.255.255.0
    network 192.168.1.0
    broadcast 192.168.1.255
    gateway 192.168.1.1

Set the Hostname

To ensure the hostname is correctly set for the host, do the following...

 echo servername.example.org > /etc/hostname
 /bin/hostname -F /etc/hostname

Now make sure the correct entry exists in /etc/hosts

 nano /etc/hosts

Sample

 127.0.0.1       localhost
 127.0.1.1       servername.example.org servername

 # The following lines are desirable for IPv6 capable hosts
 ::1     ip6-localhost ip6-loopback
 fe00::0 ip6-localnet
 ff00::0 ip6-mcastprefix
 ff02::1 ip6-allnodes
 ff02::2 ip6-allrouters
 ff02::3 ip6-allhosts

$Id: DebianNetworkInterfaces,v 1.9 2008/08/11 12:36:55 martin Exp $

Wiki Index All Recent Edit Top
 
Valid XHTML Valid CSS Hacker