# multiple ip's, one nice

## Rain Designs

I know this a newbie question, but if I am given these 2 ips:

66.12.66.86

66.12.66.87

by my ISP, how do I set up my box to run both those IP's through one nic?

Once again I know this is a newbie questions, but hey, I'm a newbie!

Thanks in advance,

-Rain

----------

## nitro322

From google:

 *Quote:*   

> if you want to bind two seperate ips to the same interface, do this:
> 
> ifconfig eth0:0 <first ip> netmask <whatever your netmask is> up
> 
> ifconfig eth0:1 <second ip> netmask <whatever your netmask is> up
> ...

 

I'm sure you can find a lot more info out there about this if necessary, just search google.

----------

## psp

akisan has it right! Edit your /etc/conf.d/net. Uncomment the alias_eth0.... part and add the other ip address. Then run: /etc/init.d/net.eth0 restart

Example for eth0:

---------------------

iface_eth0="66.12.66.86 bradcast <your_broadcast> netmask <you_netmask>"

alias_eth0="66.12.66.87"

gateway="<your_gateway>"

Hope this is useful. I suggest reading more docs on what exactly this does and what else you can do.

----------

## Rain Designs

I'll try both ways when I get home  :Very Happy: 

Thanks for the help!

-Rain

----------

## OdinsDream

Sorry, but what purpose does it serve to bind two ip addresses to a single interface?

----------

## rac

 *OdinsDream wrote:*   

> Sorry, but what purpose does it serve to bind two ip addresses to a single interface?

 

IP-based virtual hosting, for one.

----------

## ramon

 *Quote:*   

> Sorry, but what purpose does it serve to bind two ip addresses to a single interface?

 

I use it on a Sun Solaris server to have it answer to the internal network with one IP and to the DMZ with another IP

(there in different adress-ranges)

I don't want to add a second nic....

That way I can use services allowed on the internal network to connect to the server which are not allowed for anyone connecting from the outside.

Grtz Ramon

----------

