LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   multiple IPs, one nic (https://www.linuxquestions.org/questions/linux-networking-3/multiple-ips-one-nic-143132/)

v4lu3s 02-06-2004 06:27 PM

multiple IPs, one nic
 
I am having a hard time with this...i ahve added 2 additional IPs to my NIC, using /etc/sysconfig/network-scripts/ and then creating ifcfg-eth0:1 and ifcfg-eth0:2 . I copied ifcfg-eth0 and edited the IP address and device name. All three interfaces come up at boot time.
However when i try to ping those IPs from another network they do not reply, and when i ping FROM them it only sends ONE packet and then hangs. I can traceroute out just fine as well though. It doenst seem to make sense to me.
My other issue is that I am working on getting a dns caching server running on the alternat IP addresses.
Is it possible that iptables is interfering with traffic on those IP addresses?
If anyone has ANY ideas it will help save some of my hair

thanks!

Astro 02-06-2004 11:36 PM

From prior experience with binding multiple IP's to an interface I can say it does work. I've used it in SNAT(Static Network Address Translation) for boxes behind a firewall. This was done with shorewall and webmin... a nice combination. Check that out.. www.webmin.com and www.shorewall.net

ugge 02-07-2004 05:41 AM

I have heard that using to IP's on one NIC might be a problem if they are in the same network.
That is 192.168.0.1/24 and 192.168.0.2/24 would be a problem, but 192.168.1.1/24 and 192.168.0.1/24 would work fine.

This has to do with routing as routing depends on the network part of the IP address for it's path decision. There might be a way to get it working, but I donät know how.

v4lu3s 02-07-2004 10:34 AM

well i ended up getting it working. turns out webmin had botched my ip tables rules some how. i went back in and ran the lokkit config tool and suddenly everything worked perfectly. I am running 3 ip addresses on one Nic all on the same network. It was frustrating becuase i was doing it just like a server at work that had 256 ips on one NIC.
Anyway all I did was copy the ifcfg-eth0 to ifcfg-eth0:0 and edit the interface name and ip address and it worked great!

Astro 02-07-2004 10:52 AM

Quote:

Originally posted by ugge
I have heard that using to IP's on one NIC might be a problem if they are in the same network.
That is 192.168.0.1/24 and 192.168.0.2/24 would be a problem, but 192.168.1.1/24 and 192.168.0.1/24 would work fine.

This has to do with routing as routing depends on the network part of the IP address for it's path decision. There might be a way to get it working, but I donät know how.


We run about 10 IP's off the same nic for a firewall setup at the isp where I work, never had a problem with it. They are all on the same subnet as well.


All times are GMT -5. The time now is 03:42 AM.