?
Solved

Binding IP addres to NIC card.

Posted on 1998-08-07
1
Medium Priority
?
215 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 2

Accepted Solution

by:
blowfish earned 200 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
A metadevice consists of one or more devices (slices). It can be expanded by adding slices. Then, it can be grown to fill a larger space while the file system is in use. However, not all UNIX file systems (UFS) can be expanded this way. The conca…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

650 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