Debian Linux Network Configuration

From MobileRobots Research and Academic Customer Support

Jump to: navigation, search

Note: This article describes a default robot installation. If you have reinstalled Debian, or another GNU/Linux on your bot, they may not work in every case. See OS-specific help here, elsewhere on the internet, or contact support.

There are several ways to configure networking under any GNU/Linux system.

Each networking interface has a name assigned by Linux. The 100Mbps Ethernet "wired" LAN (non-wireless) interface is called eth0. If the computer has a second ethernet interface and it is enabled in the computer BIOS, that interface will be called eth1. The 802.11 wireless connection is called wlan0, ath0, or eth1, eth2, etc. depending on what kind of wireless card you have. (More about the various wireless cards that different robots might have is at the WLAN Adapters page).

Consult your network administrator for details on what the settings should be for your network. The key settings are wireless network ESSID and key (for the wireless interface), and DHCP (dynamic) or static address, and if static, then the IP address, gateway and network. You can also switch between managed (access point) mode and ad-hoc (peer-to-peer) mode.

After making changes to configuration files or to force a restart of the network interface, either disable and re-enable the interface using the ifdown and ifup commands (e.g. ifdown eth0; ifup eth0), or by restarting all networking services on the system using this command: /etc/init.d/networking restart.

Lots of detailed information about wireless networking is available at the Debian WiFi wiki: http://wiki.debian.org/WiFi . Check what version of Debian is running on your onboard computer (check the information displayed at the console during login or see the version number stored in the /etc/debian_version file), since details differ between the different Debian versions.

MobileRobots has provided different wireless hardware with onboard computers over the years.

Computers running Debian 5 (lenny) with EnGenius, Senao or Compex branded Atheros-based mini-pci wireless cards use the built in Linux ath5k driver module. (It is also possible to use Madwifi if desired.)

Computers running Debian 3.1 (sarge) and Linux kernel 2.4.x with EnGenius, Senao or Compex branded Atheros-based mini-pci wireless cards use the Madwifi Atheros drivers (ath_pci), which may require some Madwifi-unique configuration.

Some older systems with PCI Cisco Aironet 350 cards (i.e. some PowerBots) may have an extra management utility called acu located in /opt/cisco to do configuration rather than the methods described here. If you have that utility and an Aironet 350 PCI card, use it instead. See Aironet 350 Configuration.

Contents

Default Factory Configuration

The default configuration for new robots is as follows:

  • wired ethernet (eth0): Static IP address 10.0.125.32.
  • wireless ethernet (may be named eth1, wifi0, ath0 or wlan0 depending on wireless hardware and driver): Managed (not ad-hoc) with access point ESSID "Wireless Network", Static IP address 10.0.126.32.
  • The interface has "static" (manually assigned) information -- DHCP (automatic assignment) is not enabled for either address.
  • only one built-in ethernet interface is enabled in Cobra EBX-12 computer BIOS

If you also purchased a wireless access point from MobileRobots, then these default settings will work with that access point.

If you are planning on using the robot on an existing wireless network, you will need to change these settings.

GUI-based configuration

The Gnome environment contains some GUI network configuration programs: The 'Networking' tool in the 'System'->'Administration' menu and the 'Network Connections' tool in the 'System' -> 'Preferences' menu. These are included in the gnome-system-tools package. The Network Manager panel applet is also available in the network-manager-gnome package, which displays the status of the network interface in the gnome panel status area, and provides menu items for enabling/disabling networking and/or wireless, and for opening the configuration tools.

(If you have a Debian 3.1 system, and it does not already have the network administration tool, you can download gnome-system-tools from archive.debian.org, and install it with the command: dpkg -i gnome-system-tools_1.0.0-1_i386.deb . You can check what version of Debian you have by looking at the /etc/debian_version file, or noting what version number is displayed when you log in.)

Image:gnome-network-admin-main-win.png

This program will store settings in /etc/network/interfaces when changed.

Open the tool from the Gnome menu, or to run from a command line shell as root user:

su
network-admin

Since it is a GUI tool, you must run it either by connecting a keyboard, mouse, and monitor to the robot, and starting X-Windows after logging in, or you must use a remote X server to display the GUI.

Command-line tools

Use the ifconfig and iwconfig (or /sbin/ifconfig and /sbin/iwconfig) commands for network interface information and control.

Just running /sbin/ifconfig with no arguments will show IP address ("inet addr"), network masks ("Bcast" and "Mask"), interface status ("UP" or "DOWN"), statistics about data sent and received, and more. Running /sbin/iwconfig with no arguments will show an ESSID if connected (associated), mode ("Managed" or "Adhoc"), statistics about the signal, and more.

For more information about these commands, consult their manual pages:

 man ifconfig
 man iwconfig

You can activate and deactivate interfaces using the ifup and ifdown commands

 man ifup

For example, to disable the wireless interface called eth1 and enable the Ethernet interface called eth0, use this command:

 ifdown eth1; ifup eth0

You must be the root user or use sudo to make any changes using ifconfig or iwconfig or use the ifup or ifdown commands.

/etc/network/interfaces configuration file

Both Debian and Redhat/Fedora store permanent network configuration information in the /etc/network/interfaces file. Manually editing /etc/network/interfaces gives you control over all configuration options. Use the ifup and ifdown commands to start and stop the interface (you must stop and then restart it after editing /etc/network/interfaces, either by using ifup and ifdown, or by running /etc/init.d/networking restart). When using the ifup and ifdown commands you must provide the interface name as a command argument (e.g. ifdown eth0; ifup eth0 or ifdown ath0; ifup ath0. The default interfaces file gives examples of the most-commonly used options.

Usually, you will need to set the following values based on your own network:

  • Include either the word static or dhcp at the end of the iface line(s).
  • If you are using a static address, set:
address
gateway
netmask
network
broadcast
  • If you are using a static address or your DHCP server does not provide DNS information, set your DNS servers in /etc/resolv.conf
  • If you are using DHCP, then a DHCP client will run when the interface is activated (e.g. with ifup).
  • For old Debian 3.1 (with madwifi driver) only: To use ad-hoc (point to point) wireless networking instead of managed (with an access point), set wireless-mode to ad-hoc, madwifi-mode to ad-hoc, set madwifi-base to wifi0, and set wireless-essid to your desired ad-hoc network name. You can set wireless-channel if you want to use a channel other than the default (and often crowded) channel 1. See http://wiki.debian.org/WiFi/AdHoc for more instructions; For MobileRobots-installed Debian 3.1 (Sarge) based systems with the Engenius/Atheros wireless card, the Madwifi Atheros drivers are used, so use the Madwifi-specific information.

See the manual pages for further info (by running the following commands):

 man interfaces
 man wireless
 man ifup
 less /usr/share/doc/wireless-tools/README.Debian

For advanced wireless network authentication settings, ifplugd and wpa_supplicant can be used. See the 'wireless' and 'wpa_supplicant' man pages and the wpa_supplicate README file for further information on this:

 man wireless
 less /usr/share/doc/wpasupplicant/README.Debian.gz
 man wpa_supplicant

See WPA Wireless Security Configuration on Debian Linux for more information on using WPA on Debian.

You must be the root user or use sudo to make changes to /etc/network/interfaces and use the ifup and ifdown commands.

More Information

Personal tools