Technical Tip

QUESTION

How can I get my Sun workstation to respond to two different IP addresses?

ANSWER
  1. Each device on an IP based ethernet needs to have a name. Since your workstation is going to be (in effect) TWO devices, you need to choose a second name. That second name needs to be added to the file /etc/hosts on the workstation, AND to the database on any name service systems that will include it in their domain. Example. If you have a system known as "herring" which responds to the IP address 192.9.200.47, and you also want it to respond to 155.134.44.17 as "jupiter", the you will ensure that you have both the following lines in /etc/hosts:
      192.9.200.47 herring
      155.134.44.17 jupiter

  2. You now need to choose which ethernet interface the second address will be used on.
    • If it will be used on the SAME interface that you already use (for "herring") in our example, then you run the ifconfig command to bring the second name into use, as follows:
        ifconfig eri0:1 plumb; ifconfig eri0:1 jupiter up
        (in this example, the default interface has the name "eri0")
    • If it will be used on a second interface, then you can run the ifconfig command as follow:
        ifconfig eri1 plumb; ifconfig eri1 jupiter up
        (where "eri1" is the name of the second interface.)
    At this point your system is responding to the second IP address, but:
    • It will NOT be routing information between networks
    • The second interface will NOT restart if you reboot, nor will the eri0:1 interface.

  3. If you wish to make the arrangement permanent, then you need to create a file called "/etc/hostname.xyz", containing just the hostname or IP address of the second interface ["xyz" is the interface name]

    In our example, the file will be called

      /etc/hostname.eri0:1 (for a second address on one interface)
      /etc/hostname.eri1 (for a second interface)
    and would (in either example) simply contain the word
      jupiter

    The IP address could be used instead.

  4. When you reboot the workstation, it will bring the extra IP address into use.  It may also start the routing daemon "in.routed" depending on the system routing configuration. (On Solaris 10, see the routeadm command)

  5. If you do NOT wish your interface to route packets, create a file called /etc/notrouter (Solaris 9 and earlier) or run the routeadm command on Solaris 10 to disable packet forwarding.

First Alternative course tutors can answer questions like this ... and are happy to do so. Look around our site for relevant courses in Unix - Perl - Solaris - FrameMaker

close window