Annvix
Personal tools



/User Guide/Networking

From Annvix

Configuring Networking

The initial network configuration in Annvix is done via the installer and is quite simple. However, if you need to make changes to the network post-install, or if you wish to configure an additional network adapter, there are no tools to ease the configuration. However, there are only a few configuration files that need to be modified or created and the process is quite simple.

Site-wide configuration that impacts all interfaces is done via the /etc/sysconfig/env/network environment directory. This directory contains exactly two files: HOSTNAME and GATEWAY. Per-device configuration uses traditional configuration files, similar to Mandriva and other Linux distributions.

The configuration files that manage network configuration for specific devices (such as eth0) are located in /etc/sysconfig/network-scripts. Each device and IP alias has it's own configuration file, such as ifcfg-eth0 for configuration of eth0, and ifcfg-eth0:0 for the first IP alias of eth0 (or eth0:0).

Contents

Dynamic IP Configuration

Dynamic IP-assigned devices are those that use protocols like DHCP. An example ifcfg-eth0 file for a dynamically-assigned IP on eth0 would be:

DEVICE=eth0
BOOTPROTO=dhcp
ONBOOT=yes
MII_NOT_SUPPORTED=yes

This indicates that the device is eth0, the boot protocol is DHCP, that the interface is to start at boot, and does not try to use ifstatus to see if the network link is up.

Static IP Configuration

A static IP-assigned device is one that will retain it's IP address constantly. With a static IP, unlike a dynamic one, you need to provide more information, such as the netmask, broadcast address, etc. An example ifcfg-eth1 file for a statically-assigned IP on eth1 would be:

DEVICE=eth1
BOOTPROTO=static
IPADDR=10.0.10.100
NETMASK=255.0.0.0
NETWORK=10.0.0.0
BROADCAST=10.255.255.255
ONBOOT=yes
MII_NOT_SUPPORTED=yes

This indicates that the device is eth1, the boot protocol is static, the IP address is 10.0.10.100, the netmask is 255.0.0.0, the network address is 10.0.0.0, the broadcast address is 10.255.255.255, the device is to start at boot, and does not try to use ifstatus to see if the network link is up.

IP Aliases

IP aliases piggy-back a lot of information from the "parent" device. For instance, if you wished to have eth1:0 assigned a static IP address of 10.0.10.101 with ifcfg-eth1 configured as above, the ifcfg-eth1:0 file would contain:

DEVICE=eth1:0
IPADDR=10.0.10.101

No other information is required as it will be taken from the "parent" device (in this case, eth1).

If, on the other hand, you wished to have eth0:1 have a static IP address, and eth0 is dynamic (as shown above), you would need to indicate the appropriate information. If the netmask, network address, etc. settings are the same they can be omitted, however you will need to indicate that eth0:1 is static, as opposed to eth0 (which is dynamic). This can be done thus:

DEVICE=eth0:1
BOOTPROTO=static
IPADDR=192.168.4.100

This would statically-assign the IP address 192.168.4.100 to eth0:1, while eth0 itself remains dynamic.

Also keep in mind that network configuration also uses some envdir settings from /etc/sysconfig/env/network/ that will need to be aware of, such as setting the default gateway address, gateway device, hostname, and whether or not networking is to be enabled automatically.

Network Options for ifcfg Files

The following keyword options are available for use in ifcfg-ethX files:

  • DEVICE: the name of the physical device, or in the case of IP alias devices, the logical name (i.e. eth0 or eth1:0)
  • IPADDR: the IP address (if statically assigned)
  • NETMASK: the netmask
  • ONBOOT: whether or not to start the device at boot ('yes' or 'no')
  • BOOTPROTO: the boot protocol to use ('dhcp' or 'static')
  • MTU: the default MTU for this device
  • WINDOW: the default window for routes from this device
  • SRCADDR: use the specified source address for outgoing packets on this device
  • MII_NOT_SUPPORTED: if set, do not try to use ifstatus to detect if the link is up
  • METRIC: if set, assign the route associated with this interface to this metric, using ifmetric
  • HWADDR: the ethernet hardware address for this device

The following keyword options are only valid for IP aliases:

  • ONPARENT: whether or not to bring up the device when the parent device is brought up ('yes' (default) or 'no')

<< Return to User Guide





Sponsors: Loans - Mobile Phones - Cheap Flights - Scottsdale Landscaping