Solved

Binding IP addres to NIC card.

Posted on 1998-08-07
1
202 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Search for selected keywords and its values in multiple log files 11 65
Java core in Solaris 10 1 307
Unix Question 19 53
lunix and unix command 21 112
This tech tip describes how to install the Solaris Operating System from a tape backup that was created using the Solaris flash archive utility. I have used this procedure on the Solaris 8 and 9 OS, and it shoudl also work well on the Solaris 10 rel…
Installing FreeBSD… FreeBSD is a darling of an operating system. The stability and usability make it a clear choice for servers and desktops (for the cunning). Savvy?  The Ports collection makes available every popular FOSS application and packag…
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…
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.:

685 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