Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding Additional Ip's to same interface

Status
Not open for further replies.

jared71

MIS
Jul 2, 2001
58
US
Hello,

Is there any way to add additional IP addresses to the same physical interface. I know you can add up to 255 using the ifconfig command, however, I was looking for a configuration change (such as a config file) that stuck around after a reboot.

Any help would be greatly appreciated.

Jared
 
With Solaris 2.x it is possible to configure multiple IP addresses for a single physical interface. This allows a machine with a single ethernet card to appear as an entire network of different machines.

In order to configure the lance ethernet (le0 or hme0) device to support more than one ip address, do the following:

1. Create entries in /etc/hosts for each hostname your physical machine will appear as.

128.195.10.31 myhost
128.195.10.46 myhost2
128.195.10.78 myhost3

2. Create /etc/hostname.le0:n files that contain the hostname for the virtual host n. Note that hostname.le0:0 is the same as hostname.le0

/etc/hostname.le0 (Contains name myhost)
/etc/hostname.le0:1 (Contains name myhost2)
/etc/hostname.le0:2 (Contains name myhost3)

or

/etc/hostname.hme0 --> 10/100Mbit/sec high speed interface
/etc/hostname.hme0:1
/etc/hostname.hme0:2

The above changes will cause the virtual hosts to be configured at boot time. You can also directly enable/modify a logical hosts configuration by running ifconfig directly on one of the logical hosts by using the le0:n naming scheme.

% ifconfig le0:1 up
% ifconfig le0:1 129.153.76.72
% ifconfig le0:1 down

or

% ifconfig hme0:1 up
% ifconfig hme0:1 129.153.76.72
% ifconfig hme0:1 down
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top