?? Bind 2 IP addresses to 1 NIC

?? Bind 2 IP addresses to 1 NIC

Post by Chris Smit » Thu, 18 Jul 1996 04:00:00



Does anyone know how to bind a 2nd (or third) ip address to the
same interface?  I read through the Solaris 2.4 TCPIP Admin book,
but it did not mention how to get the 2nd address bound.  
I can change it with ifconfig, but not add a 2nd address.

Thank you.

Chris Smith

 
 
 

?? Bind 2 IP addresses to 1 NIC

Post by Matthew Marshal » Fri, 19 Jul 1996 04:00:00



> Does anyone know how to bind a 2nd (or third) ip address to the
> same interface?  I read through the Solaris 2.4 TCPIP Admin book,
> but it did not mention how to get the 2nd address bound.
> I can change it with ifconfig, but not add a 2nd address.

> Thank you.

> Chris Smith


Yeah,
What you do is this:
1. enter in the command /usr/sbin/ifconfig -a
2. THis will tell you what your network interface is.
3. Somethink like this will appear:
le0: flags=863<UP,BROADCAST,NOTRAILERS,RUNNING,MULTICAST> mtu 1500
        inet 'your ip address here' netmask ffffff00 broadcast
'broadcast address' ether 'ethernet address'

le0: is your interface name.

To bind them. just use this command.
/usr/sbin/ifconfig le0:1 <ip address> up

Do not put in the <> before and after you ip address.

if you want to do another one:
/usr/sbin/ifconfig le0:2 <ip address> up
and so on and so on..

##########################
Matthew Marshall / Systems Administrator / Sheridan Electronic Systems
400 E Pratt St.
Baltimore, MD 21202
(410)576-8752
http://www.sheridan.com

 
 
 

?? Bind 2 IP addresses to 1 NIC

Post by Ed Men » Sat, 20 Jul 1996 04:00:00





>> Does anyone know how to bind a 2nd (or third) ip address to the
>> same interface?  I read through the Solaris 2.4 TCPIP Admin book,
>> but it did not mention how to get the 2nd address bound.
>> I can change it with ifconfig, but not add a 2nd address.

>> Thank you.

>> Chris Smith

>Yeah,
>What you do is this:
>1. enter in the command /usr/sbin/ifconfig -a
>2. THis will tell you what your network interface is.
>3. Somethink like this will appear:
>le0: flags=863<UP,BROADCAST,NOTRAILERS,RUNNING,MULTICAST> mtu 1500
>        inet 'your ip address here' netmask ffffff00 broadcast
>'broadcast address' ether 'ethernet address'

>le0: is your interface name.

>To bind them. just use this command.
>/usr/sbin/ifconfig le0:1 <ip address> up

>Do not put in the <> before and after you ip address.

>if you want to do another one:
>/usr/sbin/ifconfig le0:2 <ip address> up
>and so on and so on..

>##########################
>Matthew Marshall / Systems Administrator / Sheridan Electronic Systems
>400 E Pratt St.
>Baltimore, MD 21202
>(410)576-8752
>http://www.sheridan.com

& touch /etc/notrouter ?
 
 
 

?? Bind 2 IP addresses to 1 NIC

Post by Jeff Saxt » Tue, 23 Jul 1996 04:00:00






>>> Does anyone know how to bind a 2nd (or third) ip address to the
>>> same interface?  I read through the Solaris 2.4 TCPIP Admin book,
>>> but it did not mention how to get the 2nd address bound.
>>> I can change it with ifconfig, but not add a 2nd address.

>>> Thank you.

>>> Chris Smith

>>Yeah,
>>What you do is this:
>>1. enter in the command /usr/sbin/ifconfig -a
>>2. THis will tell you what your network interface is.
>>3. Somethink like this will appear:
>>le0: flags=863<UP,BROADCAST,NOTRAILERS,RUNNING,MULTICAST> mtu 1500
>>        inet 'your ip address here' netmask ffffff00 broadcast
>>'broadcast address' ether 'ethernet address'

>>le0: is your interface name.

>>To bind them. just use this command.
>>/usr/sbin/ifconfig le0:1 <ip address> up

>>Do not put in the <> before and after you ip address.

>>if you want to do another one:
>>/usr/sbin/ifconfig le0:2 <ip address> up
>>and so on and so on..

>>##########################
>>Matthew Marshall / Systems Administrator / Sheridan Electronic Systems
>>400 E Pratt St.
>>Baltimore, MD 21202
>>(410)576-8752
>>http://www.sheridan.com

>& touch /etc/notrouter ?

Under Solaris2.4 or greater this is an easy matter
1) run 'ifconfig -a' to get the name of your interface
   you will get output that looks like this
   (note I am running SolarisX86 so your device name may vary):

lo0: flags=849<UP,LOOPBACK,RUNNING,MULTICAST> mtu 8232                
        inet 127.0.0.1 netmask ff000000                              
elx0: flags=863<UP,BROADCAST,NOTRAILERS,RUNNING,MULTICAST> mtu 1500  
        inet 206.222.38.11 netmask ffffff00 broadcast 206.222.38.255  
        ether 0:a0:24:90:96:4b                                        

the first entry is the software loopback the interface we are interested in
is the second entry (in my case elx0)

2) use ifconfig to configure the second IP address

ifconfig elx0:1 inet 206.222.38.12 up<CR>

3) use arp so your network card will respond to packets sent to the
   new IP address. For this you must no the MAC address of the network
   interface (we get this from the ether field above):

arp -s 206.222.38.12 0:a0:24:90:96:4b pub

The machine will now respond to the second IP address.

I have this working with >200 "virtual" IP addresses on a single system
there should be no problem running the max (256).

Hope this is useful as the previous posters failed to inform you
of the necessity of the arp command.