This is the traditional method for setting up networking on a Debian system. It involves a series of files in fete/network. RPM-based systems such as RedHat Fedora and SuSE Linux use a different layout in /ete/syseonfig/network that is managed by their own utilities.
The /ete/network/interfaees file is probably the simplest way to get a network up and running. While it must be edited manually, it is easy to understand and a minimum number of configuration lines are needed to handle most situations. In fact, the Debian installation process will set up this file for you. lf you use the same networking configuration as you used for installation, the network will work immediately and require minimal tweaking. In fact, a minimal interfaces file is usually sufficient for most servers that aren't part of a cluster. Even if you do use an alternate method for network configuration, such as Network Manager, the local loopback interface is usually left configured in the interfaces file to keep the alternate configuration uncluttered, since it requires only basic configuration and doesn't normally need to be modified.
The interfaces file, while it can be very simple, also offers many options for more complex setups. You can configure wired, wireless, VLAN (Virtual Local Area Network) and Bridge interfaces, IP tunnels, and Point to Point (PPP) interfaces. Each interface can be configured to use DHCP or a static IP address, with both IPv4 and IPv6 supported as well as Novell's IPX protocol. A simple interfaces file is shown as follows:
# This file describes the network interfaces available on your # system and how to activate them. For more infor.mation, see # interfaces(S).
# The loopback network interface auto 10 ifaae 10 inet loopback
# The primary network interface
a11ow-hotp1ug athO
ifacs ethO iust static address 192.168.3.52
natmask 255.255.255.0 gateway 192.168.3.1
Lines beginning with # are comments, of course. The purpose of other lines is as follows:
- auto 10: The 10 interface is brought up whenever ifup is run with the -a option, as itis during system initialization
- iface 10 inet 100pback: This defines the basic loopback interface; the address is always 127 . 0 . 0 . 1 or : : 1 for IPv6
- allow-hotplug ethO: This brings up Ethernet a ifit is available and plugged in
- iface ethO inet static: This defines Ethernet a as an interface with a static IP address
- address, netmask, and gateway: These define Ethernet a's address, net mask, and the default IP gateway, respectively.
Simple and to the point. This file was actually set up during Debian installation and works as is. Ofcourse, there are many other options available which are documented in the interfaces manual page that allow you to handle much more complex configurations. The details on setting up the interfaces file may be found in the interfaces manual page. Itincludes information on setting up IPv6 and many other protocols.
In addition to the interfaces file, there are a number of scripts in the fete/network hierarchy that are related. In particular, the subdirectories if-pre-up. d, if-up. d, if-down. d, and if-post -down. d contain scripts that are run automatically when interfaces are brought up or down. Inaddition, specific scripts can be identified in the interfaces file to be executed when a particular interface is brought up or down (this is especially useful in configuring Bridges). The major disadvantage to using the fete/network/interfaces file is that there is no provision to configure Virtual Private Networks (VPN). However, in general, these can be configured using command line tools.