Solved

Binding IP addres to NIC card.

Posted on 1998-08-07
1
196 Views
Last Modified: 2013-12-16
Were running solaris 2.5 and need to know how to add virtual domains to our box. I know how to add it to apache.
Need to be able to add ip without rebooting server.

0
Comment
Question by:simlab
1 Comment
 
LVL 2

Accepted Solution

by:
blowfish earned 50 total points
ID: 1812581
The ifconfig command will dynamically add a virtual interface to listen to a specific IP address (assuming 192.168.100.5)

First, determine if your system is using le0, or hme0 like so;

# ifconfig -au

lo0: flags=849<UP,LOOPBACK,RUNNING,MULTICAST> mtu 8232
        inet 127.0.0.1 netmask ff000000
hme0: flags=863<UP,BROADCAST,NOTRAILERS,RUNNING,MULTICAST> mtu 1500
        inet 192.168.100.3 netmask ffffff00 broadcast 192.168.100.255


Next, add the virtual interface (assuming 192.168.100.5) like so;

#  ifconfig hme0:5 inet 192.168.100.5 up -trailers

In the previous command, the interface name is hme0:5, you can use any digit(s) after the colon, by convention I use the trailing digit(s) of the IP address.  

You can display the newly created interface, using ifconfig -au, and should see the following;

hme0:5: flags=863<UP,BROADCAST,NOTRAILERS,RUNNING,MULTICAST> mtu 1500
        inet 192.168.100.5 netmask ffffff00 broadcast 192.168.100.255

You can check that the interace is properly configured and running using ping, first from the local workstation, then from a different workstation.  

Note that the ifconfig command adds the interface dynamically.  You must still edit configuration files in /etc if you want the interface to exist after a system reboot.  For each virtual interface, create a file in /etc named in the following form;  /etc/hostname.hme0:5, where the digit(s) following the colon are the trailing digit(s) from the IP address.  The contents of each file will be the actual IP address assigned to the virtual interface by the ifconfig command at boot time.  (NOTE, you could define a hostname and IP address in /etc/hosts and use the hostname rather than the IP address in the files that you are creating).  

Here's an example;

#  cat /etc/hostname.hme0:231
192.168.100.231

0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In tuning file systems on the Solaris Operating System, changing some parameters of a file system usually destroys the data on it. For instance, changing the cache segment block size in the volume of a T3 requires that you delete the existing volu…
Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question