Interfaces – eth0, eth1 | Address and Routing Table Configuration | Testing Interface Initialization | Creating a Boot-Time Configuration Sequence

Home
 

NETWORK CONFIGURATION

Configuring the IPv6 Network

The configuration of the network is not a complicated process. The configuration of the IPv6 network uses the same processes that one would use to configure a normal IPv4 network. The processes should be done in careful incremental steps, and tested along the way. In this fashion, it will be easier to troubleshoot problems and pinpoint mistakes. As an aid to the reader, the steps involved in network configuration have been presented alongside real examples. The real examples show the actual addresses used in this implementation.

The chapter begins with a detailed description of configuring the network cards. The process for configuring dual network cards is primarily discussed in the chapter. The single network card configuration is similar and much simpler. Notes are made to describe the differences between single and dual card configuration, and a brief description of the steps involved for single card configuration are discussed.

The next section in the chapter describes the manual configuration of the interfaces. The ifconfig and route commands are explained and used in the examples shown in this section. After the interfaces have been manually configured, the testing process and the use of ping is explained.

Finally, the last section of the chapter describes the creation of boot-time scripts to facilitate automatic configuration of the network. For those nodes that will act as routers, forwarding enabling is also discussed.

Interfaces - eth0, eth1

portzic-eth0 has two network cards, a 3COM-3C509 and a DEC2000b-Turbo. Dual network card configuration is not entirely complicated. The first step is to check the Linux compatibility guide to make sure the cards is supported. These two cards are well supported and aside from the 3C509 auto-probing process, the cards work well together. This section tracks the process necessary to configure dual network cards on the same system.

Single network card configuration is easily accomplished using a built-in driver or a modularized driver, Linux then detects the card on boot-up. The process for single network card configuration is discussed in the Linux Ethernet HOW-TO. portzic-eth0 is the only node that required dual network card configuration, every other node used a single interface.

Interrupt and IO Port Selection

After making sure the cards are Linux compatible, it is a good idea to look through the documentation that came with the card. If the documentation is not available, the manufacturers internet page should provide the necessary information. The card manufacturer's documentation provides card specific IO and IRQ information. The cards should be set to non-conflicting IO addresses and available IRQ spots if the cards come with dip-switches or software that sets the IRQ/IO. The /proc file system provides an easy method of checking a systems current IO and IRQ allocations. It is important the cards are set to IO and IRQ values that are not being used by another part of the Linux system. The diagram below shows how to access the /proc file system information about IO ports and IRQ's.

If the cards do not have onboard configuration switches or software, the boot time driver options discussed in the next section should ensure that the cards are configured correctly.

Network Card Driver Configuration

The Linux drivers for the cards are contained in the Linux kernel. Some PCMCIA drivers can be loaded through Debian dselect and then compiled as modules. It is suggested that the drivers be configured as modules. The drivers could also be loaded as built-in drivers, but this configuration was unsuccessful in this implementation. Nonetheless, the built-in driver configuration is described below.

Figure 5.1 The /etc/lilo.conf and the /etc/conf.modules Files

Built-In Drivers

Those who wish to attempt the built-in driver configuration should add the append line to /etc/lilo.conf as shown on the left hand side of the illustration above. This line will force the boot up process to check for both cards. Otherwise, Linux will stop after acknowledging the first card. In the above example, IRQ and IO should be replaced by the proper values depending on the card. To allow the cards to autoprobe the available space, set IO and IRQ to zero. In the example above, 10 is the IRQ and 0x200 is the IO port value.

Modularized Drivers

The module method seems to work best. For this method, the alias and options lines should be added to the /etc/conf.modules The right hand side of the illustration above shows this method. The alias line lists the type of card to be configured. The options line defines the IO and IRQ to be used by the type of card listed on the alias line. If both cards are of the same type, one would only need to include one options line with two IRQ values and two IO values. The man page for the function 'modprobe' provides additional information on this type of configuration.

Verifying Proper Initialization of Network Cards

Once the configuration information has been added to /etc/conf.modules reboot the machine and scan the boot-up messages for errors. The dmesg command will display the boot-up messages after re-login into the system. The figure below shows the proper use of the 'dmesg' function.

Dmesg will actually display much more information than shown here. The Ethernet card initialization will usually occur towards the end of the display as it is shown above. Note that the cards have been loaded in the proper IRQs and IO ports.

Errors

The order in which the cards are acknowledged by Linux is not always predictable. In this implementation, regardless of what slot, IRQ, or IO the 3c509 card set to, it was always read first. This may cause problems with the proper configuration of the network card. Use dmesg and note what card the system read first. Then place the configuration instructions for this card first in the conf.modules file. For example, since the 3C509 card was always read first, its configuration instructions were placed before those of the DEC2000b card as shown in the illustration on the previous page. ETH0 always refers to the card read first, thus the 3C509 card became ETH0.

The following errors may occur during the boot-up process or while using the ifconfig and route commands.

Address and Route Configuration

If the network cards loaded without error, its time to begin the address configuration and route configuration. It's a good idea to try to manually bring up the cards before adapting the network boot-up script file. The ifconfig command may be used to view the current configuration or to change the current configuration. The ifconfig command may also be used to activate or deactivate existing interfaces. A deactivated interface cannot be used for communication.

