MoonPoint Support Logo

 

Shop Amazon Warehouse Deals - Deep Discounts on Open-box and Used ProductsAmazon Warehouse Deals



Advanced Search
November
Sun Mon Tue Wed Thu Fri Sat
       
28  
2007
Months
Nov


Wed, Nov 28, 2007 5:24 pm

Multiple IP Address on a Solaris System

I needed to assign a second IP address to a network interface on a Solaris 2.7 system. The system has 2 network cards, designated hme0 and hme1, each with its own IP address, but I needed to assign a second IP address to the hme0 interface. A webserver, which would normally be at the second IP address, was down and I wanted the webserver on this particular system to assume the functions of the offline system temporarily by responding at the IP address of the server that was down. In order to have a Solaris 2.x system listen on a second IP address on an interface, the following steps can be taken.
  1. Create an entry in /etc/hosts for the second hostname. In this particular case I added a myhost2 entry, so that I had the following entries in the file.
    127.0.0.1    localhost       
    10.0.74.214  myhost1.example.com myhost1   loghost
    10.0.74.193  myhost2.example.com myhost2
    192.168.1.1  janus
    Myhost1 and myhost2 will apply to the same network interface, whereas janus is for the second network interface card in the system. The myhost2 entry is the only new entry.
  2. Create /etc/hostname.hme:n files, or /etc/hostname.le0:n files depending on your system configuration, that contain the hostname for the virtual host n. You don't need to create hostname.hme0:0 as it is the same as hostname.hme0.

The above changes will cause the virtual hosts to be configured at boot time. If you don't want to reboot the system, you can use the ifconfig command to have the system start responding on the second IP address without rebooting.

# ifconfig hme0:1 up
# ifconfig hme0:1 128.183.72.193 netmask 255.255.255.0

References:

  1. FAQs document :How to setup multiple ip for Solaris
    Date: March 30, 1998
    Freelab
  2. Configuring Networking
    By: Keith Parkansky
    Date: May 1, 2002
    Solaris x86

[/os/unix/solaris] permanent link

Valid HTML 4.01 Transitional

Privacy Policy   Contact

Blosxom logo