LinuxQuestions.org

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

branden_burger 03-15-2005 07:02 AM

multiple IPs, one NIC, different networks
 
Hello people.

I have a self managed linux server running FC1. Now I've been given two IP's - on different networks - say 55.100.100.100 and 44.100.100.100 . There's only one NIC hooked up to the internet. That's through 55.100.100.100 now given the netmask of the second ip, can I just put it up on the NIC eth0 like so:

ip addr add 44.100.100.100/netmask dev eth0

I mean even if it did work - why would packets meant for 44.100.100.100/24 travel on the 55.100.100.100/24 network?

I'm asking because I'm remote administering this server and I can't poke around..

Thanks

fr_laz 03-15-2005 07:06 AM

How did you get these IPs ? DHCP ? From a router/fw ?

branden_burger 03-15-2005 07:11 AM

No - these are static addresses provided by the hosting service - not assigned by DHCP. And I'm running iptables, yes - why is that important? I'm not doing SNAT or anything. It's a single box serving mail, web pages etc in some place in Florida.

Thanks

fr_laz 03-15-2005 07:24 AM

Quote:

I'm running iptables
I meant how did you get these IPs, from a dhcp server or from a router/fw ? As you said it, running iptables has nothing to do with your problem.

What's the config now ? The new one should be on the same network, no ?

If you really have to change it now, you could issue the command :
root@machine# ifconfig eth0 55.100.100.100 netmask 255.255.255.0 broadcast 55.100.100.255 ; ifconfig eth0.1 44.100.100.100 netmask 255.255.255.0 broadcast 44.100.100.255
thus you'll configure the 2 IP on the same nic... keep the hand on it and then see which is in use

2 other ideas :
Don't you have the IP of the gateway ? It should be on the same subnet as one of the 2 IPs.
You can also learn the different subnets by doing a traceroute to the server....


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