The ifconfig command used alone without an argument will display the current status of all the configured interfaces. If an interface is listed after the ifconfig command, that interfaces status will be shown only. In most cases, after boot-up the lo or the loopback interface should come up automatically and can be viewed with the ifconfig command. ETH0 may also come up if the boot process read an existing /etc/init.d/network file that configures this interface. If the machine has never been configured on a network before, ifconfig may display nothing.

Using IFCONFIG and ROUTE

Assuming nothing came up with ifconfig, the first step is to bring the lo interface up. Even if lo or ETH0 came up, the process of reconfiguration will not hurt the network. The ifconfig option 'down' can be used to bring an interface down for reconfiguration with a different address. The use of the 'down' option with ifconfig is illustrated on the next page.

Once the all interfaces are brought down, the ifconfig command will display nothing since there are no active interfaces. Once an interface has been properly configured it can be brought down or up with the ifconfig command. To bring the interface up, it is only necessary to type ifconfig followed the interface and the option 'up'. The pre-configured address will be automatically reconfigured and associated with the interface.

The route command is used after each interface is brought 'up' with the ifconfig command. Route is used to set up routes for the configured interfaces. For bringing up IPv6 address routes, the '-A inet6' option must be used with the route command. The route command defines a route to the named network or host through the named interface. It is important to define the network for each interface. This information will be necessary when the localhost begins to forward packages from one interface to the other. The illustration at the top of the next page shows the use of the ifconfig and route commands to manually configure an interface.

The next step is to try using ifconfig to see if the network has been properly brought up by the above steps. The illustration on the next page shows the use of ifconfig and expected output.

Note that all of the interfaces have both IPv4 and IPv6 addresses. Also, there is a Local Link IPv6 Address and a Global scope Unicast Address for each interface. Thus, each interface has two configured IPv6 addresses and one IPv4 address. Ifconfig also displays the IRQ and IO that each card is using.

The route command can be used to display the kernel routing table for IPv4 or for IPv6. The figure below shows the IPv4 kernel routing table.

As previously mentioned, the '-A inet6' option is used with route command to specify IPv6 information. The figure below shows the IPv6 kernel routing table.

The Use column in the kernel routing table identifies the number of times the route has been used. The flags column specifies information about the type of route. Route also displays the names for those hosts listed in /etc/hosts and the networks listed in /etc/networks If no match is made, the IP address is listed.

Testing Interface Initialization

Using PING

The results from ifconfig and route look fine, but the real test will be to use the Packet Internet Groper (ping) to make sure that the node is capable of sending and receiving packets. Ping sends ICMP ECHO_REQUEST packets to another interface or host. The sender then replies with an echo reply. The node continues to send echo requests and the sender continues to reply until the process is interrupted by the user. As the echo replies are received, statistics are made to measure the time it took the packet to return.

If the ping packets are not returned, ping will eventually time out. A non-successful ping will usually indicate a routing problem. If this is the case, using snoop or a similar program on the machine being 'pinged' can give some insight as to whether or not the destination is receiving the packets. The snoop program is available for SUN Solaris systems, it provides a method to view all of the incoming and outgoing packets.

The packets may be arriving at the destination, yet the destination may be unable to re-route the packets back to the source. This may occur on a new network with new IP addresses, since the local DNS and router may not recognize the new network. If the Simple Network Management Protocol (SNMP) is installed on the new hosts, the network administrator will most likely see your network automatically using network management programs. If the central routers do not have specified routes to the new network, exterior networks will be unable to reach or reply to the local host.

Several different hosts and in and outside of the local network should be tested with ping to ensure that all routing tables correctly identify the local host.

Creating a Boot-Time Configuration Sequence

Now its time to configure the /etc/init.d/network file with the addresses that were manually configured in the previous section. Adding the ifconfig and route commands into the boot-up process, will avoid having to manually ifconfig the network after each reboot.

The /etc/init.d/network file contains the basic ifconfig and route commands to be initiated in the boot time sequence. These should be the same commands and addresses that were tested in the manual configuration. If the commands worked manually; they will work in the boot-up script. The metric option used in route provides a routing information to RIP or other such routing programs. The metric is the number of hops to the location through the given route. In this fashion, routing programs can discriminate and chose the quickest routes.

IPv4 Configuration

The figure below shows only the IPv4 configuration section for the /etc/init.d./network file.

Figure 5.2 IPv4 Configuration /etc/init.d/network File

IPv6 Configuration

The following illustration shows the IPv6 configuration section of the same /etc/init.d/network file mentioned above.

Figure 5.3 IPv6 Configuration /etc/init.d/network File

Enabling Forwarding

To enable forwarding for a node that will act as a router, the following lines must be added to the same /etc/init.d/network file.

Figure 5.4 Enabling Forwarding /etc/init.d/network File

The last few lines in the network file define the machine as a router. The echo 1 command enables the node to route IPv6 and IPv4 packets. Forwarding should only be enabled on nodes that will act as a router.


This page hosted by Get your own Free Home Page