Monday, March 29, 2010

Administer Interfaces Under Solaris



Administer Interfaces Under Solaris

Abstract:


Under Solaris, users could configure some flat files and reboot a system in order to bring up their machine on an IP network. The startup scripts under Solaris traditionally leveraged the straight "ifconfig" command to add the network interfaces for the IP layer. The command for managing interfaces as the data link layer had been "dladm". Sun also bundled "IPFilter" into Solaris 10 for firewalling and NAT'ing. Configuring the various IP interfaces has been somewhat complex, so a new user friendly command has recently landed in OpenSolaris to help: "ipadm".

Configuration File Method:

The configuration files which are normally leveraged to configure a simple system before restart include:
  • /etc/inet/hosts
    Holds the IP Address & hostname of the machine. Can also be used for the default router. Example entries include:
    192.168.3.250 Ultra60 loghost
    192.168.3.1 WRT600 defaultrouter


  • /etc/inet/ipnodes
    Holds the IP Address & hostname of the machine. Can also be used for the default router. Example entries include:
    192.168.3.250 Ultra60 loghost
    192.168.3.1 WRT600 defaultrouter

  • /etc/netmasks
    Hosts the address of the network that the machine is sitting on. Example entry includes: 192.168.3.0 255.255.255.0

  • /etc/defaultrouter
    Holds the IP Address or host name of the default router. Example entry includes:
    defaultrouter

  • /etc/hostname.[interface]
    Holds the hostname for the physical[:logical] IP interface. Example for "ce0" includes:
    Ultra60
The "files" method is persistent across reboots, but of course requires a reboot. If a reboot is not possible, then follow the instructions below to perform the On-Line Method of configuration.

On-Line Method:

For people who can not afford to perform reboots of a system, interfaces can be added while the operating system remains on-line using the "ifconfig" command.
  • ifconfig [interface] plumb
    Puts the "plumbing" in place to configure an IP interface. Example command:
    ifconfig ce0 plumb

  • ifconfig [interface] addif [ipaddress/netmask]
    Assigns an address to a plumbed interface.
    ifconfig ce0 addif 192.168.3.2/24
In order for on-line changes to be persistent across reboots, it is important that the Configuration File Method has already been followed.



The New Method

With the PSARC/2010/080, OpenSolaris includes a unified interface to build interfaces on-line, which can also be made persistent.

For some examples on how to use the new OpenSolaris "ipadm" command are here.

We are all looking forward to this making it into Solaris!

No comments:

Post a Comment