ChorusOS 4.0 Network Administration Guide

Interface Configuration

It is not enough to create an Ethernet interface for Ethernet to work on a ChorusOS system. Once an interface has been created, you must configure it. Configuring the interface means providing an IP address, a subnet mask and a broadcast mask, and setting the status of the interface to up or down, depending on whether you want it to be operational.

Three utilities are provided to configure Ethernet interfaces on ChorusOS systems:

ifconfig

ifconfig(1M) can be used to configure as many Ethernet interfaces as necessary as long as the IP addresses for those interfaces are fixed.

rarp

rarp(1M) allows the ChorusOS system to configure an Ethernet interface with an IP address based on the Ethernet device address using the default subnet mask and broadcast address. This utility is specific to the ChorusOS 4.0 product. It requires a BPF device on the ChorusOS system and a RARP server on the local network.

dhclient

dhclient(1M) allows the ChorusOS system to configure all parameters of the Ethernet interface, and also configure the routing tables. It requires a BPF device on the ChorusOS system and a DHCP server on the local network. It also requires that you build the dhclient.r actor into the ChorusOS system image for your target.

The three examples that follow demonstrate how to use the utilities described above.


Example 3-3 Ethernet Configuration with ifconfig

The following example sysadm.ini fragment creates an interface for an Ethernet device and the loopback interface needed for IP communication. It then configures the Ethernet interface.

#
# Set the file creation mask to 0 during system configuration
#
umask 0

#
# Create an Ethernet interface for the first available device
#
# Since no dtree *pathname* is provided, the system uses the first
# device it finds
#
mkdev ifeth 0

#
# Create a loopback interface
# 
# Note that the loopback device is not attached to a device in
# the dtree, so no *pathname* argument is provided here either
#
mkdev lo 0

#
# Set the file creation mask back to the default value
#
umask 22

#
# Configure the Ethernet interface using ifconfig
#
# Note that ADMIN_IFCONFIG must be set to true in order for this to
# work
#
ifconfig ifeth0 129.157.197.88 netmask 0xffffff00 broadcast 129.157.197.255 up

#
# Configure the loopback interface as well
#
ifconfig lo0 127.0.0.1 up


Example 3-4 Ethernet Configuration with rarp

The following example sysadm.ini fragment creates an interface for an Ethernet device and the loopback interface needed for IP communication. It then creates a BPF device needed by rarp(1M) and configures the interface.

#
# Set the file creation mask to 0 during system configuration
#
umask 0

#
# Create an Ethernet interface for the first available device
#
# Since no dtree *pathname* is provided, the system uses the first
# device it finds
#
mkdev ifeth 0

#
# Create a loopback interface
# 
# Note that the loopback device is not attached to a device in
# the dtree, so no *pathname* argument is provided here either
#
mkdev lo 0

#
# Create a Berkeley Packet Filter device and special file
#
# The BPF device is used by either the rarp or dhclient command to
# configure the Ethernet interface
#
mkdev bpf 0
mknod /dev/bpf c 23 0

#
# Set the file creation mask back to the default value
#
umask 22

#
# Configure the Ethernet interface using rarp
#
# Note that BPF and ADMIN_RARP must be set to true in order for this
# to work
#
# rarp requires a BPF device
#
rarp ifeth0

#
# Configure the loopback interface as well
#
ifconfig lo0 127.0.0.1 up


Example 3-5 Ethernet Configuration with dhclient

The following example sysadm.ini fragment creates an interface for an Ethernet device and the loopback interface needed for IP communication. It then creates a BPF device needed by dhclient(1M) and configures the interface.

#
# Set the file creation mask to 0 during system configuration
#
umask 0

#
# Create an Ethernet interface for the first available device
#
# Since no dtree *pathname* is provided, the system uses the first
# device it finds
#
mkdev ifeth 0

#
# Create a loopback interface
# 
# Note that the loopback device is not attached to a device in
# the dtree, so no *pathname* argument is provided here either
#
mkdev lo 0

#
# Create a Berkeley Packet Filter device and special file
#
# The BPF device is used by either the rarp or dhclient command to
# configure the Ethernet interface
#
mkdev bpf 0
mknod /dev/bpf c 23 0

#
# Set the file creation mask back to the default value
#
umask 22

#
# Configure the Ethernet interface using dhclient
#
# Note that BPF must be set to true in order for this to work
#
# dhclient requires a BPF device
#
# dhclient also requires that the dhclient.r actor be included in the 
# system image
#
arun /image/dhclient ifeth0 &

#
# dhclient does not return until the server has responded
#
# Wait until the Ethernet interface is up to avoid confusing the system
#
ifwait ifeth0

#
# Configure the loopback interface as well
#
ifconfig lo0 127.0.0.1 up