LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   bind 2 ip addresses to the server (https://www.linuxquestions.org/questions/linux-newbie-8/bind-2-ip-addresses-to-the-server-252378/)

txm123 11-08-2004 07:08 AM

bind 2 ip addresses to the server
 
Hello,

I need to bind 2 ips to the server(they are in my given ip ranged but haven't been bound to the server). Any idea how I can do this?

Thanks

looseCannon 11-08-2004 08:11 AM

You can set both addresses on the same network card. One will be assigned to the card itself, the other will be an alias to the card.

Primary address: ifconfig eth0 1.2.3.4 netmask 255.255.255.0
Second address: ifconfig eth0:1 1.2.3.5 netmask 255.2555.255.0

There is still some thingss that aren't known. Is this behind a firewall? Are addresses being natted? Is this for a server on the internet or on your intranet?

All of these make a difference in how things are set up.

amfoster 11-08-2004 12:31 PM

The above means of binding IP addresses to a single NIC are good with a few exceptions. eth0:0 is the first usable one.

The second point is that those created IP addresses are only good untilo you reboot.

If you are using redhat, create separate files for
/etc/sysconfig/network-scripts/ifcfg-eth0 ifcfg-eth0:0 and ifcfg-eth0:1 etc

If you are using debian based, then the file to edit is /etc/network/interfaces


All times are GMT -5. The time now is 08:59 AM.