-   Linux - Networking (
-   -   Setting up dual IP's one NIC (

INS 04-10-2001 07:57 PM

I am running RH7.0 server. I have recently gotten a range of static IP's. I need to configure my RH box to work in my existing network, but also need it to work w/ one of the static IP's.

Things were running fine, until I got the static IP's and my default gateway changed from to I have seen posts that a NIC can have 2 IP's in Linux (heck it was easy for me on NT) but being new to Linux I am lost. I have tried multiple "settings" in linuxconf, but none really work as needed.

With it's original ip ( my internal network "sees" the system fine, but mail won't transfer to the outside world and the web does not work either. If I change the IP to the external one, the web works but then my local systems can't find the mail server to send mail.

Help! Please.... I don't mind reading so even a link would help, which I will be looking for next.

Thank you any and all in advance,
INS aka Henry

INS 04-10-2001 10:12 PM

found it
I did find the answer on a RedHat discussion form. But for those of you woundering the same thing here is what I found:


It is actually just about as easy as it is in NT. It is called IP aliasing, and Red Hat compiles it into their kernels. It works almost the same as a normal interface *except* the statistics are for the physical card, not each individual IP address. So if I wanted to setup an IP alias on eth0 I would create a file:


And that file might look something like this:


Then restart your networking (/etc/rc.d/init.d/network restart). IP aliasing is entirely virtual, so no modules need to be loaded or anything like that (although the ip_alias code can be compiled as a module and loaded that way as well). You can check the interface like this:

ifconfig eth0:0

and it will report the setup of the interface. Once you're done with that and the IP address is working properly, you can set up the IP-based virtual hosting in httpd.conf.


I forgot to add:


to the above configuration.

The only change I made to the above instructions was that I setup the external IP as the "main" IP of the system and setup the alias (eth0:0) to be my internal. I don't think I had to, but it works. That is all that matters right????
OK, I will probably double chek that later to find out for sure.

The actual web link is:^1@.ee6c672/0

Thanx again,

crnaik 01-28-2004 05:18 AM

Is anything more need????
I have also tried with the same but it is not working at my side. Is anything more needed to configure two IP addresses on a single NIC???

Though I am setting up one internal and one external IP address.

Thank You

All times are GMT -5. The time now is 01:52 PM.