old-www/LDP/www.debian.org/doc/manuals/debian-reference/ch05.en.html

3240 lines
175 KiB
HTML
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Chapter 5. Network setup</title>
<link rel="stylesheet" href="debian-reference.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
<link rel="home" href="index.en.html" title="Debian Reference">
<link rel="up" href="index.en.html" title="Debian Reference">
<link rel="prev" href="ch04.en.html" title="Chapter 4. Authentication">
<link rel="next" href="ch06.en.html" title="Chapter 6. Network applications">
<link rel="preface" href="pr01.en.html" title="Preface">
<link rel="chapter" href="ch01.en.html" title="Chapter 1. GNU/Linux tutorials">
<link rel="chapter" href="ch02.en.html" title="Chapter 2. Debian package management">
<link rel="chapter" href="ch03.en.html" title="Chapter 3. The system initialization">
<link rel="chapter" href="ch04.en.html" title="Chapter 4. Authentication">
<link rel="chapter" href="ch05.en.html" title="Chapter 5. Network setup">
<link rel="chapter" href="ch06.en.html" title="Chapter 6. Network applications">
<link rel="chapter" href="ch07.en.html" title="Chapter 7. The X Window System">
<link rel="chapter" href="ch08.en.html" title="Chapter 8. I18N and L10N">
<link rel="chapter" href="ch09.en.html" title="Chapter 9. System tips">
<link rel="chapter" href="ch10.en.html" title="Chapter 10. Data management">
<link rel="chapter" href="ch11.en.html" title="Chapter 11. Data conversion">
<link rel="chapter" href="ch12.en.html" title="Chapter 12. Programming">
<link rel="appendix" href="apa.en.html" title="Appendix A. Appendix">
<link rel="section" href="ch05.en.html#_the_basic_network_infrastructure" title="5.1. The basic network infrastructure">
<link rel="section" href="ch05.en.html#_the_modern_network_configuration_for_desktop" title="5.2. The modern network configuration for desktop">
<link rel="section" href="ch05.en.html#_the_legacy_network_connection_and_configuration" title="5.3. The legacy network connection and configuration">
<link rel="section" href="ch05.en.html#_the_network_connection_method_legacy" title="5.4. The network connection method (legacy)">
<link rel="section" href="ch05.en.html#_the_basic_network_configuration_with_ifupdown_legacy" title="5.5. The basic network configuration with ifupdown (legacy)">
<link rel="section" href="ch05.en.html#_the_advanced_network_configuration_with_ifupdown_legacy" title="5.6. The advanced network configuration with ifupdown (legacy)">
<link rel="section" href="ch05.en.html#_the_low_level_network_configuration" title="5.7. The low level network configuration">
<link rel="section" href="ch05.en.html#_network_optimization" title="5.8. Network optimization">
<link rel="section" href="ch05.en.html#_netfilter_infrastructure" title="5.9. Netfilter infrastructure">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<div class="navheader">
<table width="100%" summary="Navigation header">
<tr><th colspan="3" align="center">Chapter 5. Network setup</th></tr>
<tr>
<td width="20%" align="left">
<a accesskey="p" href="ch04.en.html"><img src="images/prev.gif" alt="Prev"></a> </td>
<th width="60%" align="center"> </th>
<td width="20%" align="right"> <a accesskey="n" href="ch06.en.html"><img src="images/next.gif" alt="Next"></a>
</td>
</tr>
</table>
<hr>
</div>
<div class="chapter">
<div class="titlepage"><div><div><h2 class="title">
<a name="_network_setup"></a>Chapter 5. Network setup</h2></div></div></div>
<div class="toc">
<p><b>Table of Contents</b></p>
<dl>
<dt><span class="section"><a href="ch05.en.html#_the_basic_network_infrastructure">5.1. The basic network infrastructure</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="ch05.en.html#_the_domain_name">5.1.1. The domain name</a></span></dt>
<dt><span class="section"><a href="ch05.en.html#_the_hostname_resolution">5.1.2. The hostname resolution</a></span></dt>
<dt><span class="section"><a href="ch05.en.html#_the_network_interface_name">5.1.3. The network interface name</a></span></dt>
<dt><span class="section"><a href="ch05.en.html#_the_network_address_range_for_the_lan">5.1.4. The network address range for the LAN</a></span></dt>
<dt><span class="section"><a href="ch05.en.html#_the_network_device_support">5.1.5. The network device support</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="ch05.en.html#_the_modern_network_configuration_for_desktop">5.2. The modern network configuration for desktop</a></span></dt>
<dd><dl><dt><span class="section"><a href="ch05.en.html#_gui_network_configuration_tools">5.2.1. GUI network configuration tools</a></span></dt></dl></dd>
<dt><span class="section"><a href="ch05.en.html#_the_legacy_network_connection_and_configuration">5.3. The legacy network connection and configuration</a></span></dt>
<dt><span class="section"><a href="ch05.en.html#_the_network_connection_method_legacy">5.4. The network connection method (legacy)</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="ch05.en.html#_the_dhcp_connection_with_the_ethernet">5.4.1. The DHCP connection with the Ethernet</a></span></dt>
<dt><span class="section"><a href="ch05.en.html#_the_static_ip_connection_with_the_ethernet">5.4.2. The static IP connection with the Ethernet</a></span></dt>
<dt><span class="section"><a href="ch05.en.html#_the_ppp_connection_with_pppconfig">5.4.3. The PPP connection with pppconfig</a></span></dt>
<dt><span class="section"><a href="ch05.en.html#_the_alternative_ppp_connection_with_wvdialconf">5.4.4. The alternative PPP connection with wvdialconf</a></span></dt>
<dt><span class="section"><a href="ch05.en.html#_the_pppoe_connection_with_pppoeconf">5.4.5. The PPPoE connection with pppoeconf</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="ch05.en.html#_the_basic_network_configuration_with_ifupdown_legacy">5.5. The basic network configuration with ifupdown (legacy)</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="ch05.en.html#_the_command_syntax_simplified">5.5.1. The command syntax simplified</a></span></dt>
<dt><span class="section"><a href="ch05.en.html#_the_basic_syntax_of_etc_network_interfaces">5.5.2. The basic syntax of "/etc/network/interfaces"</a></span></dt>
<dt><span class="section"><a href="ch05.en.html#_the_loopback_network_interface">5.5.3. The loopback network interface</a></span></dt>
<dt><span class="section"><a href="ch05.en.html#_the_network_interface_served_by_the_dhcp">5.5.4. The network interface served by the DHCP</a></span></dt>
<dt><span class="section"><a href="ch05.en.html#_the_network_interface_with_the_static_ip">5.5.5. The network interface with the static IP</a></span></dt>
<dt><span class="section"><a href="ch05.en.html#_the_basics_of_wireless_lan_interface">5.5.6. The basics of wireless LAN interface</a></span></dt>
<dt><span class="section"><a href="ch05.en.html#_the_wireless_lan_interface_with_wpa_wpa2">5.5.7. The wireless LAN interface with WPA/WPA2</a></span></dt>
<dt><span class="section"><a href="ch05.en.html#_the_wireless_lan_interface_with_wep">5.5.8. The wireless LAN interface with WEP</a></span></dt>
<dt><span class="section"><a href="ch05.en.html#_the_ppp_connection">5.5.9. The PPP connection</a></span></dt>
<dt><span class="section"><a href="ch05.en.html#_the_alternative_ppp_connection">5.5.10. The alternative PPP connection</a></span></dt>
<dt><span class="section"><a href="ch05.en.html#_the_pppoe_connection">5.5.11. The PPPoE connection</a></span></dt>
<dt><span class="section"><a href="ch05.en.html#_the_network_configuration_state_of_ifupdown">5.5.12. The network configuration state of ifupdown</a></span></dt>
<dt><span class="section"><a href="ch05.en.html#_the_basic_network_reconfiguration">5.5.13. The basic network reconfiguration</a></span></dt>
<dt><span class="section"><a href="ch05.en.html#_the_ifupdown_extra_package">5.5.14. The ifupdown-extra package</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="ch05.en.html#_the_advanced_network_configuration_with_ifupdown_legacy">5.6. The advanced network configuration with ifupdown (legacy)</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="ch05.en.html#_the_ifplugd_package">5.6.1. The ifplugd package</a></span></dt>
<dt><span class="section"><a href="ch05.en.html#_the_ifmetric_package">5.6.2. The ifmetric package</a></span></dt>
<dt><span class="section"><a href="ch05.en.html#_the_virtual_interface">5.6.3. The virtual interface</a></span></dt>
<dt><span class="section"><a href="ch05.en.html#_the_advanced_command_syntax">5.6.4. The advanced command syntax</a></span></dt>
<dt><span class="section"><a href="ch05.en.html#_the_mapping_stanza">5.6.5. The mapping stanza</a></span></dt>
<dt><span class="section"><a href="ch05.en.html#_the_manually_switchable_network_configuration">5.6.6. The manually switchable network configuration</a></span></dt>
<dt><span class="section"><a href="ch05.en.html#_scripting_with_the_ifupdown_system">5.6.7. Scripting with the ifupdown system</a></span></dt>
<dt><span class="section"><a href="ch05.en.html#_mapping_with_guessnet">5.6.8. Mapping with guessnet</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="ch05.en.html#_the_low_level_network_configuration">5.7. The low level network configuration</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="ch05.en.html#_iproute2_commands">5.7.1. Iproute2 commands</a></span></dt>
<dt><span class="section"><a href="ch05.en.html#_safe_low_level_network_operations">5.7.2. Safe low level network operations</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="ch05.en.html#_network_optimization">5.8. Network optimization</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="ch05.en.html#_finding_optimal_mtu">5.8.1. Finding optimal MTU</a></span></dt>
<dt><span class="section"><a href="ch05.en.html#_setting_mtu">5.8.2. Setting MTU</a></span></dt>
<dt><span class="section"><a href="ch05.en.html#_wan_tcp_optimization">5.8.3. WAN TCP optimization</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="ch05.en.html#_netfilter_infrastructure">5.9. Netfilter infrastructure</a></span></dt>
</dl>
</div>
<div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Tip">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Tip]" src="images/tip.png"></td>
<th align="left">Tip</th>
</tr>
<tr><td align="left" valign="top"><p>For general guide to the GNU/Linux networking, read the <a class="ulink" href="http://www.tldp.org/LDP/nag2/" target="_top">Linux Network Administrators Guide</a>.</p></td></tr>
</table></div>
<div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Tip">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Tip]" src="images/tip.png"></td>
<th align="left">Tip</th>
</tr>
<tr><td align="left" valign="top"><p>Although this document still uses old <span class="citerefentry"><span class="refentrytitle">ifconfig</span>(8)</span> with IPv4 for its network configuration examples, Debian is moving to <span class="citerefentry"><span class="refentrytitle">ip</span>(8)</span> with IPv4+IPv6 in the <code class="literal">wheezy</code> release. Patches to update this document are welcomed.</p></td></tr>
</table></div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="_the_basic_network_infrastructure"></a>5.1. The basic network infrastructure</h2></div></div></div>
<p>Let's review the basic network infrastructure on the modern Debian system.</p>
<div class="table">
<a name="listofnetworkconfigurationtools"></a><p class="title"><b>Table 5.1. List of network configuration tools</b></p>
<div class="table-contents"><table summary="List of network configuration tools" border="1">
<colgroup>
<col align="left">
<col align="left">
<col align="left">
<col align="left">
<col align="left">
</colgroup>
<thead><tr>
<th align="left">
packages
</th>
<th align="left">
popcon
</th>
<th align="left">
size
</th>
<th align="left">
type
</th>
<th align="left">
description
</th>
</tr></thead>
<tbody>
<tr>
<td align="left"><a class="ulink" href="http://packages.debian.org/sid/ifupdown" target="_top">
<code class="literal">ifupdown</code>
</a></td>
<td align="left"><a class="ulink" href="http://qa.debian.org/popcon.php?package=ifupdown" target="_top">http://qa.debian.org/popcon.php?package=ifupdown</a></td>
<td align="left"><a class="ulink" href="http://packages.qa.debian.org/i/ifupdown.html" target="_top">180</a></td>
<td align="left">
config::ifupdown
</td>
<td align="left">
standardized tool to bring up and down the network (Debian specific)
</td>
</tr>
<tr>
<td align="left"><a class="ulink" href="http://packages.debian.org/sid/ifplugd" target="_top">
<code class="literal">ifplugd</code>
</a></td>
<td align="left"><a class="ulink" href="http://qa.debian.org/popcon.php?package=ifplugd" target="_top">http://qa.debian.org/popcon.php?package=ifplugd</a></td>
<td align="left"><a class="ulink" href="http://packages.qa.debian.org/i/ifplugd.html" target="_top">352</a></td>
<td align="left">
, ,
</td>
<td align="left">
manage the wired network automatically
</td>
</tr>
<tr>
<td align="left"><a class="ulink" href="http://packages.debian.org/sid/ifupdown-extra" target="_top">
<code class="literal">ifupdown-extra</code>
</a></td>
<td align="left"><a class="ulink" href="http://qa.debian.org/popcon.php?package=ifupdown-extra" target="_top">http://qa.debian.org/popcon.php?package=ifupdown-extra</a></td>
<td align="left"><a class="ulink" href="http://packages.qa.debian.org/i/ifupdown-extra.html" target="_top">119</a></td>
<td align="left">
, ,
</td>
<td align="left">
network testing script to enhance "<code class="literal">ifupdown</code>" package
</td>
</tr>
<tr>
<td align="left"><a class="ulink" href="http://packages.debian.org/sid/ifmetric" target="_top">
<code class="literal">ifmetric</code>
</a></td>
<td align="left"><a class="ulink" href="http://qa.debian.org/popcon.php?package=ifmetric" target="_top">http://qa.debian.org/popcon.php?package=ifmetric</a></td>
<td align="left"><a class="ulink" href="http://packages.qa.debian.org/i/ifmetric.html" target="_top">100</a></td>
<td align="left">
, ,
</td>
<td align="left">
set routing metrics for a network interface
</td>
</tr>
<tr>
<td align="left"><a class="ulink" href="http://packages.debian.org/sid/guessnet" target="_top">
<code class="literal">guessnet</code>
</a></td>
<td align="left"><a class="ulink" href="http://qa.debian.org/popcon.php?package=guessnet" target="_top">http://qa.debian.org/popcon.php?package=guessnet</a></td>
<td align="left"><a class="ulink" href="http://packages.qa.debian.org/g/guessnet.html" target="_top">449</a></td>
<td align="left">
, ,
</td>
<td align="left">
mapping script to enhance "<code class="literal">ifupdown</code>" package via "<code class="literal">/etc/network/interfaces</code>" file
</td>
</tr>
<tr>
<td align="left"><a class="ulink" href="http://packages.debian.org/sid/ifscheme" target="_top">
<code class="literal">ifscheme</code>
</a></td>
<td align="left"><a class="ulink" href="http://qa.debian.org/popcon.php?package=ifscheme" target="_top">http://qa.debian.org/popcon.php?package=ifscheme</a></td>
<td align="left"><a class="ulink" href="http://packages.qa.debian.org/i/ifscheme.html" target="_top">132</a></td>
<td align="left">
, ,
</td>
<td align="left">
mapping scripts to enhance "<code class="literal">ifupdown</code>" package
</td>
</tr>
<tr>
<td align="left"><a class="ulink" href="http://packages.debian.org/sid/ifupdown-scripts-zg2" target="_top">
<code class="literal">ifupdown-scripts-zg2</code>
</a></td>
<td align="left"><a class="ulink" href="http://qa.debian.org/popcon.php?package=ifupdown-scripts-zg2" target="_top">http://qa.debian.org/popcon.php?package=ifupdown-scripts-zg2</a></td>
<td align="left"><a class="ulink" href="http://packages.qa.debian.org/i/ifupdown-scripts-zg2.html" target="_top">232</a></td>
<td align="left">
, ,
</td>
<td align="left">
Zugschlus' interface scripts for ifupdown's manual method
</td>
</tr>
<tr>
<td align="left"><a class="ulink" href="http://packages.debian.org/sid/network-manager" target="_top">
<code class="literal">network-manager</code>
</a></td>
<td align="left"><a class="ulink" href="http://qa.debian.org/popcon.php?package=network-manager" target="_top">http://qa.debian.org/popcon.php?package=network-manager</a></td>
<td align="left"><a class="ulink" href="http://packages.qa.debian.org/n/network-manager.html" target="_top">4015</a></td>
<td align="left">
config::NM
</td>
<td align="left">
<a class="ulink" href="http://en.wikipedia.org/wiki/NetworkManager" target="_top">NetworkManager</a> (daemon): manage the network automatically
</td>
</tr>
<tr>
<td align="left"><a class="ulink" href="http://packages.debian.org/sid/network-manager-gnome" target="_top">
<code class="literal">network-manager-gnome</code>
</a></td>
<td align="left"><a class="ulink" href="http://qa.debian.org/popcon.php?package=network-manager-gnome" target="_top">http://qa.debian.org/popcon.php?package=network-manager-gnome</a></td>
<td align="left"><a class="ulink" href="http://packages.qa.debian.org/n/network-manager-gnome.html" target="_top">5746</a></td>
<td align="left">
, ,
</td>
<td align="left">
<a class="ulink" href="http://en.wikipedia.org/wiki/NetworkManager" target="_top">NetworkManager</a> (GNOME frontend)
</td>
</tr>
<tr>
<td align="left"><a class="ulink" href="http://packages.debian.org/sid/network-manager-kde" target="_top">
<code class="literal">network-manager-kde</code>
</a></td>
<td align="left"><a class="ulink" href="http://qa.debian.org/popcon.php?package=network-manager-kde" target="_top">http://qa.debian.org/popcon.php?package=network-manager-kde</a></td>
<td align="left"><a class="ulink" href="http://packages.qa.debian.org/n/network-manager-kde.html" target="_top">36</a></td>
<td align="left">
, ,
</td>
<td align="left">
<a class="ulink" href="http://en.wikipedia.org/wiki/NetworkManager" target="_top">NetworkManager</a> (KDE frontend)
</td>
</tr>
<tr>
<td align="left"><a class="ulink" href="http://packages.debian.org/sid/wicd" target="_top">
<code class="literal">wicd</code>
</a></td>
<td align="left"><a class="ulink" href="http://qa.debian.org/popcon.php?package=wicd" target="_top">http://qa.debian.org/popcon.php?package=wicd</a></td>
<td align="left"><a class="ulink" href="http://packages.qa.debian.org/w/wicd.html" target="_top">48</a></td>
<td align="left">
config::wicd
</td>
<td align="left">
wired and wireless network manager (metapackage)
</td>
</tr>
<tr>
<td align="left"><a class="ulink" href="http://packages.debian.org/sid/wicd-cli" target="_top">
<code class="literal">wicd-cli</code>
</a></td>
<td align="left"><a class="ulink" href="http://qa.debian.org/popcon.php?package=wicd-cli" target="_top">http://qa.debian.org/popcon.php?package=wicd-cli</a></td>
<td align="left"><a class="ulink" href="http://packages.qa.debian.org/w/wicd-cli.html" target="_top">87</a></td>
<td align="left">
, ,
</td>
<td align="left">
wired and wireless network manager (command-line client)
</td>
</tr>
<tr>
<td align="left"><a class="ulink" href="http://packages.debian.org/sid/wicd-curses" target="_top">
<code class="literal">wicd-curses</code>
</a></td>
<td align="left"><a class="ulink" href="http://qa.debian.org/popcon.php?package=wicd-curses" target="_top">http://qa.debian.org/popcon.php?package=wicd-curses</a></td>
<td align="left"><a class="ulink" href="http://packages.qa.debian.org/w/wicd-curses.html" target="_top">195</a></td>
<td align="left">
, ,
</td>
<td align="left">
wired and wireless network manager (Curses client)
</td>
</tr>
<tr>
<td align="left"><a class="ulink" href="http://packages.debian.org/sid/wicd-daemon" target="_top">
<code class="literal">wicd-daemon</code>
</a></td>
<td align="left"><a class="ulink" href="http://qa.debian.org/popcon.php?package=wicd-daemon" target="_top">http://qa.debian.org/popcon.php?package=wicd-daemon</a></td>
<td align="left"><a class="ulink" href="http://packages.qa.debian.org/w/wicd-daemon.html" target="_top">1654</a></td>
<td align="left">
, ,
</td>
<td align="left">
wired and wireless network manager (daemon)
</td>
</tr>
<tr>
<td align="left"><a class="ulink" href="http://packages.debian.org/sid/wicd-gtk" target="_top">
<code class="literal">wicd-gtk</code>
</a></td>
<td align="left"><a class="ulink" href="http://qa.debian.org/popcon.php?package=wicd-gtk" target="_top">http://qa.debian.org/popcon.php?package=wicd-gtk</a></td>
<td align="left"><a class="ulink" href="http://packages.qa.debian.org/w/wicd-gtk.html" target="_top">552</a></td>
<td align="left">
, ,
</td>
<td align="left">
wired and wireless network manager (GTK+ client)
</td>
</tr>
<tr>
<td align="left"><a class="ulink" href="http://packages.debian.org/sid/iptables" target="_top">
<code class="literal">iptables</code>
</a></td>
<td align="left"><a class="ulink" href="http://qa.debian.org/popcon.php?package=iptables" target="_top">http://qa.debian.org/popcon.php?package=iptables</a></td>
<td align="left"><a class="ulink" href="http://packages.qa.debian.org/i/iptables.html" target="_top">1366</a></td>
<td align="left">
config::Netfilter
</td>
<td align="left">
administration tools for packet filtering and NAT (<a class="ulink" href="http://en.wikipedia.org/wiki/Netfilter" target="_top">Netfilter</a>)
</td>
</tr>
<tr>
<td align="left"><a class="ulink" href="http://packages.debian.org/sid/iproute" target="_top">
<code class="literal">iproute</code>
</a></td>
<td align="left"><a class="ulink" href="http://qa.debian.org/popcon.php?package=iproute" target="_top">http://qa.debian.org/popcon.php?package=iproute</a></td>
<td align="left"><a class="ulink" href="http://packages.qa.debian.org/i/iproute.html" target="_top">999</a></td>
<td align="left">
config::iproute2
</td>
<td align="left">
<a class="ulink" href="http://www.linuxfoundation.org/en/Net:Iproute2" target="_top">iproute2</a>, IPv6 and other advanced network configuration: <span class="citerefentry"><span class="refentrytitle">ip</span>(8)</span>, <span class="citerefentry"><span class="refentrytitle">tc</span>(8)</span>, etc
</td>
</tr>
<tr>
<td align="left"><a class="ulink" href="http://packages.debian.org/sid/ifrename" target="_top">
<code class="literal">ifrename</code>
</a></td>
<td align="left"><a class="ulink" href="http://qa.debian.org/popcon.php?package=ifrename" target="_top">http://qa.debian.org/popcon.php?package=ifrename</a></td>
<td align="left"><a class="ulink" href="http://packages.qa.debian.org/i/ifrename.html" target="_top">192</a></td>
<td align="left">
, ,
</td>
<td align="left">
rename network interfaces based on various static criteria: <span class="citerefentry"><span class="refentrytitle">ifrename</span>(8)</span>
</td>
</tr>
<tr>
<td align="left"><a class="ulink" href="http://packages.debian.org/sid/ethtool" target="_top">
<code class="literal">ethtool</code>
</a></td>
<td align="left"><a class="ulink" href="http://qa.debian.org/popcon.php?package=ethtool" target="_top">http://qa.debian.org/popcon.php?package=ethtool</a></td>
<td align="left"><a class="ulink" href="http://packages.qa.debian.org/e/ethtool.html" target="_top">279</a></td>
<td align="left">
, ,
</td>
<td align="left">
display or change Ethernet device settings
</td>
</tr>
<tr>
<td align="left"><a class="ulink" href="http://packages.debian.org/sid/iputils-ping" target="_top">
<code class="literal">iputils-ping</code>
</a></td>
<td align="left"><a class="ulink" href="http://qa.debian.org/popcon.php?package=iputils-ping" target="_top">http://qa.debian.org/popcon.php?package=iputils-ping</a></td>
<td align="left"><a class="ulink" href="http://packages.qa.debian.org/i/iputils-ping.html" target="_top">156</a></td>
<td align="left">
test::iproute2
</td>
<td align="left">
test network reachability of a remote host by <a class="ulink" href="http://en.wikipedia.org/wiki/Hostname" target="_top">hostname</a> or <a class="ulink" href="http://en.wikipedia.org/wiki/IP_address" target="_top">IP address</a> (<a class="ulink" href="http://www.linuxfoundation.org/en/Net:Iproute2" target="_top">iproute2</a>)
</td>
</tr>
<tr>
<td align="left"><a class="ulink" href="http://packages.debian.org/sid/iputils-arping" target="_top">
<code class="literal">iputils-arping</code>
</a></td>
<td align="left"><a class="ulink" href="http://qa.debian.org/popcon.php?package=iputils-arping" target="_top">http://qa.debian.org/popcon.php?package=iputils-arping</a></td>
<td align="left"><a class="ulink" href="http://packages.qa.debian.org/i/iputils-arping.html" target="_top">80</a></td>
<td align="left">
, ,
</td>
<td align="left">
test network reachability of a remote host specified by the <a class="ulink" href="http://en.wikipedia.org/wiki/Address_Resolution_Protocol" target="_top">ARP</a> address
</td>
</tr>
<tr>
<td align="left"><a class="ulink" href="http://packages.debian.org/sid/iputils-tracepath" target="_top">
<code class="literal">iputils-tracepath</code>
</a></td>
<td align="left"><a class="ulink" href="http://qa.debian.org/popcon.php?package=iputils-tracepath" target="_top">http://qa.debian.org/popcon.php?package=iputils-tracepath</a></td>
<td align="left"><a class="ulink" href="http://packages.qa.debian.org/i/iputils-tracepath.html" target="_top">116</a></td>
<td align="left">
, ,
</td>
<td align="left">
trace the network path to a remote host
</td>
</tr>
<tr>
<td align="left"><a class="ulink" href="http://packages.debian.org/sid/net-tools" target="_top">
<code class="literal">net-tools</code>
</a></td>
<td align="left"><a class="ulink" href="http://qa.debian.org/popcon.php?package=net-tools" target="_top">http://qa.debian.org/popcon.php?package=net-tools</a></td>
<td align="left"><a class="ulink" href="http://packages.qa.debian.org/n/net-tools.html" target="_top">996</a></td>
<td align="left">
config::net-tools
</td>
<td align="left">
NET-3 networking toolkit (<a class="ulink" href="http://www.linuxfoundation.org/en/Net:Net-tools" target="_top">net-tools</a>, IPv4 network configuration): <span class="citerefentry"><span class="refentrytitle">ifconfig</span>(8)</span> etc.
</td>
</tr>
<tr>
<td align="left"><a class="ulink" href="http://packages.debian.org/sid/inetutils-ping" target="_top">
<code class="literal">inetutils-ping</code>
</a></td>
<td align="left"><a class="ulink" href="http://qa.debian.org/popcon.php?package=inetutils-ping" target="_top">http://qa.debian.org/popcon.php?package=inetutils-ping</a></td>
<td align="left"><a class="ulink" href="http://packages.qa.debian.org/i/inetutils-ping.html" target="_top">278</a></td>
<td align="left">
test::net-tools
</td>
<td align="left">
test network reachability of a remote host by <a class="ulink" href="http://en.wikipedia.org/wiki/Hostname" target="_top">hostname</a> or <a class="ulink" href="http://en.wikipedia.org/wiki/IP_address" target="_top">IP address</a> (legacy, GNU)
</td>
</tr>
<tr>
<td align="left"><a class="ulink" href="http://packages.debian.org/sid/arping" target="_top">
<code class="literal">arping</code>
</a></td>
<td align="left"><a class="ulink" href="http://qa.debian.org/popcon.php?package=arping" target="_top">http://qa.debian.org/popcon.php?package=arping</a></td>
<td align="left"><a class="ulink" href="http://packages.qa.debian.org/a/arping.html" target="_top">46</a></td>
<td align="left">
, ,
</td>
<td align="left">
test network reachability of a remote host specified by the <a class="ulink" href="http://en.wikipedia.org/wiki/Address_Resolution_Protocol" target="_top">ARP</a> address (legacy)
</td>
</tr>
<tr>
<td align="left"><a class="ulink" href="http://packages.debian.org/sid/traceroute" target="_top">
<code class="literal">traceroute</code>
</a></td>
<td align="left"><a class="ulink" href="http://qa.debian.org/popcon.php?package=traceroute" target="_top">http://qa.debian.org/popcon.php?package=traceroute</a></td>
<td align="left"><a class="ulink" href="http://packages.qa.debian.org/t/traceroute.html" target="_top">124</a></td>
<td align="left">
, ,
</td>
<td align="left">
trace the network path to a remote host (legacy, console)
</td>
</tr>
<tr>
<td align="left"><a class="ulink" href="http://packages.debian.org/sid/isc-dhcp-client" target="_top">
<code class="literal">isc-dhcp-client</code>
</a></td>
<td align="left"><a class="ulink" href="http://qa.debian.org/popcon.php?package=isc-dhcp-client" target="_top">http://qa.debian.org/popcon.php?package=isc-dhcp-client</a></td>
<td align="left"><a class="ulink" href="http://packages.qa.debian.org/i/isc-dhcp-client.html" target="_top">1776</a></td>
<td align="left">
config::low-level
</td>
<td align="left">
DHCP client
</td>
</tr>
<tr>
<td align="left"><a class="ulink" href="http://packages.debian.org/sid/wpasupplicant" target="_top">
<code class="literal">wpasupplicant</code>
</a></td>
<td align="left"><a class="ulink" href="http://qa.debian.org/popcon.php?package=wpasupplicant" target="_top">http://qa.debian.org/popcon.php?package=wpasupplicant</a></td>
<td align="left"><a class="ulink" href="http://packages.qa.debian.org/w/wpasupplicant.html" target="_top">1365</a></td>
<td align="left">
, ,
</td>
<td align="left">
client support for WPA and WPA2 (IEEE 802.11i)
</td>
</tr>
<tr>
<td align="left"><a class="ulink" href="http://packages.debian.org/sid/wpagui" target="_top">
<code class="literal">wpagui</code>
</a></td>
<td align="left"><a class="ulink" href="http://qa.debian.org/popcon.php?package=wpagui" target="_top">http://qa.debian.org/popcon.php?package=wpagui</a></td>
<td align="left"><a class="ulink" href="http://packages.qa.debian.org/w/wpagui.html" target="_top">790</a></td>
<td align="left">
, ,
</td>
<td align="left">
Qt GUI client for wpa_supplicant
</td>
</tr>
<tr>
<td align="left"><a class="ulink" href="http://packages.debian.org/sid/wireless-tools" target="_top">
<code class="literal">wireless-tools</code>
</a></td>
<td align="left"><a class="ulink" href="http://qa.debian.org/popcon.php?package=wireless-tools" target="_top">http://qa.debian.org/popcon.php?package=wireless-tools</a></td>
<td align="left"><a class="ulink" href="http://packages.qa.debian.org/w/wireless-tools.html" target="_top">325</a></td>
<td align="left">
, ,
</td>
<td align="left">
tools for manipulating Linux Wireless Extensions
</td>
</tr>
<tr>
<td align="left"><a class="ulink" href="http://packages.debian.org/sid/ppp" target="_top">
<code class="literal">ppp</code>
</a></td>
<td align="left"><a class="ulink" href="http://qa.debian.org/popcon.php?package=ppp" target="_top">http://qa.debian.org/popcon.php?package=ppp</a></td>
<td align="left"><a class="ulink" href="http://packages.qa.debian.org/p/ppp.html" target="_top">858</a></td>
<td align="left">
, ,
</td>
<td align="left">
PPP/PPPoE connection with <code class="literal">chat</code>
</td>
</tr>
<tr>
<td align="left"><a class="ulink" href="http://packages.debian.org/sid/pppoeconf" target="_top">
<code class="literal">pppoeconf</code>
</a></td>
<td align="left"><a class="ulink" href="http://qa.debian.org/popcon.php?package=pppoeconf" target="_top">http://qa.debian.org/popcon.php?package=pppoeconf</a></td>
<td align="left"><a class="ulink" href="http://packages.qa.debian.org/p/pppoeconf.html" target="_top">340</a></td>
<td align="left">
config::helper
</td>
<td align="left">
configuration helper for PPPoE connection
</td>
</tr>
<tr>
<td align="left"><a class="ulink" href="http://packages.debian.org/sid/pppconfig" target="_top">
<code class="literal">pppconfig</code>
</a></td>
<td align="left"><a class="ulink" href="http://qa.debian.org/popcon.php?package=pppconfig" target="_top">http://qa.debian.org/popcon.php?package=pppconfig</a></td>
<td align="left"><a class="ulink" href="http://packages.qa.debian.org/p/pppconfig.html" target="_top">1024</a></td>
<td align="left">
, ,
</td>
<td align="left">
configuration helper for PPP connection with <code class="literal">chat</code>
</td>
</tr>
<tr>
<td align="left"><a class="ulink" href="http://packages.debian.org/sid/wvdial" target="_top">
<code class="literal">wvdial</code>
</a></td>
<td align="left"><a class="ulink" href="http://qa.debian.org/popcon.php?package=wvdial" target="_top">http://qa.debian.org/popcon.php?package=wvdial</a></td>
<td align="left"><a class="ulink" href="http://packages.qa.debian.org/w/wvdial.html" target="_top">276</a></td>
<td align="left">
, ,
</td>
<td align="left">
configuration helper for PPP connection with <code class="literal">wvdial</code> and <code class="literal">ppp</code>
</td>
</tr>
<tr>
<td align="left"><a class="ulink" href="http://packages.debian.org/sid/mtr-tiny" target="_top">
<code class="literal">mtr-tiny</code>
</a></td>
<td align="left"><a class="ulink" href="http://qa.debian.org/popcon.php?package=mtr-tiny" target="_top">http://qa.debian.org/popcon.php?package=mtr-tiny</a></td>
<td align="left"><a class="ulink" href="http://packages.qa.debian.org/m/mtr-tiny.html" target="_top">113</a></td>
<td align="left">
test::low-level
</td>
<td align="left">
trace the network path to a remote host (curses)
</td>
</tr>
<tr>
<td align="left"><a class="ulink" href="http://packages.debian.org/sid/mtr" target="_top">
<code class="literal">mtr</code>
</a></td>
<td align="left"><a class="ulink" href="http://qa.debian.org/popcon.php?package=mtr" target="_top">http://qa.debian.org/popcon.php?package=mtr</a></td>
<td align="left"><a class="ulink" href="http://packages.qa.debian.org/m/mtr.html" target="_top">154</a></td>
<td align="left">
, ,
</td>
<td align="left">
trace the network path to a remote host (curses and GTK+)
</td>
</tr>
<tr>
<td align="left"><a class="ulink" href="http://packages.debian.org/sid/gnome-nettool" target="_top">
<code class="literal">gnome-nettool</code>
</a></td>
<td align="left"><a class="ulink" href="http://qa.debian.org/popcon.php?package=gnome-nettool" target="_top">http://qa.debian.org/popcon.php?package=gnome-nettool</a></td>
<td align="left"><a class="ulink" href="http://packages.qa.debian.org/g/gnome-nettool.html" target="_top">2644</a></td>
<td align="left">
, ,
</td>
<td align="left">
tools for common network information operations (GNOME)
</td>
</tr>
<tr>
<td align="left"><a class="ulink" href="http://packages.debian.org/sid/nmap" target="_top">
<code class="literal">nmap</code>
</a></td>
<td align="left"><a class="ulink" href="http://qa.debian.org/popcon.php?package=nmap" target="_top">http://qa.debian.org/popcon.php?package=nmap</a></td>
<td align="left"><a class="ulink" href="http://packages.qa.debian.org/n/nmap.html" target="_top">10815</a></td>
<td align="left">
, ,
</td>
<td align="left">
network mapper / port scanner (<a class="ulink" href="http://en.wikipedia.org/wiki/Nmap" target="_top">Nmap</a>, console)
</td>
</tr>
<tr>
<td align="left"><a class="ulink" href="http://packages.debian.org/sid/zenmap" target="_top">
<code class="literal">zenmap</code>
</a></td>
<td align="left"><a class="ulink" href="http://qa.debian.org/popcon.php?package=zenmap" target="_top">http://qa.debian.org/popcon.php?package=zenmap</a></td>
<td align="left"><a class="ulink" href="http://packages.qa.debian.org/z/zenmap.html" target="_top">2135</a></td>
<td align="left">
, ,
</td>
<td align="left">
network mapper / port scanner (GTK+)
</td>
</tr>
<tr>
<td align="left"><a class="ulink" href="http://packages.debian.org/sid/tcpdump" target="_top">
<code class="literal">tcpdump</code>
</a></td>
<td align="left"><a class="ulink" href="http://qa.debian.org/popcon.php?package=tcpdump" target="_top">http://qa.debian.org/popcon.php?package=tcpdump</a></td>
<td align="left"><a class="ulink" href="http://packages.qa.debian.org/t/tcpdump.html" target="_top">1023</a></td>
<td align="left">
, ,
</td>
<td align="left">
network traffic analyzer (<a class="ulink" href="http://en.wikipedia.org/wiki/Tcpdump" target="_top">Tcpdump</a>, console)
</td>
</tr>
<tr>
<td align="left"><a class="ulink" href="http://packages.debian.org/sid/wireshark" target="_top">
<code class="literal">wireshark</code>
</a></td>
<td align="left"><a class="ulink" href="http://qa.debian.org/popcon.php?package=wireshark" target="_top">http://qa.debian.org/popcon.php?package=wireshark</a></td>
<td align="left"><a class="ulink" href="http://packages.qa.debian.org/w/wireshark.html" target="_top">2214</a></td>
<td align="left">
, ,
</td>
<td align="left">
network traffic analyzer (<a class="ulink" href="http://en.wikipedia.org/wiki/Wireshark" target="_top">Wireshark</a>, GTK+)
</td>
</tr>
<tr>
<td align="left"><a class="ulink" href="http://packages.debian.org/sid/tshark" target="_top">
<code class="literal">tshark</code>
</a></td>
<td align="left"><a class="ulink" href="http://qa.debian.org/popcon.php?package=tshark" target="_top">http://qa.debian.org/popcon.php?package=tshark</a></td>
<td align="left"><a class="ulink" href="http://packages.qa.debian.org/t/tshark.html" target="_top">302</a></td>
<td align="left">
, ,
</td>
<td align="left">
network traffic analyzer (console)
</td>
</tr>
<tr>
<td align="left"><a class="ulink" href="http://packages.debian.org/sid/nagios3" target="_top">
<code class="literal">nagios3</code>
</a></td>
<td align="left"><a class="ulink" href="http://qa.debian.org/popcon.php?package=nagios3" target="_top">http://qa.debian.org/popcon.php?package=nagios3</a></td>
<td align="left"><a class="ulink" href="http://packages.qa.debian.org/n/nagios3.html" target="_top">29</a></td>
<td align="left">
, ,
</td>
<td align="left">
monitoring and management system for hosts, services and networks (<a class="ulink" href="http://en.wikipedia.org/wiki/Nagios" target="_top">Nagios</a>)
</td>
</tr>
<tr>
<td align="left"><a class="ulink" href="http://packages.debian.org/sid/tcptrace" target="_top">
<code class="literal">tcptrace</code>
</a></td>
<td align="left"><a class="ulink" href="http://qa.debian.org/popcon.php?package=tcptrace" target="_top">http://qa.debian.org/popcon.php?package=tcptrace</a></td>
<td align="left"><a class="ulink" href="http://packages.qa.debian.org/t/tcptrace.html" target="_top">389</a></td>
<td align="left">
, ,
</td>
<td align="left">
produce a summarization of the connections from <code class="literal">tcpdump</code> output
</td>
</tr>
<tr>
<td align="left"><a class="ulink" href="http://packages.debian.org/sid/snort" target="_top">
<code class="literal">snort</code>
</a></td>
<td align="left"><a class="ulink" href="http://qa.debian.org/popcon.php?package=snort" target="_top">http://qa.debian.org/popcon.php?package=snort</a></td>
<td align="left"><a class="ulink" href="http://packages.qa.debian.org/s/snort.html" target="_top">1659</a></td>
<td align="left">
, ,
</td>
<td align="left">
flexible network intrusion detection system (<a class="ulink" href="http://en.wikipedia.org/wiki/Snort_(software)" target="_top">Snort</a>)
</td>
</tr>
<tr>
<td align="left"><a class="ulink" href="http://packages.debian.org/sid/ntop" target="_top">
<code class="literal">ntop</code>
</a></td>
<td align="left"><a class="ulink" href="http://qa.debian.org/popcon.php?package=ntop" target="_top">http://qa.debian.org/popcon.php?package=ntop</a></td>
<td align="left"><a class="ulink" href="http://packages.qa.debian.org/n/ntop.html" target="_top">1656</a></td>
<td align="left">
, ,
</td>
<td align="left">
display network usage in web browser
</td>
</tr>
<tr>
<td align="left"><a class="ulink" href="http://packages.debian.org/sid/dnsutils" target="_top">
<code class="literal">dnsutils</code>
</a></td>
<td align="left"><a class="ulink" href="http://qa.debian.org/popcon.php?package=dnsutils" target="_top">http://qa.debian.org/popcon.php?package=dnsutils</a></td>
<td align="left"><a class="ulink" href="http://packages.qa.debian.org/d/dnsutils.html" target="_top">374</a></td>
<td align="left">
, ,
</td>
<td align="left">
network clients provided with <a class="ulink" href="http://en.wikipedia.org/wiki/BIND" target="_top">BIND</a>: <span class="citerefentry"><span class="refentrytitle">nslookup</span>(8)</span>, <span class="citerefentry"><span class="refentrytitle">nsupdate</span>(8)</span>, <span class="citerefentry"><span class="refentrytitle">dig</span>(8)</span>
</td>
</tr>
<tr>
<td align="left"><a class="ulink" href="http://packages.debian.org/sid/dlint" target="_top">
<code class="literal">dlint</code>
</a></td>
<td align="left"><a class="ulink" href="http://qa.debian.org/popcon.php?package=dlint" target="_top">http://qa.debian.org/popcon.php?package=dlint</a></td>
<td align="left"><a class="ulink" href="http://packages.qa.debian.org/d/dlint.html" target="_top">96</a></td>
<td align="left">
, ,
</td>
<td align="left">
check <a class="ulink" href="http://en.wikipedia.org/wiki/Domain_Name_System" target="_top">DNS</a> zone information using nameserver lookups
</td>
</tr>
<tr>
<td align="left"><a class="ulink" href="http://packages.debian.org/sid/dnstracer" target="_top">
<code class="literal">dnstracer</code>
</a></td>
<td align="left"><a class="ulink" href="http://qa.debian.org/popcon.php?package=dnstracer" target="_top">http://qa.debian.org/popcon.php?package=dnstracer</a></td>
<td align="left"><a class="ulink" href="http://packages.qa.debian.org/d/dnstracer.html" target="_top">81</a></td>
<td align="left">
, ,
</td>
<td align="left">
trace a chain of <a class="ulink" href="http://en.wikipedia.org/wiki/Domain_Name_System" target="_top">DNS</a> servers to the source
</td>
</tr>
</tbody>
</table></div>
</div>
<br class="table-break"><div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="_the_domain_name"></a>5.1.1. The domain name</h3></div></div></div>
<p>The naming for the domain name is a tricky one for the normal PC workstation users. The PC workstation may be mobile one hopping around the network or located behind the NAT firewall inaccessible from the Internet. For such case, you may not want the domain name to be a valid domain name to avoid name collision.</p>
<p>If you are not sure what to chose for the domain name, choose "<code class="literal">localdomain</code>".</p>
<p>Other popular choices for such invalid and safe <a class="ulink" href="http://en.wikipedia.org/wiki/Top-level_domain" target="_top">top-level domain (TLD)</a> seem to be "<code class="literal">lan</code>", "<code class="literal">localnet</code>", "<code class="literal">home</code>", "<code class="literal">invalid</code>", or "<code class="literal">local</code>" according to my incoming mail analysis. This is consistent with the reported invalid TLD queries. You may also chose some unused second or third level domains.</p>
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
<li class="listitem"><p><a class="ulink" href="http://en.wikipedia.org/wiki/.invalid" target="_top">".invalid"</a> is intended for use in online construction of domain names that are sure to be invalid. (<a class="ulink" href="http://tools.ietf.org/html/rfc2606" target="_top">rfc2606</a>)
</p></li>
<li class="listitem"><p><a class="ulink" href="http://en.wikipedia.org/wiki/.local" target="_top">".local"</a> is the <a class="ulink" href="http://en.wikipedia.org/wiki/Pseudo-top-level_domain" target="_top">pseudo-top-level domain</a> used by the <a class="ulink" href="http://en.wikipedia.org/wiki/MDNS" target="_top">mDNS</a> network discovery protocol (<a class="ulink" href="http://en.wikipedia.org/wiki/Bonjour_(software)" target="_top">Apple Bonjour / Apple Rendezvous</a>, Avahi on Debian).
</p></li>
</ul></div>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Warning">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Warning]" src="images/warning.png"></td>
<th align="left">Warning</th>
</tr>
<tr><td align="left" valign="top"><p>If the DNS service on your LAN uses "<code class="literal">local</code>" as TLD for your LAN, it may interfare with mDNS.</p></td></tr>
</table></div>
<div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Tip">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Tip]" src="images/tip.png"></td>
<th align="left">Tip</th>
</tr>
<tr><td align="left" valign="top"><p>When you use an invalid domain name, you need to spoof the domain name used by some programs such as MTA for their proper operation. See <a class="xref" href="ch06.en.html#_the_mail_address_configuration" title="6.3.3. The mail address configuration">Section 6.3.3, “The mail address configuration”</a>.</p></td></tr>
</table></div>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="_the_hostname_resolution"></a>5.1.2. The hostname resolution</h3></div></div></div>
<p>The hostname resolution is currently supported by the <a class="ulink" href="http://en.wikipedia.org/wiki/Name_Service_Switch" target="_top">NSS (Name Service Switch)</a> mechanism too. The flow of this resolution is the following.</p>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem"><p>
The "<code class="literal">/etc/nsswitch.conf</code>" file with stanza like "<code class="literal">hosts: files dns</code>" dictates the hostname resolution order. (This replaces the old functionality of the "<code class="literal">order</code>" stanza in "<code class="literal">/etc/host.conf</code>".)
</p></li>
<li class="listitem"><p>
The <code class="literal">files</code> method is invoked first. If the hostname is found in the "<code class="literal">/etc/hosts</code>" file, it returns all valid addresses for it and exits. (The "<code class="literal">/etc/host.conf</code>" file contains "<code class="literal">multi on</code>".)
</p></li>
<li class="listitem"><p>
The <code class="literal">dns</code> method is invoked. If the hostname is found by the query to the <a class="ulink" href="http://en.wikipedia.org/wiki/Domain_Name_System" target="_top">Internet Domain Name System (DNS)</a> identified by the "<code class="literal">/etc/resolv.conf</code>" file, it returns all valid addresses for it and exits.
</p></li>
</ol></div>
<p>For example, "<code class="literal">/etc/hosts</code>" looks like the following.</p>
<pre class="screen">127.0.0.1 localhost
127.0.1.1 &lt;host_name&gt;.&lt;domain_name&gt; &lt;host_name&gt;
# 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</pre>
<p>Each line starts with a <a class="ulink" href="http://en.wikipedia.org/wiki/IP_address" target="_top">IP address</a> and it is followed by the associated <a class="ulink" href="http://en.wikipedia.org/wiki/Hostname" target="_top">hostname</a>.</p>
<p>The IP address <code class="literal">127.0.1.1</code> in the second line of this example may not be found on some other Unix-like systems. The <a class="ulink" href="http://en.wikipedia.org/wiki/Debian-Installer" target="_top">Debian Installer</a> creates this entry for a system without a permanent IP address as a workaround for some software (e.g., GNOME) as documented in the <a class="ulink" href="http://bugs.debian.org/316099" target="_top">bug #316099</a>.</p>
<p>The &lt;host_name&gt; matches the hostname defined in the "<code class="literal">/etc/hostname</code>".</p>
<p>For &lt;domain_name&gt; of the mobile PC, you may chose invalid and safe domain such as "<code class="literal">localdomain</code>". (See <a class="xref" href="ch05.en.html#_the_domain_name" title="5.1.1. The domain name">Section 5.1.1, “The domain name”</a>)</p>
<p>For a system with a permanent IP address, that permanent IP address should be used here instead of <code class="literal">127.0.1.1</code>.</p>
<p>For a system with a permanent IP address and a <a class="ulink" href="http://en.wikipedia.org/wiki/FQDN" target="_top">fully qualified domain name (FQDN)</a> provided by the <a class="ulink" href="http://en.wikipedia.org/wiki/Domain_Name_System" target="_top">Domain Name System (DNS)</a>, that canonical &lt;host_name&gt; and &lt;domain_name&gt; should be used here.</p>
<p>The "<code class="literal">/etc/resolv.conf</code>" is a static file if the <code class="literal">resolvconf</code> package is not installed. If installed, it is a symbolic link. Either way, it contains information that initialize the resolver routines. If the DNS is found at IP="<code class="literal">192.168.11.1</code>", it contains the following.</p>
<pre class="screen">nameserver 192.168.11.1</pre>
<p>The <code class="literal">resolvconf</code> package makes this "<code class="literal">/etc/resolv.conf</code>" into a symbolic link and manages its contents by the hook scripts automatically.</p>
<p>The hostname resolution via Multicast DNS (using <a class="ulink" href="http://en.wikipedia.org/wiki/Zeroconf" target="_top">Zeroconf</a>, aka <a class="ulink" href="http://en.wikipedia.org/wiki/Bonjour_(software)" target="_top">Apple Bonjour / Apple Rendezvous</a>) which effectively allows name resolution by common Unix/Linux programs in the ad-hoc mDNS domain "<code class="literal">local</code>", can be provided by installing the <code class="literal">libnss-mdns</code> package. The "<code class="literal">/etc/nsswitch.conf</code>" file should have stanza like "<code class="literal">hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4</code>" to enable this functionality.</p>
<p>The hostname resolution via deprecated <a class="ulink" href="http://en.wikipedia.org/wiki/NetBIOS_over_TCP/IP" target="_top">NETBios over TCP/IP</a> used by the older Windows system can be provided by installing the <code class="literal">winbind</code> package. The "<code class="literal">/etc/nsswitch.conf</code>" file should have stanza like "<code class="literal">hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4 wins</code>" to enable this functionality. (Modern Windows system usually use the <code class="literal">dns</code> method for the hostname resolution.)</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="_the_network_interface_name"></a>5.1.3. The network interface name</h3></div></div></div>
<p>The network interface name, e.g. <code class="literal">eth0</code>, is assigned to each hardware in the Linux kernel through the user space configuration mechanism, <code class="literal">udev</code> (see <a class="xref" href="ch03.en.html#_the_udev_system" title="3.5.11. The udev system">Section 3.5.11, “The udev system”</a>), as it is found. The network interface name is referred as <span class="strong"><strong>physical interface</strong></span> in <span class="citerefentry"><span class="refentrytitle">ifup</span>(8)</span> and <span class="citerefentry"><span class="refentrytitle">interfaces</span>(5)</span>.</p>
<p>In order to ensure each network interface to be named persistently for each reboot using <a class="ulink" href="http://en.wikipedia.org/wiki/MAC_address" target="_top">MAC address</a> etc., there is a record file "<code class="literal">/etc/udev/rules.d/70-persistent-net.rules</code>". This file is automatically generated by the "<code class="literal">/lib/udev/write_net_rules</code>" program, probably run by the "<code class="literal">persistent-net-generator.rules</code>" rules file. You can modify it to change naming rule.</p>
<div class="caution" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Caution">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Caution]" src="images/caution.png"></td>
<th align="left">Caution</th>
</tr>
<tr><td align="left" valign="top"><p>When editing the "<code class="literal">/etc/udev/rules.d/70-persistent-net.rules</code>" rules file, you must keep each rule on a single line and the <a class="ulink" href="http://en.wikipedia.org/wiki/MAC_address" target="_top">MAC address</a> in lowercase. For example, if you find "FireWire device" and "PCI device" in this file, you probably want to name "PCI device" as <code class="literal">eth0</code> and configure it as the primary network interface.</p></td></tr>
</table></div>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="_the_network_address_range_for_the_lan"></a>5.1.4. The network address range for the LAN</h3></div></div></div>
<p>Let us be reminded of the IPv4 32 bit address ranges in each class reserved for use on the <a class="ulink" href="http://en.wikipedia.org/wiki/Local_area_network" target="_top">local area networks (LANs)</a> by <a class="ulink" href="http://tools.ietf.org/html/rfc1918" target="_top">rfc1918</a>. These addresses are guaranteed not to conflict with any addresses on the Internet proper.</p>
<div class="table">
<a name="listofnetworkaddressranges"></a><p class="title"><b>Table 5.2. List of network address ranges</b></p>
<div class="table-contents"><table summary="List of network address ranges" border="1">
<colgroup>
<col align="left">
<col align="left">
<col align="left">
<col align="left">
<col align="left">
</colgroup>
<thead><tr>
<th align="left">
Class
</th>
<th align="left">
network addresses
</th>
<th align="left">
net mask
</th>
<th align="left">
net mask /bits
</th>
<th align="left">
# of subnets
</th>
</tr></thead>
<tbody>
<tr>
<td align="left">
A
</td>
<td align="left">
10.x.x.x
</td>
<td align="left">
255.0.0.0
</td>
<td align="left">
/8
</td>
<td align="left">
1
</td>
</tr>
<tr>
<td align="left">
B
</td>
<td align="left">
172.16.x.x — 172.31.x.x
</td>
<td align="left">
255.255.0.0
</td>
<td align="left">
/16
</td>
<td align="left">
16
</td>
</tr>
<tr>
<td align="left">
C
</td>
<td align="left">
192.168.0.x — 192.168.255.x
</td>
<td align="left">
255.255.255.0
</td>
<td align="left">
/24
</td>
<td align="left">
256
</td>
</tr>
</tbody>
</table></div>
</div>
<br class="table-break"><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td>
<th align="left">Note</th>
</tr>
<tr><td align="left" valign="top"><p>If one of these addresses is assigned to a host, then that host must not access the Internet directly but must access it through a gateway that acts as a proxy for individual services or else does <a class="ulink" href="http://en.wikipedia.org/wiki/Network_address_translation" target="_top">Network Address Translation(NAT)</a>. The broadband router usually performs NAT for the consumer LAN environment.</p></td></tr>
</table></div>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="_the_network_device_support"></a>5.1.5. The network device support</h3></div></div></div>
<p>Although most hardware devices are supported by the Debian system, there are some network devices which require <a class="ulink" href="http://www.debian.org/social_contract#guidelines" target="_top">DFSG</a> non-free external hardware drivers to support them. Please see <a class="xref" href="ch09.en.html#_non_free_hardware_drivers" title="9.7.6. Non-free hardware drivers">Section 9.7.6, “Non-free hardware drivers”</a>.</p>
</div>
</div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="_the_modern_network_configuration_for_desktop"></a>5.2. The modern network configuration for desktop</h2></div></div></div>
<p>Debian <code class="literal">squeeze</code> systems can manage the network connection via management <a class="ulink" href="http://en.wikipedia.org/wiki/Daemon_(computer_software)" target="_top">daemon</a> software such as <a class="ulink" href="http://en.wikipedia.org/wiki/NetworkManager" target="_top">NetworkManager (NM)</a> (network-manager and associated packages) or <a class="ulink" href="http://en.wikipedia.org/wiki/Wicd_(Linux_Network_Manager)" target="_top">Wicd</a> (wicd and associated packages).</p>
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
<li class="listitem"><p>
They come with their own <a class="ulink" href="http://en.wikipedia.org/wiki/Graphical_user_interface" target="_top">GUI</a> and command-line programs as their user interfaces.
</p></li>
<li class="listitem"><p>
They come with their own <a class="ulink" href="http://en.wikipedia.org/wiki/Daemon_(computer_software)" target="_top">daemon</a> as their backend system.
</p></li>
<li class="listitem"><p>
They allow easy connection of your system to the Internet.
</p></li>
<li class="listitem"><p>
They allow easy management of wired and wireless network configuration.
</p></li>
<li class="listitem"><p>
They allow us to configure network independent of the legacy <code class="literal">ifupdown</code> package.
</p></li>
</ul></div>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td>
<th align="left">Note</th>
</tr>
<tr><td align="left" valign="top"><p>Do not use these automatic network configuration tools for servers. These are aimed primarily for mobile desktop users on laptops.</p></td></tr>
</table></div>
<p>These modern network configuration tools need to be configured properly to avoid conflicting with the legacy <code class="literal">ifupdown</code> package and its configuration file "<code class="literal">/etc/network/interfaces</code>".</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td>
<th align="left">Note</th>
</tr>
<tr><td align="left" valign="top"><p>Some features of these automatic network configuration tools may suffer regressions. These are not as robust as the legacy <code class="literal">ifupdown</code> package. Check <a class="ulink" href="http://bugs.debian.org/cgi-bin/pkgreport.cgi?package=network-manager" target="_top">BTS of network-manager</a> and <a class="ulink" href="http://bugs.debian.org/cgi-bin/pkgreport.cgi?package=wicd" target="_top">BTS of wicd</a> for current issues and limitations.</p></td></tr>
</table></div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="_gui_network_configuration_tools"></a>5.2.1. GUI network configuration tools</h3></div></div></div>
<p>Official documentations for NM and Wicd on Debian are provided in "<code class="literal">/usr/share/doc/network-manager/README.Debian</code>" and "<code class="literal">/usr/share/doc/wicd/README.Debian</code>", respectively.</p>
<p>Essentially, the network configuration for desktop is done as follows.</p>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<p>
Make desktop user, e.g. <code class="literal">foo</code>, belong to group "<code class="literal">netdev</code>" by the following (Alternatively, do it automatically via <a class="ulink" href="http://en.wikipedia.org/wiki/D-Bus" target="_top">D-bus</a> under modern desktop environments such as GNOME and KDE).
</p>
<pre class="screen">$ sudo adduser foo netdev</pre>
</li>
<li class="listitem">
<p>
Keep configuration of "<code class="literal">/etc/network/interfaces</code>" as simple as the the following.
</p>
<pre class="screen">auto lo
iface lo inet loopback</pre>
</li>
<li class="listitem">
<p>
Restart NM or Wicd by the following.
</p>
<pre class="screen">$ sudo /etc/init.d/network-manager restart</pre>
<pre class="screen">$ sudo /etc/init.d/wicd restart</pre>
</li>
<li class="listitem"><p>
Configure your network via GUI.
</p></li>
</ol></div>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td>
<th align="left">Note</th>
</tr>
<tr><td align="left" valign="top"><p>Only interfaces which are <span class="strong"><strong>not</strong></span> listed in "<code class="literal">/etc/network/interfaces</code>" or which have been configured with "<code class="literal">auto …</code>" or "<code class="literal">allow-hotplug …</code>" and "<code class="literal">iface … inet dhcp</code>" (with no other options) are managed by NM to avoid conflict with <code class="literal">ifupdown</code>.</p></td></tr>
</table></div>
<div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Tip">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Tip]" src="images/tip.png"></td>
<th align="left">Tip</th>
</tr>
<tr><td align="left" valign="top"><p>If you wish to extend network configuration capabilities of NM, please seek appropriate plug-in modules and supplemental packages such as <code class="literal">network-manager-openconnect</code>, <code class="literal">network-manager-openvpn-gnome</code>, <code class="literal">network-manager-pptp-gnome</code>, <code class="literal">mobile-broadband-provider-info</code>, <code class="literal">gnome-bluetooth</code>, etc. The same goes for those of Wicd.</p></td></tr>
</table></div>
<div class="caution" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Caution">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Caution]" src="images/caution.png"></td>
<th align="left">Caution</th>
</tr>
<tr><td align="left" valign="top"><p>These automatic network configuration tools may not be compatible with esoteric configurations of legacy <code class="literal">ifupdown</code> in "<code class="literal">/etc/network/interfaces</code>" such as ones in <a class="xref" href="ch05.en.html#_the_basic_network_configuration_with_ifupdown_legacy" title="5.5. The basic network configuration with ifupdown (legacy)">Section 5.5, “The basic network configuration with ifupdown (legacy)”</a> and <a class="xref" href="ch05.en.html#_the_advanced_network_configuration_with_ifupdown_legacy" title="5.6. The advanced network configuration with ifupdown (legacy)">Section 5.6, “The advanced network configuration with ifupdown (legacy)”</a>. Check <a class="ulink" href="http://bugs.debian.org/cgi-bin/pkgreport.cgi?package=network-manager" target="_top">BTS of network-manager</a> and <a class="ulink" href="http://bugs.debian.org/cgi-bin/pkgreport.cgi?package=wicd" target="_top">BTS of wicd</a> for current issues and limitations.</p></td></tr>
</table></div>
</div>
</div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="_the_legacy_network_connection_and_configuration"></a>5.3. The legacy network connection and configuration</h2></div></div></div>
<p>When the method described in <a class="xref" href="ch05.en.html#_the_modern_network_configuration_for_desktop" title="5.2. The modern network configuration for desktop">Section 5.2, “The modern network configuration for desktop”</a> does not suffice your needs, you should use the legacy network connection and configuration method which combines many simpler tools.</p>
<p>The legacy network connection is specific for each method (see <a class="xref" href="ch05.en.html#_the_network_connection_method_legacy" title="5.4. The network connection method (legacy)">Section 5.4, “The network connection method (legacy)”</a>).</p>
<p>There are 2 types of programs for the low level network configuration on Linux (see <a class="xref" href="ch05.en.html#_iproute2_commands" title="5.7.1. Iproute2 commands">Section 5.7.1, “Iproute2 commands”</a>).</p>
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
<li class="listitem"><p>
Old <a class="ulink" href="http://www.linuxfoundation.org/en/Net:Net-tools" target="_top">net-tools</a> programs (<span class="citerefentry"><span class="refentrytitle">ifconfig</span>(8)</span>, …) are from the Linux NET-3 networking system. Most of these are obsolete now.
</p></li>
<li class="listitem"><p>
New <a class="ulink" href="http://www.linuxfoundation.org/en/Net:Iproute2" target="_top">Linux iproute2</a> programs (<span class="citerefentry"><span class="refentrytitle">ip</span>(8)</span>, …) are the current Linux networking system.
</p></li>
</ul></div>
<p>Although these low level networking programs are powerful, they are cumbersome to use. So high level network configuration systems have been created.</p>
<p>The <code class="literal">ifupdown</code> package is the de facto standard for such high level network configuration system on Debian. It enables you to bring up network simply by doing , e.g., "<code class="literal">ifup eth0</code>". Its configuration file is the "<code class="literal">/etc/network/interfaces</code>" file and its typical contents are the following.</p>
<pre class="screen">auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp</pre>
<p>The <code class="literal">resolvconf</code> package was created to supplement <code class="literal">ifupdown</code> system to support smooth reconfiguration of network address resolution by automating rewrite of resolver configuration file "<code class="literal">/etc/resolv.conf</code>". Now, most Debian network configuration packages are modified to use <code class="literal">resolvconf</code> package (see "<code class="literal">/usr/share/doc/resolvconf/README.Debian</code>").</p>
<p>Helper scripts to the <code class="literal">ifupdown</code> package such as <code class="literal">ifplugd</code>, <code class="literal">guessnet</code>, <code class="literal">ifscheme</code>, etc. are created to automate dynamic configuration of network environment such as one for mobile PC on wired LAN. These are relatively difficult to use but play well with existing <code class="literal">ifupdown</code> system.</p>
<p>These are explained in detail with examples (see <a class="xref" href="ch05.en.html#_the_basic_network_configuration_with_ifupdown_legacy" title="5.5. The basic network configuration with ifupdown (legacy)">Section 5.5, “The basic network configuration with ifupdown (legacy)”</a> and <a class="xref" href="ch05.en.html#_the_advanced_network_configuration_with_ifupdown_legacy" title="5.6. The advanced network configuration with ifupdown (legacy)">Section 5.6, “The advanced network configuration with ifupdown (legacy)”</a>).</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="_the_network_connection_method_legacy"></a>5.4. The network connection method (legacy)</h2></div></div></div>
<div class="caution" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Caution">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Caution]" src="images/caution.png"></td>
<th align="left">Caution</th>
</tr>
<tr><td align="left" valign="top"><p>The connection test method described in this section are meant for testing purposes. It is not meant to be used directly for the daily network connection. You are advised to use them via NM, Wicd, or the <code class="literal">ifupdown</code> package (see <a class="xref" href="ch05.en.html#_the_modern_network_configuration_for_desktop" title="5.2. The modern network configuration for desktop">Section 5.2, “The modern network configuration for desktop”</a> and <a class="xref" href="ch05.en.html#_the_basic_network_configuration_with_ifupdown_legacy" title="5.5. The basic network configuration with ifupdown (legacy)">Section 5.5, “The basic network configuration with ifupdown (legacy)”</a>).</p></td></tr>
</table></div>
<p>The typical network connection method and connection path for a PC can be summarized as the following.</p>
<div class="table">
<a name="listofnetworkcondconnectionpaths"></a><p class="title"><b>Table 5.3. List of network connection methods and connection paths</b></p>
<div class="table-contents"><table summary="List of network connection methods and connection paths" border="1">
<colgroup>
<col align="left">
<col align="left">
<col align="left">
</colgroup>
<thead><tr>
<th align="left">
PC
</th>
<th align="left">
connection method
</th>
<th align="left">
connection path
</th>
</tr></thead>
<tbody>
<tr>
<td align="left">
Serial port (<code class="literal">ppp0</code>)
</td>
<td align="left">
PPP
</td>
<td align="left">
<a class="ulink" href="http://en.wikipedia.org/wiki/Modem" target="_top">modem</a> ⇔ POTS ⇔ dial-up access point ⇔ ISP
</td>
</tr>
<tr>
<td align="left">
Ethernet port (<code class="literal">eth0</code>)
</td>
<td align="left">
PPPoE/DHCP/Static
</td>
<td align="left">
⇔ BB-modem ⇔ BB service ⇔ BB access point ⇔ ISP
</td>
</tr>
<tr>
<td align="left">
Ethernet port (<code class="literal">eth0</code>)
</td>
<td align="left">
DHCP/Static
</td>
<td align="left">
⇔ LAN ⇔ BB-router with <a class="ulink" href="http://en.wikipedia.org/wiki/Network_address_translation" target="_top">network address translation (NAT)</a> (⇔ BB-modem …)
</td>
</tr>
</tbody>
</table></div>
</div>
<br class="table-break"><p>Here is the summary of configuration script for each connection method.</p>
<div class="table">
<a name="listofnetworkcononconfigurations"></a><p class="title"><b>Table 5.4. List of network connection configurations</b></p>
<div class="table-contents"><table summary="List of network connection configurations" border="1">
<colgroup>
<col align="left">
<col align="left">
<col align="left">
</colgroup>
<thead><tr>
<th align="left">
connection method
</th>
<th align="left">
configuration
</th>
<th align="left">
backend package(s)
</th>
</tr></thead>
<tbody>
<tr>
<td align="left">
PPP
</td>
<td align="left">
<code class="literal">pppconfig</code> to create deterministic chat
</td>
<td align="left">
<code class="literal">pppconfig</code>, <code class="literal">ppp</code>
</td>
</tr>
<tr>
<td align="left">
PPP (alternative)
</td>
<td align="left">
<code class="literal">wvdialconf</code> to create heuristic chat
</td>
<td align="left">
<code class="literal">ppp</code>, <code class="literal">wvdial</code>
</td>
</tr>
<tr>
<td align="left">
PPPoE
</td>
<td align="left">
<code class="literal">pppoeconf</code> to create deterministic chat
</td>
<td align="left">
<code class="literal">pppoeconf</code>, <code class="literal">ppp</code>
</td>
</tr>
<tr>
<td align="left">
DHCP
</td>
<td align="left">
described in "<code class="literal">/etc/dhcp/dhclient.conf</code>"
</td>
<td align="left">
<code class="literal">isc-dhcp-client</code>
</td>
</tr>
<tr>
<td align="left">
static IP (IPv4)
</td>
<td align="left">
described in "<code class="literal">/etc/network/interfaces</code>"
</td>
<td align="left">
<code class="literal">net-tools</code>
</td>
</tr>
<tr>
<td align="left">
static IP (IPv6)
</td>
<td align="left">
described in "<code class="literal">/etc/network/interfaces</code>"
</td>
<td align="left">
<code class="literal">iproute</code>
</td>
</tr>
</tbody>
</table></div>
</div>
<br class="table-break"><p>The network connection acronyms mean the following.</p>
<div class="table">
<a name="listofnetworkconnectionacronyms"></a><p class="title"><b>Table 5.5. List of network connection acronyms</b></p>
<div class="table-contents"><table summary="List of network connection acronyms" border="1">
<colgroup>
<col align="left">
<col align="left">
</colgroup>
<thead><tr>
<th align="left">
acronym
</th>
<th align="left">
meaning
</th>
</tr></thead>
<tbody>
<tr>
<td align="left">
<a class="ulink" href="http://en.wikipedia.org/wiki/Plain_old_telephone_service" target="_top">POTS</a>
</td>
<td align="left">
plain old telephone service
</td>
</tr>
<tr>
<td align="left">
BB
</td>
<td align="left">
<a class="ulink" href="http://en.wikipedia.org/wiki/Broadband" target="_top">broadband</a>
</td>
</tr>
<tr>
<td align="left">
BB-service
</td>
<td align="left">
e.g., the digital subscriber line (DSL), the cable TV, or the fiber to the premises (FTTP)
</td>
</tr>
<tr>
<td align="left">
BB-modem
</td>
<td align="left">
e.g., <a class="ulink" href="http://en.wikipedia.org/wiki/DSL_modem" target="_top">the DSL modem</a>, <a class="ulink" href="http://en.wikipedia.org/wiki/Cable_modem" target="_top">the cable modem</a>, or <a class="ulink" href="http://en.wikipedia.org/wiki/FTTP" target="_top">the optical network terminal (ONT)</a>
</td>
</tr>
<tr>
<td align="left">
<a class="ulink" href="http://en.wikipedia.org/wiki/Local_area_network" target="_top">LAN</a>
</td>
<td align="left">
local area network
</td>
</tr>
<tr>
<td align="left">
<a class="ulink" href="http://en.wikipedia.org/wiki/Wide_area_network" target="_top">WAN</a>
</td>
<td align="left">
wide area network
</td>
</tr>
<tr>
<td align="left">
<a class="ulink" href="http://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol" target="_top">DHCP</a>
</td>
<td align="left">
dynamic host configuration protocol
</td>
</tr>
<tr>
<td align="left">
<a class="ulink" href="http://en.wikipedia.org/wiki/Point-to-Point_Protocol" target="_top">PPP</a>
</td>
<td align="left">
point-to-point protocol
</td>
</tr>
<tr>
<td align="left">
<a class="ulink" href="http://en.wikipedia.org/wiki/Point-to-Point_Protocol_over_Ethernet" target="_top">PPPoE</a>
</td>
<td align="left">
point-to-point protocol over Ethernet
</td>
</tr>
<tr>
<td align="left">
<a class="ulink" href="http://en.wikipedia.org/wiki/ISP" target="_top">ISP</a>
</td>
<td align="left">
Internet service provider
</td>
</tr>
</tbody>
</table></div>
</div>
<br class="table-break"><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td>
<th align="left">Note</th>
</tr>
<tr><td align="left" valign="top"><p>The WAN connection services via cable TV are generally served by DHCP or PPPoE. The ones by ADSL and FTTP are generally served by PPPoE. You have to consult your ISP for exact configuration requirements of the WAN connection.</p></td></tr>
</table></div>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td>
<th align="left">Note</th>
</tr>
<tr><td align="left" valign="top"><p>When BB-router is used to create home LAN environment, PCs on LAN are connected to the WAN via BB-router with <a class="ulink" href="http://en.wikipedia.org/wiki/Network_address_translation" target="_top">network address translation (NAT)</a>. For such case, PC's network interfaces on the LAN are served by static IP or DHCP from the BB-router. BB-router must be configured to connect the WAN following the instruction by your ISP.</p></td></tr>
</table></div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="_the_dhcp_connection_with_the_ethernet"></a>5.4.1. The DHCP connection with the Ethernet</h3></div></div></div>
<p>The typical modern home and small business network, i.e. LAN, are connected to the WAN(Internet) using some consumer grade broadband router. The LAN behind this router is usually served by the <a class="ulink" href="http://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol" target="_top">dynamic host configuration protocol (DHCP)</a> server running on the router.</p>
<p>Just install the <code class="literal">isc-dhcp-client</code> package for the Ethernet served by the <a class="ulink" href="http://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol" target="_top">dynamic host configuration protocol (DHCP)</a>.</p>
<p>See <span class="citerefentry"><span class="refentrytitle">dhclient.conf</span>(5)</span>.</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="_the_static_ip_connection_with_the_ethernet"></a>5.4.2. The static IP connection with the Ethernet</h3></div></div></div>
<p>No special action is needed for the Ethernet served by the static IP.</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="_the_ppp_connection_with_pppconfig"></a>5.4.3. The PPP connection with pppconfig</h3></div></div></div>
<p>The configuration script <code class="literal">pppconfig</code> configures the <a class="ulink" href="http://en.wikipedia.org/wiki/Point-to-Point_Protocol" target="_top">PPP</a> connection interactively just by selecting the following.</p>
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
<li class="listitem"><p>
The telephone number
</p></li>
<li class="listitem"><p>
The ISP user name
</p></li>
<li class="listitem"><p>
The ISP password
</p></li>
<li class="listitem"><p>
The port speed
</p></li>
<li class="listitem"><p>
The modem communication port
</p></li>
<li class="listitem"><p>
The authentication method
</p></li>
</ul></div>
<div class="table">
<a name="listofconfigurationwithpppconfig"></a><p class="title"><b>Table 5.6. List of configuration files for the <a class="ulink" href="http://en.wikipedia.org/wiki/Point-to-Point_Protocol" target="_top">PPP</a> connection with pppconfig</b></p>
<div class="table-contents"><table summary="List of configuration files for the PPP connection with pppconfig" border="1">
<colgroup>
<col align="left">
<col align="left">
</colgroup>
<thead><tr>
<th align="left">
file
</th>
<th align="left">
function
</th>
</tr></thead>
<tbody>
<tr>
<td align="left">
<code class="literal">/etc/ppp/peers/&lt;isp_name&gt;</code>
</td>
<td align="left">
The <code class="literal">pppconfig</code> generated configuration file for <code class="literal">pppd</code> specific to &lt;isp_name&gt;
</td>
</tr>
<tr>
<td align="left">
<code class="literal">/etc/chatscripts/&lt;isp_name&gt;</code>
</td>
<td align="left">
The <code class="literal">pppconfig</code> generated configuration file for <code class="literal">chat</code> specific to &lt;isp_name&gt;
</td>
</tr>
<tr>
<td align="left">
<code class="literal">/etc/ppp/options</code>
</td>
<td align="left">
The general execution parameter for <code class="literal">pppd</code>
</td>
</tr>
<tr>
<td align="left">
<code class="literal">/etc/ppp/pap-secret</code>
</td>
<td align="left">
Authentication data for the <a class="ulink" href="http://en.wikipedia.org/wiki/Password_authentication_protocol" target="_top">PAP</a> (security risk)
</td>
</tr>
<tr>
<td align="left">
<code class="literal">/etc/ppp/chap-secret</code>
</td>
<td align="left">
Authentication data for the <a class="ulink" href="http://en.wikipedia.org/wiki/Challenge-handshake_authentication_protocol" target="_top">CHAP</a> (more secure)
</td>
</tr>
</tbody>
</table></div>
</div>
<br class="table-break"><div class="caution" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Caution">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Caution]" src="images/caution.png"></td>
<th align="left">Caution</th>
</tr>
<tr><td align="left" valign="top"><p>The "&lt;isp_name&gt;" value of "<code class="literal">provider</code>" is assumed if <code class="literal">pon</code> and <code class="literal">poff</code> commands are invoked without arguments.</p></td></tr>
</table></div>
<p>You can test configuration using low level network configuration tools as the following.</p>
<pre class="screen">$ sudo pon &lt;isp_name&gt;
...
$ sudo poff &lt;isp_name&gt;</pre>
<p>See "<code class="literal">/usr/share/doc/ppp/README.Debian.gz</code>".</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="_the_alternative_ppp_connection_with_wvdialconf"></a>5.4.4. The alternative PPP connection with wvdialconf</h3></div></div></div>
<p>A different approach to using <span class="citerefentry"><span class="refentrytitle">pppd</span>(8)</span> is to run it from <span class="citerefentry"><span class="refentrytitle">wvdial</span>(1)</span> which comes in the <code class="literal">wvdial</code> package. Instead of <code class="literal">pppd</code> running <span class="citerefentry"><span class="refentrytitle">chat</span>(8)</span> to dial in and negotiate the connection, <code class="literal">wvdial</code> does the dialing and initial negotiating and then starts <code class="literal">pppd</code> to do the rest.</p>
<p>The configuration script <code class="literal">wvdialconf</code> configures the PPP connection interactively just by selecting the following.</p>
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
<li class="listitem"><p>
The telephone number
</p></li>
<li class="listitem"><p>
The ISP user name
</p></li>
<li class="listitem"><p>
The ISP password
</p></li>
</ul></div>
<p><code class="literal">wvdial</code> succeeds in making the connection in most cases and maintains authentication data list automatically.</p>
<div class="table">
<a name="listofconfiguratonwithwvdialconf"></a><p class="title"><b>Table 5.7. List of configuration files for the PPP connection with wvdialconf</b></p>
<div class="table-contents"><table summary="List of configuration files for the PPP connection with wvdialconf" border="1">
<colgroup>
<col align="left">
<col align="left">
</colgroup>
<thead><tr>
<th align="left">
file
</th>
<th align="left">
function
</th>
</tr></thead>
<tbody>
<tr>
<td align="left">
<code class="literal">/etc/ppp/peers/wvdial</code>
</td>
<td align="left">
The <code class="literal">wvdialconf</code> generated configuration file for <code class="literal">pppd</code> specific to <code class="literal">wvdial</code>
</td>
</tr>
<tr>
<td align="left">
<code class="literal">/etc/wvdial.conf</code>
</td>
<td align="left">
The <code class="literal">wvdialconf</code> generated configuration file
</td>
</tr>
<tr>
<td align="left">
<code class="literal">/etc/ppp/options</code>
</td>
<td align="left">
The general execution parameter for <code class="literal">pppd</code>
</td>
</tr>
<tr>
<td align="left">
<code class="literal">/etc/ppp/pap-secret</code>
</td>
<td align="left">
Authentication data for the <a class="ulink" href="http://en.wikipedia.org/wiki/Password_authentication_protocol" target="_top">PAP</a> (security risk)
</td>
</tr>
<tr>
<td align="left">
<code class="literal">/etc/ppp/chap-secret</code>
</td>
<td align="left">
Authentication data for the <a class="ulink" href="http://en.wikipedia.org/wiki/Challenge-handshake_authentication_protocol" target="_top">CHAP</a> (more secure)
</td>
</tr>
</tbody>
</table></div>
</div>
<br class="table-break"><p>You can test configuration using low level network configuration tools as the following.</p>
<pre class="screen">$ sudo wvdial
...
$ sudo killall wvdial</pre>
<p>See <span class="citerefentry"><span class="refentrytitle">wvdial</span>(1)</span> and <span class="citerefentry"><span class="refentrytitle">wvdial.conf</span>(5)</span>.</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="_the_pppoe_connection_with_pppoeconf"></a>5.4.5. The PPPoE connection with pppoeconf</h3></div></div></div>
<p>When your ISP serves you with PPPoE connection and you decide to connect your PC directly to the WAN, the network of your PC must be configured with the PPPoE. The PPPoE stand for PPP over Ethernet. The configuration script <code class="literal">pppoeconf</code> configures the PPPoE connection interactively.</p>
<p>The configuration files are the following.</p>
<div class="table">
<a name="listofconfigurationwithpppoeconf"></a><p class="title"><b>Table 5.8. List of configuration files for the PPPoE connection with pppoeconf</b></p>
<div class="table-contents"><table summary="List of configuration files for the PPPoE connection with pppoeconf" border="1">
<colgroup>
<col align="left">
<col align="left">
</colgroup>
<thead><tr>
<th align="left">
file
</th>
<th align="left">
function
</th>
</tr></thead>
<tbody>
<tr>
<td align="left">
<code class="literal">/etc/ppp/peers/dsl-provider</code>
</td>
<td align="left">
The <code class="literal">pppoeconf</code> generated configuration file for <code class="literal">pppd</code> specific to <code class="literal">pppoe</code>
</td>
</tr>
<tr>
<td align="left">
<code class="literal">/etc/ppp/options</code>
</td>
<td align="left">
The general execution parameter for <code class="literal">pppd</code>
</td>
</tr>
<tr>
<td align="left">
<code class="literal">/etc/ppp/pap-secret</code>
</td>
<td align="left">
Authentication data for the <a class="ulink" href="http://en.wikipedia.org/wiki/Password_authentication_protocol" target="_top">PAP</a> (security risk)
</td>
</tr>
<tr>
<td align="left">
<code class="literal">/etc/ppp/chap-secret</code>
</td>
<td align="left">
Authentication data for the <a class="ulink" href="http://en.wikipedia.org/wiki/Challenge-handshake_authentication_protocol" target="_top">CHAP</a> (more secure)
</td>
</tr>
</tbody>
</table></div>
</div>
<br class="table-break"><p>You can test configuration using low level network configuration tools as the following.</p>
<pre class="screen">$ sudo /sbin/ifconfig eth0 up
$ sudo pon dsl-provider
...
$ sudo poff dsl-provider
$ sudo /sbin/ifconfig eth0 down</pre>
<p>See "<code class="literal">/usr/share/doc/pppoeconf/README.Debian</code>".</p>
</div>
</div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="_the_basic_network_configuration_with_ifupdown_legacy"></a>5.5. The basic network configuration with ifupdown (legacy)</h2></div></div></div>
<p>The traditional <a class="ulink" href="http://en.wikipedia.org/wiki/Internet_Protocol_Suite" target="_top">TCP/IP network</a> setup on Debian system uses <code class="literal">ifupdown</code> package as a high level tool. There are 2 typical cases.</p>
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
<li class="listitem"><p>
For <span class="strong"><strong>dynamic IP</strong></span> system such as mobile PCs, you should setup TCP/IP network <span class="strong"><strong>with</strong></span> the <code class="literal">resolvconf</code> package and enable you to switch your network configuration easily (see <a class="xref" href="ch05.en.html#_the_network_interface_served_by_the_dhcp" title="5.5.4. The network interface served by the DHCP">Section 5.5.4, “The network interface served by the DHCP”</a>).
</p></li>
<li class="listitem"><p>
For <span class="strong"><strong>static IP</strong></span> system such as servers, you should setup TCP/IP network <span class="strong"><strong>without</strong></span> the <code class="literal">resolvconf</code> package and keep your system simple (see <a class="xref" href="ch05.en.html#_the_network_interface_with_the_static_ip" title="5.5.5. The network interface with the static IP">Section 5.5.5, “The network interface with the static IP”</a>).
</p></li>
</ul></div>
<p>These traditional setup methods are quite useful if you wish to set up advanced configuration (see <a class="xref" href="ch05.en.html#_the_basic_network_configuration_with_ifupdown_legacy" title="5.5. The basic network configuration with ifupdown (legacy)">Section 5.5, “The basic network configuration with ifupdown (legacy)”</a>).</p>
<p>The <code class="literal">ifupdown</code> package provides the standardized framework for the high level network configuration in the Debian system. In this section, we learn the basic network configuration with <code class="literal">ifupdown</code> with simplified introduction and many typical examples.</p>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="_the_command_syntax_simplified"></a>5.5.1. The command syntax simplified</h3></div></div></div>
<p>The <code class="literal">ifupdown</code> package contains 2 commands: <span class="citerefentry"><span class="refentrytitle">ifup</span>(8)</span> and <span class="citerefentry"><span class="refentrytitle">ifdown</span>(8)</span>. They offer high level network configuration dictated by the configuration file "/etc/network/interfaces".</p>
<div class="table">
<a name="listofbasicnetwoandswithifupdown"></a><p class="title"><b>Table 5.9. List of basic network configuration commands with ifupdown</b></p>
<div class="table-contents"><table summary="List of basic network configuration commands with ifupdown" border="1">
<colgroup>
<col align="left">
<col align="left">
</colgroup>
<thead><tr>
<th align="left">
command
</th>
<th align="left">
action
</th>
</tr></thead>
<tbody>
<tr>
<td align="left">
<code class="literal">ifup eth0</code>
</td>
<td align="left">
bring up a network interface <code class="literal">eth0</code> with the configuration <code class="literal">eth0</code> if "<code class="literal">iface eth0</code>" stanza exists
</td>
</tr>
<tr>
<td align="left">
<code class="literal">ifdown eth0</code>
</td>
<td align="left">
bring down a network interface <code class="literal">eth0</code> with the configuration <code class="literal">eth0</code> if "<code class="literal">iface eth0</code>" stanza exists
</td>
</tr>
</tbody>
</table></div>
</div>
<br class="table-break"><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Warning">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Warning]" src="images/warning.png"></td>
<th align="left">Warning</th>
</tr>
<tr><td align="left" valign="top"><p>Do not use low level configuration tools such as <span class="citerefentry"><span class="refentrytitle">ifconfig</span>(8)</span> and <span class="citerefentry"><span class="refentrytitle">ip</span>(8)</span> commands to configure an interface in <span class="strong"><strong>up</strong></span> state.</p></td></tr>
</table></div>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td>
<th align="left">Note</th>
</tr>
<tr><td align="left" valign="top"><p>There is no command <code class="literal">ifupdown</code>.</p></td></tr>
</table></div>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="_the_basic_syntax_of_etc_network_interfaces"></a>5.5.2. The basic syntax of "/etc/network/interfaces"</h3></div></div></div>
<p>The key syntax of "<code class="literal">/etc/network/interfaces</code>" as explained in <span class="citerefentry"><span class="refentrytitle">interfaces</span>(5)</span> can be summarized as the following.</p>
<div class="table">
<a name="list-of-stanzas-in-eni"></a><p class="title"><b>Table 5.10. List of stanzas in "<code class="literal">/etc/network/interfaces</code>"</b></p>
<div class="table-contents"><table summary='List of stanzas in "/etc/network/interfaces"' border="1">
<colgroup>
<col align="left">
<col align="left">
</colgroup>
<thead><tr>
<th align="left">
stanza
</th>
<th align="left">
meaning
</th>
</tr></thead>
<tbody>
<tr>
<td align="left">
"<code class="literal">auto &lt;interface_name&gt;</code>"
</td>
<td align="left">
start interface &lt;interface_name&gt; upon start of the system
</td>
</tr>
<tr>
<td align="left">
"<code class="literal">allow-auto &lt;interface_name&gt;</code>"
</td>
<td align="left">
, ,
</td>
</tr>
<tr>
<td align="left">
"<code class="literal">allow-hotplug &lt;interface_name&gt;</code>"
</td>
<td align="left">
start interface &lt;interface_name&gt; when the kernel detects a hotplug event from the interface
</td>
</tr>
<tr>
<td align="left">
Lines started with "<code class="literal">iface &lt;config_name&gt;</code>"
</td>
<td align="left">
define the network configuration &lt;config_name&gt;
</td>
</tr>
<tr>
<td align="left">
Lines started with "<code class="literal">mapping &lt;interface_name_glob&gt; </code>"
</td>
<td align="left">
define mapping value of &lt;config_name&gt; for the matching &lt;interface_name&gt;
</td>
</tr>
<tr>
<td align="left">
A line starting with a hash "<code class="literal">#</code>"
</td>
<td align="left">
ignore as comments (end-of-line comments are <span class="strong"><strong>not</strong></span> supported)
</td>
</tr>
<tr>
<td align="left">
A line ending with a backslash "<code class="literal">\</code>"
</td>
<td align="left">
extend the configuration to the next line
</td>
</tr>
</tbody>
</table></div>
</div>
<br class="table-break"><p>Lines started with <span class="strong"><strong><code class="literal">iface</code></strong></span> stanza has the following syntax.</p>
<pre class="screen">iface &lt;config_name&gt; &lt;address_family&gt; &lt;method_name&gt;
&lt;option1&gt; &lt;value1&gt;
&lt;option2&gt; &lt;value2&gt;
...</pre>
<p>For the basic configuration, the <span class="strong"><strong><code class="literal">mapping</code></strong></span> stanza is not used and you use the network interface name as the network configuration name (See <a class="xref" href="ch05.en.html#_the_mapping_stanza" title="5.6.5. The mapping stanza">Section 5.6.5, “The mapping stanza”</a>).</p>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Warning">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Warning]" src="images/warning.png"></td>
<th align="left">Warning</th>
</tr>
<tr><td align="left" valign="top"><p>Do not define duplicates of the "<code class="literal">iface</code>" stanza for a network interface in "<code class="literal">/etc/network/interfaces</code>".</p></td></tr>
</table></div>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="_the_loopback_network_interface"></a>5.5.3. The loopback network interface</h3></div></div></div>
<p>The following configuration entry in the "<code class="literal">/etc/network/interfaces</code>" file brings up the loopback network interface <code class="literal">lo</code> upon booting the system (via <span class="strong"><strong><code class="literal">auto</code></strong></span> stanza).</p>
<pre class="screen">auto lo
iface lo inet loopback</pre>
<p>This one always exists in the "<code class="literal">/etc/network/interfaces</code>" file.</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="_the_network_interface_served_by_the_dhcp"></a>5.5.4. The network interface served by the DHCP</h3></div></div></div>
<p>After preparing the system by <a class="xref" href="ch05.en.html#_the_dhcp_connection_with_the_ethernet" title="5.4.1. The DHCP connection with the Ethernet">Section 5.4.1, “The DHCP connection with the Ethernet”</a>, the network interface served by the DHCP is configured by creating the configuration entry in the "<code class="literal">/etc/network/interfaces</code>" file as the following.</p>
<pre class="screen">allow-hotplug eth0
iface eth0 inet dhcp</pre>
<p>When the Linux kernel detects the physical interface <code class="literal">eth0</code>, the <span class="strong"><strong><code class="literal">allow-hotplug</code></strong></span> stanza causes <code class="literal">ifup</code> to bring up the interface and the <span class="strong"><strong><code class="literal">iface</code></strong></span> stanza causes <code class="literal">ifup</code> to use DHCP to configure the interface.</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="_the_network_interface_with_the_static_ip"></a>5.5.5. The network interface with the static IP</h3></div></div></div>
<p>The network interface served by the static IP is configured by creating the configuration entry in the "<code class="literal">/etc/network/interfaces</code>" file as the following.</p>
<pre class="screen">allow-hotplug eth0
iface eth0 inet static
address 192.168.11.100
netmask 255.255.255.0
gateway 192.168.11.1
dns-domain example.com
dns-nameservers 192.168.11.1</pre>
<p>When the Linux kernel detects the physical interface <code class="literal">eth0</code>, the <span class="strong"><strong><code class="literal">allow-hotplug</code></strong></span> stanza causes <code class="literal">ifup</code> to bring up the interface and the <span class="strong"><strong><code class="literal">iface</code></strong></span> stanza causes <code class="literal">ifup</code> to use the static IP to configure the interface.</p>
<p>Here, I assumed the following.</p>
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
<li class="listitem"><p>
IP address range of the LAN network: <code class="literal">192.168.11.0</code> - <code class="literal">192.168.11.255</code>
</p></li>
<li class="listitem"><p>
IP address of the gateway: <code class="literal">192.168.11.1</code>
</p></li>
<li class="listitem"><p>
IP address of the PC: <code class="literal">192.168.11.100</code>
</p></li>
<li class="listitem"><p>
The <code class="literal">resolvconf</code> package: installed
</p></li>
<li class="listitem"><p>
The domain name: "<code class="literal">example.com</code>"
</p></li>
<li class="listitem"><p>
IP address of the DNS server: <code class="literal">192.168.11.1</code>
</p></li>
</ul></div>
<p>When the <code class="literal">resolvconf</code> package is not installed, DNS related configuration needs to be done manually by editing the "<code class="literal">/etc/resolv.conf</code>" as the following.</p>
<pre class="screen">nameserver 192.168.11.1
domain example.com</pre>
<div class="caution" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Caution">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Caution]" src="images/caution.png"></td>
<th align="left">Caution</th>
</tr>
<tr><td align="left" valign="top"><p>The IP addresses used in the above example are not meant to be copied literally. You have to adjust IP numbers to your actual network configuration.</p></td></tr>
</table></div>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="_the_basics_of_wireless_lan_interface"></a>5.5.6. The basics of wireless LAN interface</h3></div></div></div>
<p>The <a class="ulink" href="http://en.wikipedia.org/wiki/Wireless_LAN" target="_top">wireless LAN (WLAN for short)</a> provides the fast wireless connectivity through the spread-spectrum communication of unlicensed radio bands based on the set of standards called <a class="ulink" href="http://en.wikipedia.org/wiki/IEEE_802.11" target="_top">IEEE 802.11</a>.</p>
<p>The WLAN interfaces are almost like normal Ethernet interfaces but require some network ID and encryption key data to be provided when they are initialized. Their high level network tools are exactly the same as that of Ethernet interfaces except interface names are a bit different like <code class="literal">eth1</code>, <code class="literal">wlan0</code>, <code class="literal">ath0</code>, <code class="literal">wifi0</code>, … depending on the kernel drivers used.</p>
<div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Tip">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Tip]" src="images/tip.png"></td>
<th align="left">Tip</th>
</tr>
<tr><td align="left" valign="top"><p>The <code class="literal">wmaster0</code> device is the master device which is an internal device used only by <a class="ulink" href="http://en.wikipedia.org/wiki/SoftMAC" target="_top">SoftMAC</a> with new <a class="ulink" href="http://linuxwireless.org/" target="_top">mac80211 API of Linux</a>.</p></td></tr>
</table></div>
<p>Here are some keywords to remember for the WLAN.</p>
<div class="table">
<a name="listofacronymsforwlan"></a><p class="title"><b>Table 5.11. List of acronyms for WLAN</b></p>
<div class="table-contents"><table summary="List of acronyms for WLAN" border="1">
<colgroup>
<col align="left">
<col align="left">
<col align="left">
</colgroup>
<thead><tr>
<th align="left">
acronym
</th>
<th align="left">
full word
</th>
<th align="left">
meaning
</th>
</tr></thead>
<tbody>
<tr>
<td align="left">
NWID
</td>
<td align="left">
Network ID
</td>
<td align="left">
16 bit network ID used by pre-802.11 <a class="ulink" href="http://en.wikipedia.org/wiki/WaveLAN" target="_top">WaveLAN</a> network (very deprecated)
</td>
</tr>
<tr>
<td align="left">
(E)SSID
</td>
<td align="left">
(Extended) <a class="ulink" href="http://en.wikipedia.org/wiki/Service_set_identifier" target="_top">Service Set Identifier</a>
</td>
<td align="left">
network name of the <a class="ulink" href="http://en.wikipedia.org/wiki/Wireless_access_point" target="_top">Wireless Access Points (APs)</a> interconnected to form an integrated <a class="ulink" href="http://en.wikipedia.org/wiki/IEEE_802.11" target="_top">802.11 wireless LAN</a>, Domain ID
</td>
</tr>
<tr>
<td align="left">
WEP, (WEP2)
</td>
<td align="left">
<a class="ulink" href="http://en.wikipedia.org/wiki/Wired_Equivalent_Privacy" target="_top">Wired Equivalent Privacy</a>
</td>
<td align="left">
1st generation 64-bit (128-bit) wireless encryption standard with 40-bit key (deprecated)
</td>
</tr>
<tr>
<td align="left">
WPA
</td>
<td align="left">
<a class="ulink" href="http://en.wikipedia.org/wiki/Wi-Fi_Protected_Access" target="_top">Wi-Fi Protected Access</a>
</td>
<td align="left">
2nd generation wireless encryption standard (most of 802.11i), compatible with WEP
</td>
</tr>
<tr>
<td align="left">
WPA2
</td>
<td align="left">
<a class="ulink" href="http://en.wikipedia.org/wiki/IEEE_802.11i" target="_top">Wi-Fi Protected Access 2</a>
</td>
<td align="left">
3rd generation wireless encryption standard (full 802.11i), non-compatible with WEP
</td>
</tr>
</tbody>
</table></div>
</div>
<br class="table-break"><p>The actual choice of protocol is usually limited by the wireless router you deploy.</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="_the_wireless_lan_interface_with_wpa_wpa2"></a>5.5.7. The wireless LAN interface with WPA/WPA2</h3></div></div></div>
<p>You need to install the <code class="literal">wpasupplicant</code> package to support the WLAN with the new WPA/WPA2.</p>
<p>In case of the <a class="ulink" href="http://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol" target="_top">DHCP</a> served IP on WLAN connection, the "<code class="literal">/etc/network/interfaces</code>" file entry should be as the following.</p>
<pre class="screen">allow-hotplug ath0
iface ath0 inet dhcp
wpa-ssid homezone
# hexadecimal psk is encoded from a plaintext passphrase
wpa-psk 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f</pre>
<p>See "<code class="literal">/usr/share/doc/wpasupplicant/README.modes.gz</code>".</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="_the_wireless_lan_interface_with_wep"></a>5.5.8. The wireless LAN interface with WEP</h3></div></div></div>
<p>You need to install the <code class="literal">wireless-tools</code> package to support the WLAN with the old WEP. (Your consumer grade router may still be using this insecure infrastructure but this is better than nothing.)</p>
<div class="caution" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Caution">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Caution]" src="images/caution.png"></td>
<th align="left">Caution</th>
</tr>
<tr><td align="left" valign="top"><p>Please note that your network traffic on WLAN with WEP may be sniffed by others.</p></td></tr>
</table></div>
<p>In case of the <a class="ulink" href="http://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol" target="_top">DHCP</a> served IP on WLAN connection, the "<code class="literal">/etc/network/interfaces</code>" file entry should be as the following.</p>
<pre class="screen">allow-hotplug eth0
iface eth0 inet dhcp
wireless-essid Home
wireless-key1 0123-4567-89ab-cdef
wireless-key2 12345678
wireless-key3 s:password
wireless-defaultkey 2
wireless-keymode open</pre>
<p>See "<code class="literal">/usr/share/doc/wireless-tools/README.Debian</code>".</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="_the_ppp_connection"></a>5.5.9. The PPP connection</h3></div></div></div>
<p>You need to configure the PPP connection first as described before (see <a class="xref" href="ch05.en.html#_the_ppp_connection_with_pppconfig" title="5.4.3. The PPP connection with pppconfig">Section 5.4.3, “The PPP connection with pppconfig”</a>). Then, add the "<code class="literal">/etc/network/interfaces</code>" file entry for the primary PPP device <code class="literal">ppp0</code> as the following.</p>
<pre class="screen">iface ppp0 inet ppp
provider &lt;isp_name&gt;</pre>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="_the_alternative_ppp_connection"></a>5.5.10. The alternative PPP connection</h3></div></div></div>
<p>You need to configure the alternative PPP connection with <code class="literal">wvdial</code> first as described before (see <a class="xref" href="ch05.en.html#_the_alternative_ppp_connection_with_wvdialconf" title="5.4.4. The alternative PPP connection with wvdialconf">Section 5.4.4, “The alternative PPP connection with wvdialconf”</a>). Then, add the "<code class="literal">/etc/network/interfaces</code>" file entry for the primary PPP device <code class="literal">ppp0</code> as the following.</p>
<pre class="screen">iface ppp0 inet wvdial</pre>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="_the_pppoe_connection"></a>5.5.11. The PPPoE connection</h3></div></div></div>
<p>For PC connected directly to the WAN served by the PPPoE, you need to configure system with the PPPoE connection as described before (see <a class="xref" href="ch05.en.html#_the_pppoe_connection_with_pppoeconf" title="5.4.5. The PPPoE connection with pppoeconf">Section 5.4.5, “The PPPoE connection with pppoeconf”</a>). Then, add the "<code class="literal">/etc/network/interfaces</code>" file entry for the primary PPPoE device <code class="literal">eth0</code> as the following.</p>
<pre class="screen">allow-hotplug eth0
iface eth0 inet manual
pre-up /sbin/ifconfig eth0 up
up ifup ppp0=dsl
down ifdown ppp0=dsl
post-down /sbin/ifconfig eth0 down
# The following is used internally only
iface dsl inet ppp
provider dsl-provider</pre>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="_the_network_configuration_state_of_ifupdown"></a>5.5.12. The network configuration state of ifupdown</h3></div></div></div>
<p>The "<code class="literal">/etc/network/run/ifstate</code>" file stores the <span class="strong"><strong>intended</strong></span> network configuration states for all the currently active network interfaces managed by the <code class="literal">ifupdown</code> package are listed. Unfortunately, even if the <code class="literal">ifupdown</code> system fails to bring up the interface as intended, the "<code class="literal">/etc/network/run/ifstate</code>" file lists it active.</p>
<p>Unless the output of the <span class="citerefentry"><span class="refentrytitle">ifconfig</span>(8)</span> command for an interface does not have a line like following example, it can not be used as a part of <a class="ulink" href="http://en.wikipedia.org/wiki/IPv4" target="_top">IPV4 network</a>.</p>
<pre class="screen"> inet addr:192.168.11.2 Bcast:192.168.11.255 Mask:255.255.255.0</pre>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td>
<th align="left">Note</th>
</tr>
<tr><td align="left" valign="top"><p>For the Ethernet device connected to the PPPoE, the output of the <span class="citerefentry"><span class="refentrytitle">ifconfig</span>(8)</span> command lacks a line which looks like above example.</p></td></tr>
</table></div>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="_the_basic_network_reconfiguration"></a>5.5.13. The basic network reconfiguration</h3></div></div></div>
<p>When you try to reconfigure the interface, e.g. <code class="literal">eth0</code>, you must disable it first with the "<span class="strong"><strong><code class="literal">sudo ifdown eth0</code></strong></span>" command. This removes the entry of <code class="literal">eth0</code> from the "<code class="literal">/etc/network/run/ifstate</code>" file. (This may result in some error message if <code class="literal">eth0</code> is not active or it is configured improperly previously. So far, it seems to be safe to do this for the simple single user work station at any time.)</p>
<p>You are now free to rewrite the "<code class="literal">/etc/network/interfaces</code>" contents as needed to reconfigure the network interface, <code class="literal">eth0</code>.</p>
<p>Then, you can reactivate <code class="literal">eth0</code> with the "<span class="strong"><strong><code class="literal">sudo ifup eth0</code></strong></span>" command.</p>
<div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Tip">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Tip]" src="images/tip.png"></td>
<th align="left">Tip</th>
</tr>
<tr><td align="left" valign="top"><p>You can (re)initialize the network interface simply by "<span class="strong"><strong><code class="literal">sudo ifdown eth0;sudo ifup eth0</code></strong></span>".</p></td></tr>
</table></div>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="_the_ifupdown_extra_package"></a>5.5.14. The ifupdown-extra package</h3></div></div></div>
<p>The <code class="literal">ifupdown-extra</code> package provides easy network connection tests for use with the <code class="literal">ifupdown</code> package.</p>
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
<li class="listitem"><p>
The <span class="citerefentry"><span class="refentrytitle">network-test</span>(1)</span> command can be used from the shell.
</p></li>
<li class="listitem"><p>
The automatic scripts are run for each <code class="literal">ifup</code> command execution.
</p></li>
</ul></div>
<p>The <code class="literal">network-test</code> command frees you from the execution of cumbersome low level commands to analyze the network problem.</p>
<p>The automatic scripts are installed in "<code class="literal">/etc/network/*/</code>" and performs the following.</p>
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
<li class="listitem"><p>
Check the network cable connection
</p></li>
<li class="listitem"><p>
Check duplicate use of IP address
</p></li>
<li class="listitem"><p>
Setup system's static routes based on the "<code class="literal">/etc/network/routes</code>" definition
</p></li>
<li class="listitem"><p>
Check if network gateway is reachable
</p></li>
<li class="listitem"><p>
Record results in the "<code class="literal">/var/log/syslog</code>" file
</p></li>
</ul></div>
<p>This syslog record is quite useful for administration of the network problem on the remote system.</p>
<div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Tip">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Tip]" src="images/tip.png"></td>
<th align="left">Tip</th>
</tr>
<tr><td align="left" valign="top"><p>The automatic behavior of the <code class="literal">ifupdown-extra</code> package is configurable with the "<code class="literal">/etc/default/network-test</code>". Some of these automatic checks slow down the system boot-up a little bit since it takes some time to listen for <a class="ulink" href="http://en.wikipedia.org/wiki/Address_Resolution_Protocol" target="_top">ARP</a> replies.</p></td></tr>
</table></div>
</div>
</div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="_the_advanced_network_configuration_with_ifupdown_legacy"></a>5.6. The advanced network configuration with ifupdown (legacy)</h2></div></div></div>
<p>The functionality of the <code class="literal">ifupdown</code> package can be improved beyond what was described in <a class="xref" href="ch05.en.html#_the_basic_network_configuration_with_ifupdown_legacy" title="5.5. The basic network configuration with ifupdown (legacy)">Section 5.5, “The basic network configuration with ifupdown (legacy)”</a> with the advanced knowledge.</p>
<p>The functionalities described here are completely optional. I, being lazy and minimalist, rarely bother to use these.</p>
<div class="caution" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Caution">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Caution]" src="images/caution.png"></td>
<th align="left">Caution</th>
</tr>
<tr><td align="left" valign="top"><p>If you could not set up network connection by information in <a class="xref" href="ch05.en.html#_the_basic_network_configuration_with_ifupdown_legacy" title="5.5. The basic network configuration with ifupdown (legacy)">Section 5.5, “The basic network configuration with ifupdown (legacy)”</a>, you make situation worse by using information below.</p></td></tr>
</table></div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="_the_ifplugd_package"></a>5.6.1. The ifplugd package</h3></div></div></div>
<p>The <code class="literal">ifplugd</code> package is older automatic network configuration tool which can manage only Ethernet connections. This solves unplugged/replugged Ethernet cable issues for mobile PC etc. If you have <a class="ulink" href="http://en.wikipedia.org/wiki/NetworkManager" target="_top">NetworkManager</a> or <a class="ulink" href="http://en.wikipedia.org/wiki/Wicd_(Linux_Network_Manager)" target="_top">Wicd</a> (see <a class="xref" href="ch05.en.html#_the_modern_network_configuration_for_desktop" title="5.2. The modern network configuration for desktop">Section 5.2, “The modern network configuration for desktop”</a>) installed, you do not need this package.</p>
<p>This package runs <a class="ulink" href="http://en.wikipedia.org/wiki/Daemon_(computer_software)" target="_top">daemon</a> and replaces <span class="strong"><strong>auto</strong></span> or <span class="strong"><strong>allow-hotplug</strong></span> functionalities (see <a class="xref" href="ch05.en.html#list-of-stanzas-in-eni" title='Table 5.10. List of stanzas in "/etc/network/interfaces"'>Table 5.10, “List of stanzas in "<code class="literal">/etc/network/interfaces</code>"”</a>) and starts interfaces upon their connection to the network.</p>
<p>Here is how to use the <code class="literal">ifplugd</code> package for the internal Ethernet port, e.g. <code class="literal">eth0</code>.</p>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem"><p>
Remove stanza in "<code class="literal">/etc/network/interfaces</code>": "<code class="literal">auto eth0</code>" or "<code class="literal">allow-hotplug eth0</code>".
</p></li>
<li class="listitem"><p>
Keep stanza in "<code class="literal">/etc/network/interfaces</code>": "<code class="literal">iface eth0 inet …</code>" and "<code class="literal">mapping …</code>".
</p></li>
<li class="listitem"><p>
Install the <code class="literal">ifplugd</code> package.
</p></li>
<li class="listitem"><p>
Run "<code class="literal">sudo dpkg-reconfigure ifplugd</code>".
</p></li>
<li class="listitem"><p>
Put <code class="literal">eth0</code> as the "static interfaces to be watched by ifplugd".
</p></li>
</ol></div>
<p>Now, the network reconfiguration works as you desire.</p>
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
<li class="listitem">
<p>
Upon power-on or upon hardware discovery, the interface is not brought up by itself.
</p>
<div class="itemizedlist"><ul class="itemizedlist" type="circle">
<li class="listitem"><p>
Quick boot process without the long DHCP timeout.
</p></li>
<li class="listitem"><p>
No funny activated interface without proper IPv4 address (see <a class="xref" href="ch05.en.html#_the_network_configuration_state_of_ifupdown" title="5.5.12. The network configuration state of ifupdown">Section 5.5.12, “The network configuration state of ifupdown”</a>).
</p></li>
</ul></div>
</li>
<li class="listitem"><p>
Upon finding the Ethernet cable, the interface is brought up.
</p></li>
<li class="listitem"><p>
Upon some time after unplugging the Ethernet cable, the interface is brought down automatically.
</p></li>
<li class="listitem"><p>
Upon plugging in another Ethernet cable, the interface is brought up under the new network environment.
</p></li>
</ul></div>
<div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Tip">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Tip]" src="images/tip.png"></td>
<th align="left">Tip</th>
</tr>
<tr><td align="left" valign="top"><p>The arguments for the <span class="citerefentry"><span class="refentrytitle">ifplugd</span>(8)</span> command can set its behaviors such as the delay for reconfiguring interfaces.</p></td></tr>
</table></div>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="_the_ifmetric_package"></a>5.6.2. The ifmetric package</h3></div></div></div>
<p>The <code class="literal">ifmeric</code> package enables us to manipulate metrics of routes a posteriori even for DHCP.</p>
<p>The following sets the <code class="literal">eth0</code> interface to be preferred over the <code class="literal">wlan0</code> interface.</p>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem"><p>
Install the <code class="literal">ifmetric</code> package.
</p></li>
<li class="listitem"><p>
Add an option line with "<code class="literal">metric 0</code>" just below the "<code class="literal">iface eth0 inet dhcp</code>" line.
</p></li>
<li class="listitem"><p>
Add an option line with "<code class="literal">metric 1</code>" just below the "<code class="literal">iface wlan0 inet dhcp</code>" line.
</p></li>
</ol></div>
<p>The metric 0 means the highest priority route and is the default one. The larger metric value means lower priority routes. The IP address of the active interface with the lowest metric value becomes the originating one. See <span class="citerefentry"><span class="refentrytitle">ifmetric</span>(8)</span>.</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="_the_virtual_interface"></a>5.6.3. The virtual interface</h3></div></div></div>
<p>A single physical Ethernet interface can be configured as multiple virtual interfaces with different IP addresses. Usually the purpose is to connect an interface to several IP subnetworks. For example, IP address based virtual web hosting by a single network interface is one such application.</p>
<p>For example, let's suppose the following.</p>
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
<li class="listitem"><p>
A single Ethernet interface on your host is connected to a Ethernet hub (not to the broadband router).
</p></li>
<li class="listitem"><p>
The Ethernet hub is connected to both the Internet and LAN network.
</p></li>
<li class="listitem"><p>
The LAN network uses subnet <code class="literal">192.168.0.x/24</code>.
</p></li>
<li class="listitem"><p>
Your host uses DHCP served IP address with the physical interface <code class="literal">eth0</code> for the Internet.
</p></li>
<li class="listitem"><p>
Your host uses <code class="literal">192.168.0.1</code> with the virtual interface <code class="literal">eth0:0</code> for the LAN.
</p></li>
</ul></div>
<p>The following stanzas in "<code class="literal">/etc/network/interfaces</code>" configure your network.</p>
<pre class="screen">iface eth0 inet dhcp
metric 0
iface eth0:0 inet static
address 192.168.0.1
netmask 255.255.255.0
network 192.168.0.0
metric 1</pre>
<div class="caution" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Caution">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Caution]" src="images/caution.png"></td>
<th align="left">Caution</th>
</tr>
<tr><td align="left" valign="top"><p>Although this configuration example with <a class="ulink" href="http://en.wikipedia.org/wiki/Network_address_translation" target="_top">network address translation (NAT)</a> using <a class="ulink" href="http://en.wikipedia.org/wiki/Netfilter" target="_top">netfilter/iptables</a> (see <a class="xref" href="ch05.en.html#_netfilter_infrastructure" title="5.9. Netfilter infrastructure">Section 5.9, “Netfilter infrastructure”</a>) can provide cheap router for the LAN with only single interface, there is no real firewall capability with such set up. You should use 2 physical interfaces with NAT to secure the local network from the Internet.</p></td></tr>
</table></div>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="_the_advanced_command_syntax"></a>5.6.4. The advanced command syntax</h3></div></div></div>
<p>The <code class="literal">ifupdown</code> package offers advanced network configuration using the <span class="strong"><strong>network configuration</strong></span> name and the <span class="strong"><strong>network interface</strong></span> name. I use slightly different terminology from one used in <span class="citerefentry"><span class="refentrytitle">ifup</span>(8)</span> and <span class="citerefentry"><span class="refentrytitle">interfaces</span>(5)</span>.</p>
<div class="table">
<a name="listofterminologornetworkdevices"></a><p class="title"><b>Table 5.12. List of terminology for network devices</b></p>
<div class="table-contents"><table summary="List of terminology for network devices" border="1">
<colgroup>
<col align="left">
<col align="left">
<col align="left">
<col align="left">
</colgroup>
<thead><tr>
<th align="left">
manpage terminology
</th>
<th align="left">
my terminology
</th>
<th align="left">
examples in the following text
</th>
<th align="left">
description
</th>
</tr></thead>
<tbody>
<tr>
<td align="left">
<span class="strong"><strong>physical interface</strong></span> name
</td>
<td align="left">
<span class="strong"><strong>network interface</strong></span> name
</td>
<td align="left">
<code class="literal">lo</code>, <code class="literal">eth0</code>, <code class="literal">&lt;interface_name&gt;</code>
</td>
<td align="left">
name given by the Linux kernel (using <code class="literal">udev</code> mechanism)
</td>
</tr>
<tr>
<td align="left">
<span class="strong"><strong>logical interface</strong></span> name
</td>
<td align="left">
<span class="strong"><strong>network configuration</strong></span> name
</td>
<td align="left">
<code class="literal">config1</code>, <code class="literal">config2</code>, <code class="literal">&lt;config_name&gt;</code>
</td>
<td align="left">
name token following <span class="strong"><strong><code class="literal">iface</code></strong></span> in the "<code class="literal">/etc/network/interfaces</code>"
</td>
</tr>
</tbody>
</table></div>
</div>
<br class="table-break"><p>Basic network configuration commands in <a class="xref" href="ch05.en.html#_the_command_syntax_simplified" title="5.5.1. The command syntax simplified">Section 5.5.1, “The command syntax simplified”</a> require the <span class="strong"><strong>network configuration</strong></span> name token of the <span class="strong"><strong><code class="literal">iface</code></strong></span> stanza to match the <span class="strong"><strong>network interface</strong></span> name in the "<code class="literal">/etc/network/interfaces</code>".</p>
<p>Advanced network configuration commands enables separation of the <span class="strong"><strong>network configuration</strong></span> name and the <span class="strong"><strong>network interface</strong></span> name in the "<code class="literal">/etc/network/interfaces</code>" as the following.</p>
<div class="table">
<a name="listofadvancedneandswithifupdown"></a><p class="title"><b>Table 5.13. List of advanced network configuration commands with ifupdown</b></p>
<div class="table-contents"><table summary="List of advanced network configuration commands with ifupdown" border="1">
<colgroup>
<col align="left">
<col align="left">
</colgroup>
<thead><tr>
<th align="left">
command
</th>
<th align="left">
action
</th>
</tr></thead>
<tbody>
<tr>
<td align="left">
<code class="literal">ifup eth0=config1</code>
</td>
<td align="left">
bring up a network interface <code class="literal">eth0</code> with the configuration <code class="literal">config1</code>
</td>
</tr>
<tr>
<td align="left">
<code class="literal">ifdown eth0=config1</code>
</td>
<td align="left">
bring down a network interface <code class="literal">eth0</code> with the configuration <code class="literal">config1</code>
</td>
</tr>
<tr>
<td align="left">
<code class="literal">ifup eth0</code>
</td>
<td align="left">
bring up a network interface <code class="literal">eth0</code> with the configuration selected by <span class="strong"><strong><code class="literal">mapping</code></strong></span> stanza
</td>
</tr>
<tr>
<td align="left">
<code class="literal">ifdown eth0</code>
</td>
<td align="left">
bring down a network interface <code class="literal">eth0</code> with the configuration selected by <span class="strong"><strong><code class="literal">mapping</code></strong></span> stanza
</td>
</tr>
</tbody>
</table></div>
</div>
<br class="table-break">
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="_the_mapping_stanza"></a>5.6.5. The mapping stanza</h3></div></div></div>
<p>We skipped explaining the <span class="strong"><strong><code class="literal">mapping</code></strong></span> stanza in the "<code class="literal">/etc/network/interfaces</code>" in <a class="xref" href="ch05.en.html#_the_basic_syntax_of_etc_network_interfaces" title='5.5.2. The basic syntax of "/etc/network/interfaces"'>Section 5.5.2, “The basic syntax of "/etc/network/interfaces"”</a> to avoid complication. This stanza has the following syntax.</p>
<pre class="screen">mapping &lt;interface_name_glob&gt;
script &lt;script_name&gt;
map &lt;script_input1&gt;
map &lt;script_input2&gt;
map ...</pre>
<p>This provides advanced feature to the "<code class="literal">/etc/network/interfaces</code>" file by automating the choice of the configuration with the mapping script specified by <code class="literal">&lt;script_name&gt;</code>.</p>
<p>Let's follow the execution of the following.</p>
<pre class="screen">$ sudo ifup eth0</pre>
<p>When the "<code class="literal">&lt;interface_name_glob&gt;</code>" matches "<code class="literal">eth0</code>", this execution produces the execution of the following command to configure <code class="literal">eth0</code> automatically.</p>
<pre class="screen">$ sudo ifup eth0=$(echo -e '&lt;script_input1&gt; \n &lt;script_input2&gt; \n ...' | &lt;script_name&gt; eth0)</pre>
<p>Here, script input lines with "<code class="literal">map</code>" are optional and can be repeated.</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td>
<th align="left">Note</th>
</tr>
<tr><td align="left" valign="top"><p>The glob for <span class="strong"><strong><code class="literal">mapping</code></strong></span> stanza works like shell filename glob (see <a class="xref" href="ch01.en.html#_shell_glob" title="1.5.6. Shell glob">Section 1.5.6, “Shell glob”</a>).</p></td></tr>
</table></div>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="_the_manually_switchable_network_configuration"></a>5.6.6. The manually switchable network configuration</h3></div></div></div>
<p>Here is how to switch manually among several network configurations without rewriting the "<code class="literal">/etc/network/interfaces</code>" file as in <a class="xref" href="ch05.en.html#_the_basic_network_reconfiguration" title="5.5.13. The basic network reconfiguration">Section 5.5.13, “The basic network reconfiguration”</a> .</p>
<p>For all the network configuration you need to access, you create a single "<code class="literal">/etc/network/interfaces</code>" file as the following.</p>
<pre class="screen">auto lo
iface lo inet loopback
iface config1 inet dhcp
iface config2 inet static
address 192.168.11.100
netmask 255.255.255.0
gateway 192.168.11.1
dns-domain example.com
dns-nameservers 192.168.11.1
iface pppoe inet manual
pre-up /sbin/ifconfig eth0 up
up ifup ppp0=dsl
down ifdown ppp0=dsl
post-down /sbin/ifconfig eth0 down
# The following is used internally only
iface dsl inet ppp
provider dsl-provider
iface pots inet ppp
provider provider</pre>
<p>Please note the <span class="strong"><strong>network configuration name</strong></span> which is the token after <span class="strong"><strong><code class="literal">iface</code></strong></span> does not use the token for the <span class="strong"><strong>network interface name</strong></span>. Also, there are no <span class="strong"><strong><code class="literal">auto</code></strong></span> stanza nor <span class="strong"><strong><code class="literal">allow-hotplug</code></strong></span> stanza to start the network interface <code class="literal">eth0</code> automatically upon events.</p>
<p>Now you are ready to switch the network configuration.</p>
<p>Let's move your PC to a LAN served by the DHCP. You bring up the <span class="strong"><strong>network interface</strong></span> (the physical interface) <code class="literal">eth0</code> by assigning the <span class="strong"><strong>network configuration</strong></span> name (the logical interface name) <code class="literal">config1</code> to it by the following.</p>
<pre class="screen">$ sudo ifup eth0=config1
Password:
...</pre>
<p>The interface <code class="literal">eth0</code> is up, configured by DHCP and connected to LAN.</p>
<pre class="screen">$ sudo ifdown eth0=config1
...</pre>
<p>The interface <code class="literal">eth0</code> is down and disconnected from LAN.</p>
<p>Let's move your PC to a LAN served by the static IP. You bring up the <span class="strong"><strong>network interface</strong></span> <code class="literal">eth0</code> by assigning the <span class="strong"><strong>network configuration</strong></span> name <code class="literal">config2</code> to it by the following.</p>
<pre class="screen">$ sudo ifup eth0=config2
...</pre>
<p>The interface <code class="literal">eth0</code> is up, configured with static IP and connected to LAN. The additional parameters given as <code class="literal">dns-*</code> configures "<code class="literal">/etc/resolv.conf</code>" contents. This "<code class="literal">/etc/resolv.conf</code>" is better manged if the <code class="literal">resolvconf</code> package is installed.</p>
<pre class="screen">$ sudo ifdown eth0=config2
...</pre>
<p>The interface <code class="literal">eth0</code> is down and disconnected from LAN, again.</p>
<p>Let's move your PC to a port on BB-modem connected to the PPPoE served service. You bring up the <span class="strong"><strong>network interface</strong></span> <code class="literal">eth0</code> by assigning the <span class="strong"><strong>network configuration</strong></span> name <code class="literal">pppoe</code> to it by the following.</p>
<pre class="screen">$ sudo ifup eth0=pppoe
...</pre>
<p>The interface <code class="literal">eth0</code> is up, configured with PPPoE connection directly to the ISP.</p>
<pre class="screen">$ sudo ifdown eth0=pppoe
...</pre>
<p>The interface <code class="literal">eth0</code> is down and disconnected, again.</p>
<p>Let's move your PC to a location without LAN or BB-modem but with POTS and modem. You bring up the <span class="strong"><strong>network interface</strong></span> <code class="literal">ppp0</code> by assigning the <span class="strong"><strong>network configuration</strong></span> name <code class="literal">pots</code> to it by the following.</p>
<pre class="screen">$ sudo ifup ppp0=pots
...</pre>
<p>The interface <code class="literal">ppp0</code> is up and connected to the Internet with PPP.</p>
<pre class="screen">$ sudo ifdown ppp0=pots
...</pre>
<p>The interface <code class="literal">ppp0</code> is down and disconnected from the Internet.</p>
<p>You should check the "<code class="literal">/etc/network/run/ifstate</code>" file for the current network configuration state of the <code class="literal">ifupdown</code> system.</p>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Warning">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Warning]" src="images/warning.png"></td>
<th align="left">Warning</th>
</tr>
<tr><td align="left" valign="top"><p>You may need to adjust numbers at the end of <code class="literal">eth*</code>, <code class="literal">ppp*</code>, etc. if you have multiple network interfaces.</p></td></tr>
</table></div>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="_scripting_with_the_ifupdown_system"></a>5.6.7. Scripting with the ifupdown system</h3></div></div></div>
<p>The <code class="literal">ifupdown</code> system automatically runs scripts installed in "<code class="literal">/etc/network/*/</code>" while exporting environment variables to scripts.</p>
<div class="table">
<a name="listofenvironmenheifupdownsystem"></a><p class="title"><b>Table 5.14. List of environment variables passed by the ifupdown system</b></p>
<div class="table-contents"><table summary="List of environment variables passed by the ifupdown system" border="1">
<colgroup>
<col align="left">
<col align="left">
</colgroup>
<thead><tr>
<th align="left">
environment variable
</th>
<th align="left">
value passed
</th>
</tr></thead>
<tbody>
<tr>
<td align="left">
"<code class="literal">$IFACE</code>"
</td>
<td align="left">
physical name (interface name) of the interface being processed
</td>
</tr>
<tr>
<td align="left">
"<code class="literal">$LOGICAL</code>"
</td>
<td align="left">
logical name (configuration name) of the interface being processed
</td>
</tr>
<tr>
<td align="left">
"<code class="literal">$ADDRFAM</code>"
</td>
<td align="left">
&lt;address_family&gt; of the interface
</td>
</tr>
<tr>
<td align="left">
"<code class="literal">$METHOD</code>"
</td>
<td align="left">
&lt;method_name&gt; of the interface. (e.g., "static")
</td>
</tr>
<tr>
<td align="left">
"<code class="literal">$MODE</code>"
</td>
<td align="left">
"start" if run from <code class="literal">ifup</code>, "stop" if run from <code class="literal">ifdown</code>
</td>
</tr>
<tr>
<td align="left">
"<code class="literal">$PHASE</code>"
</td>
<td align="left">
as per "<code class="literal">$MODE</code>", but with finer granularity, distinguishing the <code class="literal">pre-up</code>, <code class="literal">post-up</code>, <code class="literal">pre-down</code> and <code class="literal">post-down</code> phases
</td>
</tr>
<tr>
<td align="left">
"<code class="literal">$VERBOSITY</code>"
</td>
<td align="left">
indicates whether "<code class="literal">--verbose</code>" was used; set to 1 if so, 0 if not
</td>
</tr>
<tr>
<td align="left">
"<code class="literal">$PATH</code>"
</td>
<td align="left">
command search path: "<code class="literal">/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin</code>"
</td>
</tr>
<tr>
<td align="left">
"<code class="literal">$IF_&lt;OPTION&gt;</code>"
</td>
<td align="left">
value for the corresponding option under the <span class="strong"><strong><code class="literal">iface</code></strong></span> stanza
</td>
</tr>
</tbody>
</table></div>
</div>
<br class="table-break"><p>Here, each environment variable, "<code class="literal">$IF_&lt;OPTION&gt;</code>", is created from the name for the corresponding option such as &lt;option1&gt; and &lt;option2&gt; by prepending "<code class="literal">$IF_</code>", converting the case to the upper case, replacing hyphens to underscores, and discarding non-alphanumeric characters.</p>
<div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Tip">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Tip]" src="images/tip.png"></td>
<th align="left">Tip</th>
</tr>
<tr><td align="left" valign="top"><p>See <a class="xref" href="ch05.en.html#_the_basic_syntax_of_etc_network_interfaces" title='5.5.2. The basic syntax of "/etc/network/interfaces"'>Section 5.5.2, “The basic syntax of "/etc/network/interfaces"”</a> for &lt;address_family&gt;, &lt;method_name&gt;, &lt;option1&gt; and &lt;option2&gt;.</p></td></tr>
</table></div>
<p>The <code class="literal">ifupdown-extra</code> package (see <a class="xref" href="ch05.en.html#_the_ifupdown_extra_package" title="5.5.14. The ifupdown-extra package">Section 5.5.14, “The ifupdown-extra package”</a>) uses these environment variables to extend the functionality of the <code class="literal">ifupdown</code> package. The <code class="literal">ifmetric</code> package (see <a class="xref" href="ch05.en.html#_the_ifmetric_package" title="5.6.2. The ifmetric package">Section 5.6.2, “The ifmetric package”</a>) installs the "<code class="literal">/etc/network/if-up.d/ifmetric</code>" script which sets the metric via the "<code class="literal">$IF_METRIC</code>" variable. The <code class="literal">guessnet</code> package (see <a class="xref" href="ch05.en.html#_mapping_with_guessnet" title="5.6.8. Mapping with guessnet">Section 5.6.8, “Mapping with guessnet”</a>), which provides simple and powerful framework for the auto-selection of the network configuration via the mapping mechanism, also uses these.</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td>
<th align="left">Note</th>
</tr>
<tr><td align="left" valign="top"><p>For more specific examples of custom network configuration scripts using these environment variables, you should check example scripts in "<code class="literal">/usr/share/doc/ifupdown/examples/*</code>" and scripts used in <code class="literal">ifscheme</code> and <code class="literal">ifupdown-scripts-zg2</code> packages. These additional scripts have some overlaps of functionalities with basic <code class="literal">ifupdown-extra</code> and <code class="literal">guessnet</code> packages. If you install these additional scripts, you should customize these scripts to avoid interferences.</p></td></tr>
</table></div>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="_mapping_with_guessnet"></a>5.6.8. Mapping with guessnet</h3></div></div></div>
<p>Instead of manually choosing configuration as described in <a class="xref" href="ch05.en.html#_the_manually_switchable_network_configuration" title="5.6.6. The manually switchable network configuration">Section 5.6.6, “The manually switchable network configuration”</a>, you can use the mapping mechanism described in <a class="xref" href="ch05.en.html#_the_mapping_stanza" title="5.6.5. The mapping stanza">Section 5.6.5, “The mapping stanza”</a> to select network configuration automatically with custom scripts.</p>
<p>The <span class="citerefentry"><span class="refentrytitle">guessnet-ifupdown</span>(8)</span> command provided by the <code class="literal">guessnet</code> package is designed to be used as a mapping script and provides powerful framework to enhance the <code class="literal">ifupdown</code> system.</p>
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
<li class="listitem"><p>
You list test condition as the value for <span class="strong"><strong><code class="literal">guessnet</code></strong></span> options for each network configuration under <span class="strong"><strong><code class="literal">iface</code></strong></span> stanza.
</p></li>
<li class="listitem"><p>
Mapping choses the <span class="strong"><strong><code class="literal">iface</code></strong></span> with first non-ERROR result as the network configuration.
</p></li>
</ul></div>
<p>This dual usage of the "<code class="literal">/etc/network/interfaces</code>" file by the mapping script, <code class="literal">guessnet-ifupdown</code>, and the original network configuration infrastructure, <code class="literal">ifupdown</code>, does not cause negative impacts since <span class="strong"><strong><code class="literal">guessnet</code></strong></span> options only export extra environment variables to scripts run by the <code class="literal">ifupdown</code> system. See details in <span class="citerefentry"><span class="refentrytitle">guessnet-ifupdown</span>(8)</span>.</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td>
<th align="left">Note</th>
</tr>
<tr><td align="left" valign="top"><p>When multiple <span class="strong"><strong><code class="literal">guessnet</code></strong></span> option lines are required in "<code class="literal">/etc/network/interfaces</code>", use option lines started with <span class="strong"><strong><code class="literal">guessnet1</code></strong></span>, <span class="strong"><strong><code class="literal">guessnet2</code></strong></span>, and so on, since the <code class="literal">ifupdown</code> package does not allow starting strings of option lines to be repeated.</p></td></tr>
</table></div>
</div>
</div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="_the_low_level_network_configuration"></a>5.7. The low level network configuration</h2></div></div></div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="_iproute2_commands"></a>5.7.1. Iproute2 commands</h3></div></div></div>
<p><a class="ulink" href="http://www.linuxfoundation.org/en/Net:Iproute2" target="_top">Iproute2</a> commands offer complete low-level network configuration capabilities. Here is a translation table from obsolete <a class="ulink" href="http://www.linuxfoundation.org/en/Net:Net-tools" target="_top">net-tools</a> commands to new <a class="ulink" href="http://www.linuxfoundation.org/en/Net:Iproute2" target="_top">iproute2</a> etc. commands.</p>
<div class="table">
<a name="translationtableiprouteccommands"></a><p class="title"><b>Table 5.15. Translation table from obsolete <code class="literal">net-tools</code> commands to new <code class="literal">iproute2</code> commands</b></p>
<div class="table-contents"><table summary="Translation table from obsolete net-tools commands to new iproute2 commands" border="1">
<colgroup>
<col align="left">
<col align="left">
<col align="left">
</colgroup>
<thead><tr>
<th align="left">
obsolete net-tools
</th>
<th align="left">
new iproute2 etc.
</th>
<th align="left">
manipulation
</th>
</tr></thead>
<tbody>
<tr>
<td align="left">
<span class="citerefentry"><span class="refentrytitle">ifconfig</span>(8)</span>
</td>
<td align="left">
<code class="literal">ip addr</code>
</td>
<td align="left">
protocol (IP or IPv6) address on a device
</td>
</tr>
<tr>
<td align="left">
<span class="citerefentry"><span class="refentrytitle">route</span>(8)</span>
</td>
<td align="left">
<code class="literal">ip route</code>
</td>
<td align="left">
routing table entry
</td>
</tr>
<tr>
<td align="left">
<span class="citerefentry"><span class="refentrytitle">arp</span>(8)</span>
</td>
<td align="left">
<code class="literal">ip neigh</code>
</td>
<td align="left">
ARP or NDISC cache entry
</td>
</tr>
<tr>
<td align="left">
<code class="literal">ipmaddr</code>
</td>
<td align="left">
<code class="literal">ip maddr</code>
</td>
<td align="left">
multicast address
</td>
</tr>
<tr>
<td align="left">
<code class="literal">iptunnel</code>
</td>
<td align="left">
<code class="literal">ip tunnel</code>
</td>
<td align="left">
tunnel over IP
</td>
</tr>
<tr>
<td align="left">
<span class="citerefentry"><span class="refentrytitle">nameif</span>(8)</span>
</td>
<td align="left">
<span class="citerefentry"><span class="refentrytitle">ifrename</span>(8)</span>
</td>
<td align="left">
name network interfaces based on MAC addresses
</td>
</tr>
<tr>
<td align="left">
<span class="citerefentry"><span class="refentrytitle">mii-tool</span>(8)</span>
</td>
<td align="left">
<span class="citerefentry"><span class="refentrytitle">ethtool</span>(8)</span>
</td>
<td align="left">
Ethernet device settings
</td>
</tr>
</tbody>
</table></div>
</div>
<br class="table-break"><p>See <span class="citerefentry"><span class="refentrytitle">ip</span>(8)</span> and <a class="ulink" href="http://www.policyrouting.org/iproute2.doc.html" target="_top">IPROUTE2 Utility Suite Howto</a>.</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="_safe_low_level_network_operations"></a>5.7.2. Safe low level network operations</h3></div></div></div>
<p>You may use low level network commands as follows safely since they do not change network configuration.</p>
<div class="table">
<a name="listoflowlevelnetworkcommands"></a><p class="title"><b>Table 5.16. List of low level network commands</b></p>
<div class="table-contents"><table summary="List of low level network commands" border="1">
<colgroup>
<col align="left">
<col align="left">
</colgroup>
<thead><tr>
<th align="left">
command
</th>
<th align="left">
description
</th>
</tr></thead>
<tbody>
<tr>
<td align="left">
<code class="literal">ifconfig</code>
</td>
<td align="left">
display the link and address status of active interfaces
</td>
</tr>
<tr>
<td align="left">
<code class="literal">ip addr show</code>
</td>
<td align="left">
display the link and address status of active interfaces
</td>
</tr>
<tr>
<td align="left">
<code class="literal">route -n</code>
</td>
<td align="left">
display all the routing table in numerical addresses
</td>
</tr>
<tr>
<td align="left">
<code class="literal">ip route show</code>
</td>
<td align="left">
display all the routing table in numerical addresses
</td>
</tr>
<tr>
<td align="left">
<code class="literal">arp</code>
</td>
<td align="left">
display the current content of the <a class="ulink" href="http://en.wikipedia.org/wiki/Address_Resolution_Protocol" target="_top">ARP</a> cache tables
</td>
</tr>
<tr>
<td align="left">
<code class="literal">ip neigh</code>
</td>
<td align="left">
display the current content of the <a class="ulink" href="http://en.wikipedia.org/wiki/Address_Resolution_Protocol" target="_top">ARP</a> cache tables
</td>
</tr>
<tr>
<td align="left">
<code class="literal">plog</code>
</td>
<td align="left">
display ppp daemon log
</td>
</tr>
<tr>
<td align="left">
<code class="literal">ping yahoo.com</code>
</td>
<td align="left">
check the Internet connection to "<code class="literal">yahoo.com</code>"
</td>
</tr>
<tr>
<td align="left">
<code class="literal">whois yahoo.com</code>
</td>
<td align="left">
check who registered "<code class="literal">yahoo.com</code>" in the domains database
</td>
</tr>
<tr>
<td align="left">
<code class="literal">traceroute yahoo.com</code>
</td>
<td align="left">
trace the Internet connection to "<code class="literal">yahoo.com</code>"
</td>
</tr>
<tr>
<td align="left">
<code class="literal">tracepath yahoo.com</code>
</td>
<td align="left">
trace the Internet connection to "<code class="literal">yahoo.com</code>"
</td>
</tr>
<tr>
<td align="left">
<code class="literal">mtr yahoo.com</code>
</td>
<td align="left">
trace the Internet connection to "<code class="literal">yahoo.com</code>" (repeatedly)
</td>
</tr>
<tr>
<td align="left">
<code class="literal">dig [@dns-server.com] example.com [{a|mx|any}]</code>
</td>
<td align="left">
check <a class="ulink" href="http://en.wikipedia.org/wiki/Domain_Name_System" target="_top">DNS</a> records of "<code class="literal">example.com</code>" by "<code class="literal">dns-server.com</code>" for a "<code class="literal">a</code>", "<code class="literal">mx</code>", or "<code class="literal">any</code>" record
</td>
</tr>
<tr>
<td align="left">
<code class="literal">iptables -L -n</code>
</td>
<td align="left">
check packet filter
</td>
</tr>
<tr>
<td align="left">
<code class="literal">netstat -a</code>
</td>
<td align="left">
find all open ports
</td>
</tr>
<tr>
<td align="left">
<code class="literal">netstat -l --inet</code>
</td>
<td align="left">
find listening ports
</td>
</tr>
<tr>
<td align="left">
<code class="literal">netstat -ln --tcp</code>
</td>
<td align="left">
find listening TCP ports (numeric)
</td>
</tr>
<tr>
<td align="left">
<code class="literal">dlint example.com</code>
</td>
<td align="left">
check DNS zone information of "<code class="literal">example.com</code>"
</td>
</tr>
</tbody>
</table></div>
</div>
<br class="table-break"><div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Tip">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Tip]" src="images/tip.png"></td>
<th align="left">Tip</th>
</tr>
<tr><td align="left" valign="top"><p>Some of these low level network configuration tools reside in "<code class="literal">/sbin/</code>". You may need to issue full command path such as "<code class="literal">/sbin/ifconfig</code>" or add "<code class="literal">/sbin</code>" to the "<code class="literal">$PATH</code>" list in your "<code class="literal">~/.bashrc</code>".</p></td></tr>
</table></div>
</div>
</div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="_network_optimization"></a>5.8. Network optimization</h2></div></div></div>
<p>Generic network optimization is beyond the scope of this documentation. I touch only subjects pertinent to the consumer grade connection.</p>
<div class="table">
<a name="listofnetworkoptimizationtools"></a><p class="title"><b>Table 5.17. List of network optimization tools</b></p>
<div class="table-contents"><table summary="List of network optimization tools" border="1">
<colgroup>
<col align="left">
<col align="left">
<col align="left">
<col align="left">
</colgroup>
<thead><tr>
<th align="left">
packages
</th>
<th align="left">
popcon
</th>
<th align="left">
size
</th>
<th align="left">
description
</th>
</tr></thead>
<tbody>
<tr>
<td align="left"><a class="ulink" href="http://packages.debian.org/sid/iftop" target="_top">
<code class="literal">iftop</code>
</a></td>
<td align="left"><a class="ulink" href="http://qa.debian.org/popcon.php?package=iftop" target="_top">http://qa.debian.org/popcon.php?package=iftop</a></td>
<td align="left"><a class="ulink" href="http://packages.qa.debian.org/i/iftop.html" target="_top">109</a></td>
<td align="left">
display bandwidth usage information on an network interface
</td>
</tr>
<tr>
<td align="left"><a class="ulink" href="http://packages.debian.org/sid/iperf" target="_top">
<code class="literal">iperf</code>
</a></td>
<td align="left"><a class="ulink" href="http://qa.debian.org/popcon.php?package=iperf" target="_top">http://qa.debian.org/popcon.php?package=iperf</a></td>
<td align="left"><a class="ulink" href="http://packages.qa.debian.org/i/iperf.html" target="_top">170</a></td>
<td align="left">
Internet Protocol bandwidth measuring tool
</td>
</tr>
<tr>
<td align="left"><a class="ulink" href="http://packages.debian.org/sid/apt-spy" target="_top">
<code class="literal">apt-spy</code>
</a></td>
<td align="left"><a class="ulink" href="http://qa.debian.org/popcon.php?package=apt-spy" target="_top">http://qa.debian.org/popcon.php?package=apt-spy</a></td>
<td align="left"><a class="ulink" href="http://packages.qa.debian.org/a/apt-spy.html" target="_top">105</a></td>
<td align="left">
write a "<code class="literal">/etc/apt/sources.list</code>" file based on bandwidth tests
</td>
</tr>
<tr>
<td align="left"><a class="ulink" href="http://packages.debian.org/sid/ifstat" target="_top">
<code class="literal">ifstat</code>
</a></td>
<td align="left"><a class="ulink" href="http://qa.debian.org/popcon.php?package=ifstat" target="_top">http://qa.debian.org/popcon.php?package=ifstat</a></td>
<td align="left"><a class="ulink" href="http://packages.qa.debian.org/i/ifstat.html" target="_top">88</a></td>
<td align="left">
InterFace STATistics Monitoring
</td>
</tr>
<tr>
<td align="left"><a class="ulink" href="http://packages.debian.org/sid/bmon" target="_top">
<code class="literal">bmon</code>
</a></td>
<td align="left"><a class="ulink" href="http://qa.debian.org/popcon.php?package=bmon" target="_top">http://qa.debian.org/popcon.php?package=bmon</a></td>
<td align="left"><a class="ulink" href="http://packages.qa.debian.org/b/bmon.html" target="_top">188</a></td>
<td align="left">
portable bandwidth monitor and rate estimator
</td>
</tr>
<tr>
<td align="left"><a class="ulink" href="http://packages.debian.org/sid/ethstatus" target="_top">
<code class="literal">ethstatus</code>
</a></td>
<td align="left"><a class="ulink" href="http://qa.debian.org/popcon.php?package=ethstatus" target="_top">http://qa.debian.org/popcon.php?package=ethstatus</a></td>
<td align="left"><a class="ulink" href="http://packages.qa.debian.org/e/ethstatus.html" target="_top">84</a></td>
<td align="left">
script that quickly measures network device throughput
</td>
</tr>
<tr>
<td align="left"><a class="ulink" href="http://packages.debian.org/sid/bing" target="_top">
<code class="literal">bing</code>
</a></td>
<td align="left"><a class="ulink" href="http://qa.debian.org/popcon.php?package=bing" target="_top">http://qa.debian.org/popcon.php?package=bing</a></td>
<td align="left"><a class="ulink" href="http://packages.qa.debian.org/b/bing.html" target="_top">96</a></td>
<td align="left">
empirical stochastic bandwidth tester
</td>
</tr>
<tr>
<td align="left"><a class="ulink" href="http://packages.debian.org/sid/bwm-ng" target="_top">
<code class="literal">bwm-ng</code>
</a></td>
<td align="left"><a class="ulink" href="http://qa.debian.org/popcon.php?package=bwm-ng" target="_top">http://qa.debian.org/popcon.php?package=bwm-ng</a></td>
<td align="left"><a class="ulink" href="http://packages.qa.debian.org/b/bwm-ng.html" target="_top">114</a></td>
<td align="left">
small and simple console-based bandwidth monitor
</td>
</tr>
<tr>
<td align="left"><a class="ulink" href="http://packages.debian.org/sid/ethstats" target="_top">
<code class="literal">ethstats</code>
</a></td>
<td align="left"><a class="ulink" href="http://qa.debian.org/popcon.php?package=ethstats" target="_top">http://qa.debian.org/popcon.php?package=ethstats</a></td>
<td align="left"><a class="ulink" href="http://packages.qa.debian.org/e/ethstats.html" target="_top">52</a></td>
<td align="left">
console-based Ethernet statistics monitor
</td>
</tr>
<tr>
<td align="left"><a class="ulink" href="http://packages.debian.org/sid/ipfm" target="_top">
<code class="literal">ipfm</code>
</a></td>
<td align="left"><a class="ulink" href="http://qa.debian.org/popcon.php?package=ipfm" target="_top">http://qa.debian.org/popcon.php?package=ipfm</a></td>
<td align="left"><a class="ulink" href="http://packages.qa.debian.org/i/ipfm.html" target="_top">156</a></td>
<td align="left">
bandwidth analysis tool
</td>
</tr>
</tbody>
</table></div>
</div>
<br class="table-break"><div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="_finding_optimal_mtu"></a>5.8.1. Finding optimal MTU</h3></div></div></div>
<p>The <a class="ulink" href="http://en.wikipedia.org/wiki/Maximum_transmission_unit" target="_top">Maximum Transmission Unit (MTU)</a> value can be determined experimentally with <span class="citerefentry"><span class="refentrytitle">ping</span>(8)</span> with "<code class="literal">-M do</code>" option which sends ICMP packets with data size starting from 1500 (with offset of 28 bytes for the IP+ICMP header) and finding the largest size without IP fragmentation.</p>
<p>For example, try the following</p>
<pre class="screen">$ ping -c 1 -s $((1500-28)) -M do www.debian.org
PING www.debian.org (194.109.137.218) 1472(1500) bytes of data.
From 192.168.11.2 icmp_seq=1 Frag needed and DF set (mtu = 1454)
--- www.debian.org ping statistics ---
0 packets transmitted, 0 received, +1 errors</pre>
<p>Try 1454 instead of 1500</p>
<p>You see <span class="citerefentry"><span class="refentrytitle">ping</span>(8)</span> succeed with 1454.</p>
<p>This process is <a class="ulink" href="http://en.wikipedia.org/wiki/Path_MTU_discovery" target="_top">Path MTU (PMTU) discovery</a> (<a class="ulink" href="http://tools.ietf.org/html/rfc1191" target="_top">RFC1191</a>) and the <span class="citerefentry"><span class="refentrytitle">tracepath</span>(8)</span> command can automate this.</p>
<div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Tip">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Tip]" src="images/tip.png"></td>
<th align="left">Tip</th>
</tr>
<tr><td align="left" valign="top"><p>The above example with PMTU value of 1454 is for my previous FTTP provider which used <a class="ulink" href="http://en.wikipedia.org/wiki/Asynchronous_Transfer_Mode" target="_top">Asynchronous Transfer Mode</a> (ATM) as its backbone network and served its clients with the <a class="ulink" href="http://en.wikipedia.org/wiki/Point-to-Point_Protocol_over_Ethernet" target="_top">PPPoE</a>. The actual PMTU value depends on your environment, e.g., 1500 for the my new FTTP provider.</p></td></tr>
</table></div>
<div class="table">
<a name="basicguidelinesoeoptimalmtuvalue"></a><p class="title"><b>Table 5.18. Basic guide lines of the optimal MTU value</b></p>
<div class="table-contents"><table summary="Basic guide lines of the optimal MTU value" border="1">
<colgroup>
<col align="left">
<col align="left">
<col align="left">
</colgroup>
<thead><tr>
<th align="left">
network environment
</th>
<th align="left">
MTU
</th>
<th align="left">
rationale
</th>
</tr></thead>
<tbody>
<tr>
<td align="left">
Dial-up link (IP: PPP)
</td>
<td align="left">
576
</td>
<td align="left">
standard
</td>
</tr>
<tr>
<td align="left">
Ethernet link (IP: DHCP or fixed)
</td>
<td align="left">
1500
</td>
<td align="left">
standard and default
</td>
</tr>
<tr>
<td align="left">
Ethernet link (IP: PPPoE)
</td>
<td align="left">
1492 (=1500-8)
</td>
<td align="left">
2 bytes for PPP header and 6 bytes for PPPoE header
</td>
</tr>
<tr>
<td align="left">
Ethernet link (ISP's backbone: ATM, IP: DHCP or fixed)
</td>
<td align="left">
1462 (=48*31-18-8)
</td>
<td align="left">
author's speculation: 18 for Ethernet header, 8 for SAR trailer
</td>
</tr>
<tr>
<td align="left">
Ethernet link (ISP's backbone: ATM, IP: PPPoE)
</td>
<td align="left">
1454 (=48*31-8-18-8)
</td>
<td align="left">
see "<a class="ulink" href="http://www.mynetwatchman.com/kb/ADSL/pppoemtu.htm" target="_top">Optimal MTU configuration for PPPoE ADSL Connections</a>" for rationale
</td>
</tr>
</tbody>
</table></div>
</div>
<br class="table-break"><p>In addtion to these basic guide lines, you should know the following.</p>
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
<li class="listitem"><p>
Any use of tunneling methods (<a class="ulink" href="http://en.wikipedia.org/wiki/Virtual_private_network" target="_top">VPN</a> etc.) may reduce optimal MTU further by their overheads.
</p></li>
<li class="listitem"><p>
The MTU value should not exceed the experimentally determined PMTU value.
</p></li>
<li class="listitem"><p>
The bigger MTU value is generally better when other limitations are met.
</p></li>
</ul></div>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="_setting_mtu"></a>5.8.2. Setting MTU</h3></div></div></div>
<p>Here are examples for setting the MTU value from its default 1500 to 1454.</p>
<p>For the DHCP (see <a class="xref" href="ch05.en.html#_the_network_interface_served_by_the_dhcp" title="5.5.4. The network interface served by the DHCP">Section 5.5.4, “The network interface served by the DHCP”</a>), you can replace pertinent <span class="strong"><strong><code class="literal">iface</code></strong></span> stanza lines in the "<code class="literal">/etc/network/interfaces</code>" with the following.</p>
<pre class="screen">iface eth0 inet dhcp
pre-up /sbin/ifconfig $IFACE mtu 1454</pre>
<p>For the static IP (see <a class="xref" href="ch05.en.html#_the_network_interface_with_the_static_ip" title="5.5.5. The network interface with the static IP">Section 5.5.5, “The network interface with the static IP”</a>), you can replace pertinent <span class="strong"><strong><code class="literal">iface</code></strong></span> stanza lines in the "<code class="literal">/etc/network/interfaces</code>" with the following.</p>
<pre class="screen">iface eth0 inet static
address 192.168.11.100
netmask 255.255.255.0
gateway 192.168.11.1
mtu 1454
dns-domain example.com
dns-nameservers 192.168.11.1</pre>
<p>For the direct PPPoE (see <a class="xref" href="ch05.en.html#_the_pppoe_connection_with_pppoeconf" title="5.4.5. The PPPoE connection with pppoeconf">Section 5.4.5, “The PPPoE connection with pppoeconf”</a>), you can replace pertinent "<code class="literal">mtu</code>" line in the "<code class="literal">/etc/ppp/peers/dsl-provider</code>" with the following.</p>
<pre class="screen">mtu 1454</pre>
<p>The <a class="ulink" href="http://en.wikipedia.org/wiki/Maximum_segment_size" target="_top">maximum segment size</a> (MSS) is used as an alternative measure of packet size. The relationship between MSS and MTU are the following.</p>
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
<li class="listitem"><p>
MSS = MTU - 40 for IPv4
</p></li>
<li class="listitem"><p>
MSS = MTU - 60 for IPv6
</p></li>
</ul></div>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td>
<th align="left">Note</th>
</tr>
<tr><td align="left" valign="top"><p>The <span class="citerefentry"><span class="refentrytitle">iptables</span>(8)</span> (see <a class="xref" href="ch05.en.html#_netfilter_infrastructure" title="5.9. Netfilter infrastructure">Section 5.9, “Netfilter infrastructure”</a>) based optimization can clamp packet size by the MSS and is useful for the router. See "TCPMSS" in <span class="citerefentry"><span class="refentrytitle">iptables</span>(8)</span>.</p></td></tr>
</table></div>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="_wan_tcp_optimization"></a>5.8.3. WAN TCP optimization</h3></div></div></div>
<p>The TCP throughput can be maximized by adjusting TCP buffer size parameters as described in "<a class="ulink" href="http://dsd.lbl.gov/TCP-tuning/" target="_top">TCP Tuning Guide</a>" and "<a class="ulink" href="http://en.wikipedia.org/wiki/TCP_tuning" target="_top">TCP tuning</a>" for the modern high-bandwidth and high-latency WAN. So far, the current Debian default settings serve well even for my LAN connected by the fast 1G bps FTTP service.</p>
</div>
</div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="_netfilter_infrastructure"></a>5.9. Netfilter infrastructure</h2></div></div></div>
<p><a class="ulink" href="http://en.wikipedia.org/wiki/Netfilter" target="_top">Netfilter</a> provides infrastructure for <a class="ulink" href="http://en.wikipedia.org/wiki/Stateful_firewall" target="_top">stateful firewall</a> and <a class="ulink" href="http://en.wikipedia.org/wiki/Network_address_translation" target="_top">network address translation (NAT)</a> with <a class="ulink" href="http://en.wikipedia.org/wiki/Linux_kernel" target="_top">Linux kernel</a> modules (see <a class="xref" href="ch03.en.html#_the_kernel_module_initialization" title="3.5.12. The kernel module initialization">Section 3.5.12, “The kernel module initialization”</a>).</p>
<div class="table">
<a name="listoffirewalltools"></a><p class="title"><b>Table 5.19. List of firewall tools</b></p>
<div class="table-contents"><table summary="List of firewall tools" border="1">
<colgroup>
<col align="left">
<col align="left">
<col align="left">
<col align="left">
</colgroup>
<thead><tr>
<th align="left">
packages
</th>
<th align="left">
popcon
</th>
<th align="left">
size
</th>
<th align="left">
description
</th>
</tr></thead>
<tbody>
<tr>
<td align="left"><a class="ulink" href="http://packages.debian.org/sid/iptables" target="_top">
<code class="literal">iptables</code>
</a></td>
<td align="left"><a class="ulink" href="http://qa.debian.org/popcon.php?package=iptables" target="_top">http://qa.debian.org/popcon.php?package=iptables</a></td>
<td align="left"><a class="ulink" href="http://packages.qa.debian.org/i/iptables.html" target="_top">1366</a></td>
<td align="left">
administration tools for <a class="ulink" href="http://en.wikipedia.org/wiki/Netfilter" target="_top">netfilter</a>
</td>
</tr>
<tr>
<td align="left"><a class="ulink" href="http://packages.debian.org/sid/iptstate" target="_top">
<code class="literal">iptstate</code>
</a></td>
<td align="left"><a class="ulink" href="http://qa.debian.org/popcon.php?package=iptstate" target="_top">http://qa.debian.org/popcon.php?package=iptstate</a></td>
<td align="left"><a class="ulink" href="http://packages.qa.debian.org/i/iptstate.html" target="_top">164</a></td>
<td align="left">
continuously monitor <a class="ulink" href="http://en.wikipedia.org/wiki/Netfilter" target="_top">netfilter</a> state (similar to <span class="citerefentry"><span class="refentrytitle">top</span>(1)</span>)
</td>
</tr>
<tr>
<td align="left"><a class="ulink" href="http://packages.debian.org/sid/shorewall-init" target="_top">
<code class="literal">shorewall-init</code>
</a></td>
<td align="left"><a class="ulink" href="http://qa.debian.org/popcon.php?package=shorewall-init" target="_top">http://qa.debian.org/popcon.php?package=shorewall-init</a></td>
<td align="left"><a class="ulink" href="http://packages.qa.debian.org/s/shorewall-init.html" target="_top">95</a></td>
<td align="left">
<a class="ulink" href="http://en.wikipedia.org/wiki/Shorewall" target="_top">Shoreline Firewall</a> initialization
</td>
</tr>
<tr>
<td align="left"><a class="ulink" href="http://packages.debian.org/sid/shorewall" target="_top">
<code class="literal">shorewall</code>
</a></td>
<td align="left"><a class="ulink" href="http://qa.debian.org/popcon.php?package=shorewall" target="_top">http://qa.debian.org/popcon.php?package=shorewall</a></td>
<td align="left"><a class="ulink" href="http://packages.qa.debian.org/s/shorewall.html" target="_top">1676</a></td>
<td align="left">
<a class="ulink" href="http://en.wikipedia.org/wiki/Shorewall" target="_top">Shoreline Firewall</a>, <a class="ulink" href="http://en.wikipedia.org/wiki/Netfilter" target="_top">netfilter</a> configuration file generator
</td>
</tr>
<tr>
<td align="left"><a class="ulink" href="http://packages.debian.org/sid/shorewall-lite" target="_top">
<code class="literal">shorewall-lite</code>
</a></td>
<td align="left"><a class="ulink" href="http://qa.debian.org/popcon.php?package=shorewall-lite" target="_top">http://qa.debian.org/popcon.php?package=shorewall-lite</a></td>
<td align="left"><a class="ulink" href="http://packages.qa.debian.org/s/shorewall-lite.html" target="_top">119</a></td>
<td align="left">
<a class="ulink" href="http://en.wikipedia.org/wiki/Shorewall" target="_top">Shoreline Firewall</a>, <a class="ulink" href="http://en.wikipedia.org/wiki/Netfilter" target="_top">netfilter</a> configuration file generator (light version)
</td>
</tr>
<tr>
<td align="left"><a class="ulink" href="http://packages.debian.org/sid/shorewall6" target="_top">
<code class="literal">shorewall6</code>
</a></td>
<td align="left"><a class="ulink" href="http://qa.debian.org/popcon.php?package=shorewall6" target="_top">http://qa.debian.org/popcon.php?package=shorewall6</a></td>
<td align="left"><a class="ulink" href="http://packages.qa.debian.org/s/shorewall6.html" target="_top">701</a></td>
<td align="left">
<a class="ulink" href="http://en.wikipedia.org/wiki/Shorewall" target="_top">Shoreline Firewall</a>, <a class="ulink" href="http://en.wikipedia.org/wiki/Netfilter" target="_top">netfilter</a> configuration file generator (IPv6 version)
</td>
</tr>
<tr>
<td align="left"><a class="ulink" href="http://packages.debian.org/sid/shorewall6-lite" target="_top">
<code class="literal">shorewall6-lite</code>
</a></td>
<td align="left"><a class="ulink" href="http://qa.debian.org/popcon.php?package=shorewall6-lite" target="_top">http://qa.debian.org/popcon.php?package=shorewall6-lite</a></td>
<td align="left"><a class="ulink" href="http://packages.qa.debian.org/s/shorewall6-lite.html" target="_top">117</a></td>
<td align="left">
<a class="ulink" href="http://en.wikipedia.org/wiki/Shorewall" target="_top">Shoreline Firewall</a>, <a class="ulink" href="http://en.wikipedia.org/wiki/Netfilter" target="_top">netfilter</a> configuration file generator (IPv6, light version)
</td>
</tr>
</tbody>
</table></div>
</div>
<br class="table-break"><p>Main user space program of <a class="ulink" href="http://en.wikipedia.org/wiki/Netfilter" target="_top">netfilter</a> is <span class="citerefentry"><span class="refentrytitle">iptables</span>(8)</span>. You can manually configure <a class="ulink" href="http://en.wikipedia.org/wiki/Netfilter" target="_top">netfilter</a> interactively from shell, save its state with <span class="citerefentry"><span class="refentrytitle">iptables-save</span>(8)</span>, and restore it via init script with <span class="citerefentry"><span class="refentrytitle">iptables-restore</span>(8)</span> upon system reboot.</p>
<p>Configuration helper scripts such as <a class="ulink" href="http://en.wikipedia.org/wiki/Shorewall" target="_top">shorewall</a> ease this process.</p>
<p>See documentations at <a class="ulink" href="http://www.netfilter.org/documentation/" target="_top">http://www.netfilter.org/documentation/</a> (or in "<code class="literal">/usr/share/doc/iptables/html/</code>").</p>
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
<li class="listitem"><p>
<a class="ulink" href="http://www.netfilter.org/documentation/HOWTO/networking-concepts-HOWTO.html" target="_top">Linux Networking-concepts HOWTO</a>
</p></li>
<li class="listitem"><p>
<a class="ulink" href="http://www.netfilter.org/documentation/HOWTO/packet-filtering-HOWTO.html" target="_top">Linux 2.4 Packet Filtering HOWTO</a>
</p></li>
<li class="listitem"><p>
<a class="ulink" href="http://www.netfilter.org/documentation/HOWTO/NAT-HOWTO.html" target="_top">Linux 2.4 NAT HOWTO</a>
</p></li>
</ul></div>
<div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Tip">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Tip]" src="images/tip.png"></td>
<th align="left">Tip</th>
</tr>
<tr><td align="left" valign="top"><p>Although these were written for Linux <span class="strong"><strong>2.4</strong></span>, both <span class="citerefentry"><span class="refentrytitle">iptables</span>(8)</span> command and netfilter kernel function apply for current Linux <span class="strong"><strong>2.6</strong></span>.</p></td></tr>
</table></div>
</div>
</div>
<div class="navfooter">
<hr>
<table width="100%" summary="Navigation footer">
<tr>
<td width="40%" align="left">
<a accesskey="p" href="ch04.en.html"><img src="images/prev.gif" alt="Prev"></a> </td>
<td width="20%" align="center"> </td>
<td width="40%" align="right"> <a accesskey="n" href="ch06.en.html"><img src="images/next.gif" alt="Next"></a>
</td>
</tr>
<tr>
<td width="40%" align="left" valign="top">Chapter 4. Authentication </td>
<td width="20%" align="center"><a accesskey="h" href="index.en.html"><img src="images/home.gif" alt="Home"></a></td>
<td width="40%" align="right" valign="top"> Chapter 6. Network applications</td>
</tr>
</table>
</div>
</body>
</html>