Configuring Interfaces


Almost all network interface operations are performed with ifconfig(8). This program is a general interface configuration tool that can be used to examine every network interface on your system. To start with, the "-a" flag will list every interface on your system and its configuration. An OpenBSD system starts with quite a few interfaces, so don't be surprised at the length of the output! A typical entry for an Ethernet card looks like this:

 fxp1 1 : flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> 2 mtu 1500 3         media: Ethernet autoselect (10baseT) 4         status: active 5         inet6 fe80::202:b3ff:fe63:e3ec%fxp1 prefixlen 64 scopeid 0x2 6         inet 66.43.114.127 netmask 0xfffff800 broadcast 68.43.111.255 7 

Not all interfaces have all the fields, but these are a good sample.

The first thing in any entry is the 1 interface name. The interface name is generally the same as the associated driver with a number added. In PCI cards, interfaces start numbering at zero and go up. (Some drivers, particularly ISA drivers, have hard-coded interface numbers depending on the IRQ or memory address of the card, and so may not start at 0.) This example, fxp1, means that this is the second card that uses the fxp driver. For a listing of device drivers, see Appendix A or the kernel configuration file and man pages on your release of OpenBSD.

A base install of OpenBSD includes quite a few network interfaces that you have probably never heard of. Most of these are software interfaces, created by the kernel for various special purposes. Here's a list of their names, and what they're for. While we won't cover all of them in this book, it's nice to know exactly what they're for.

loX

Loopback interface, for connections to the local machine via the network

pflogX

Interface for packet filter logging (see Chapter 19)

slX

SLIP network interface (see sl(8))

pppX

Kernel PPP network interface (see pppd(8))

tunX

User PPP network interface

encX

Encapsulation interface, to filter IPSec traffic via PF (see enc(4))

bridgeX

Ethernet bridging interface (see brconfig(8))

vlanX

Virtual LAN interface (see vlan(4))

greX

Encapsulation with Cisco GRE (see gre(4))

gifX

Generic traffic encapsulation interface (see gif(4))

Any interface name that appears in your ifconfig output, but is not listed here, is almost certainly an Ethernet card.

The 2 flags field gives driver-specific information, such as if the interface is working (the "UP" keyword and if the interface supports various physical protocol features.

The 3 MTU field, or maximum transmission unit, gives the maximum size of any piece of data that can be sent over this interface.1500 is a very common MTU.

The 4 media gives the sort of physical connection that is made to an Ethernet card. The sample here shows that the connection is 10baseT, or common 10-megabit Category 5 Ethernet. You can get a full list of valid media types in by running "ifconfig -m interfacename," and you can see what those media types mean in the network card's man page. For example, fxp(4) contains full descriptions of the six different valid connection types the card supports.

The 5 status line indicates if the network card is receiving and sending Ethernet data.

By 6 inet6, you will see the interface's IPv6 address. Similarly, the 7 inet line shows the interface's IPv4 address.

Ifconfig(8) has many other flags and functions, and we'll discuss the most common of them throughout this chapter.




Absolute Openbsd(c) Unix for the Practical Paranoid
Absolute OpenBSD: Unix for the Practical Paranoid
ISBN: 1886411999
EAN: 2147483647
Year: 2005
Pages: 298

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net