Sun Microsystems - Solaris Support website.

Thursday, December 01, 2005

CONFIGURING YOUR NIC IN SOALRIS 10

CONFIGURING YOUR NIC IN SOLARIS 10

Many times configuring our Ethernet or NIC has become a pain a remember when I started learning the road of Solaris 10, fortunately hopefully this little HOW-TO will showed you how to assign an IP to your Network Adaptec.

Configuring for IPv4 with Fixed Address
To configure for a fixed IPv4 address, you must place the IP address of your network in /etc/hostname. interface, where interface is the name of the interface to use, such as afe0. The following example shows this, for a system that wishes to use the IP address 192.168.128.101. (Replace with your real IP address.)

# echo 192.168.128.101 > /etc/hostname.afe0

The interface will now automatically be configured the next time the system boots. To configure the interface for immediate use, without rebooting, the the ifconfig(1M) command can be used. Note that you must first "plumb" the interface using a command of the following form:

# ifconfig interface plumb

Until the interface is plumbed in this fashion, it will not display in the list of available interfaces (with the ifconfig -a command.)

Note that this is only the first part of network configuration. You may have to edit several other files, such as /etc/hosts, /etc/resolv.conf, /etc/netmasks, and /etc/defaultrouter to properly configure your network.

The generalities of network configuration on Solaris are well documented in the Solaris 8 System Administration Guide, Volume 3 , which can be accessed on-line at http://docs.sun.com/.

Configuring for IPv4 with DHCP

To set up your ethernet device to act as a client for DHCP (Dynamic Host Configuration Protocol) you must create a file /etc/dhcp. interface. This file should contain the word primary if the interface is your primary (or only) network interface. This will cause DHCP to be used to set the hostname, default route, and other global parameters for the system, in addition to the interface-specific configuration.

If the file is empty, then DHCP is only used to configure the interface and global parameters such as the hostname will not be adjusted.

The following example shows how to enable the interface mxfe0 as the primary (and only) interface, using DHCP.

# echo primary > /etc/dhcp.mxfe0

Note that the configuration does not take effect until the next time the system is rebooted. The auto-dhcp sub-command of ifconfig can be used to configure the interface from DHCP without rebooting. (The interface must first be "plumbed" though.) The following example demonstrates use of ifconfig to configure afe1 via DHCP for temporary use without rebooting.

# ifconfig afe1 plumb auto-dhcp

See the ifconfig(1M) manual page for more information.

Configuring for IPv6 with Autoconfiguration

In IPv6, address autoconfiguration is commonly used to configure the address(es) that are used on a network interface. In most cases, static addresses will not be used with IPv6. To configure the device to use address autoconfiguration (for example, via the neighbor discovery protocol), all one needs to do is create an empty /etc/hostname6. interface file. For example, the following command enables IPv6 to be used with address autoconfiguration on the mxfe0 interface.

# touch /etc/hostname6.mxfe0

Similar to the IPv4 case, this does not take effect until the machine is rebooted. To configure an interface for IPv6 autoconfiguration temporarily, without rebooting, use a command similar to the following:


Configuring for IPv6 with Static Addressing

Static addressing is much less likely to be used with IPv6, but it can still be done. With static IP addressing, one just needs to put the hostname or IPv6 address in the /etc/hostname6. interface file.

Again, a reboot is required for this to take effect. There is also an ifconfig command that can be used for this as well. It typically takes the form:

# ifconfig afe0 inet6 plumb addif 1234::5678/64 up

In the above address the address 1234::5678/64 was added to the afe0 interface. Please refer to the Solaris 8 System Administration Guide, Volume 3 for more information about IPv6 addressing.

Configuring for Use with Other Protocols

There are protocols besides IPv4 and IPv6 that can be used with ethernet. Some examples of these are Apple's AppleTalk and Novell's IPX/SPX protocols. These protocols should work fine with your new ethernet device. The details of configuring such protocols to use the ethernet device should be documented in your network protocol software documentation. You should be able to just replace the name of your interface (for example afe0) for the name of any other "standard" interface (for example hme0) to which the documentation might refer.

Note however while all this should work, it has not be tested for use with these drivers, so your results may vary. But it is hoped and believed that these drivers will function properly with any other Solaris networking software. I would like to give special thanks to Jamesd and the many other member of the opensolaris channel at IRC who encourage new member to keep on. Thank you Guys.

0 Comments:

Post a Comment

<< Home