PDA

View Full Version : IP alias on NIC


sdotsen
15th February 2009, 05:35 PM
I have to move our DNS server to our VMware environment. With that comes a new IP address (10.10.102.x). The current address is in the 192.168.10.x. range. Is there a way to bind an alias to my NIC that has a different IP range? I tried it and it didnt work but if i used two IPs in the same subnet range it works. What are my options?

I don't want to go around and modify all my clients to use the new IP. I have many other things running like Nagios and Puppet. Unfortunately this is going to suck and I probably dont have any other options. ANy ideas?

SuperSkippy
15th February 2009, 06:52 PM
How did you try?

1) Doing it by hand for eth0, using the command line. Change ip, eth0, subnet mask as appropriate.
ifconfig eth0:1 10.10.102.x netmask 255.255.255.0

This will work, but it when you reboot your computer it won't come back up

2)
Create /etc/sysconfig/network-scripts/ifcfg-eth0:1 like

DEVICE=eth0:1
IPADDR=whatever
NETMASK=whatever
TYPE=Ethernet
ONBOOT=yes
BOOTPROTO=none

(I've done this file from memory, so it might not be quite right). /etc/init.d/network restart and everything should come up like you want.

sdotsen
16th February 2009, 02:40 AM
no, the issue is i want to have eth0 on 10.10.102.103 and then eth0:0 on 192.168.10.30
i can get it to work if both "NICs" were on the same subnet but not on different subnet.

scottro
16th February 2009, 03:24 AM
This might work. (Untested)




http://www.sysresccd.org/Sysresccd-networking_en_Basic-IP-configuration-tools-on-linux

Found with googling linux ip alias different subnet.

It looks like it's possible and probably not that difficult.

I repeat, untested by myself, so it might turn out to be more complex than that page makes it sound.

SuperSkippy
16th February 2009, 01:13 PM
no, the issue is i want to have eth0 on 10.10.102.103 and then eth0:0 on 192.168.10.30
i can get it to work if both "NICs" were on the same subnet but not on different subnet.

Yeah, so
ifconfig eth0 10.10.102.103 netmask 255.255.255.0
ifconfig eth0:0 192.168.10.30 netmask 255.255.255.0

and done.

What happens when you try this? What's the output of ifconfig after this? If it doesn't work, how do you know?

sdotsen
16th February 2009, 01:59 PM
thx for the link to the page, i'll try it when i get to the office.

i tried the commands you had in your last post before but it didn't work.
From the server I was able to ping itself (the secondary IP - eth0:0). From my workstation, I was not able to ping the second IP but I am able to ping it's primary IP (eth0).

I think it has to do w/ the blade itself. My VMs are in a vmware environment on an HP blade chassis. It is VLAN with 10.10.102.x. I just thought about this last night, it may not work.

SuperSkippy
16th February 2009, 03:13 PM
Yes, I think you've got the Fedora bit correct, and it's something to do with the networking (switching, or routing or whatever). When you say VMware, do you mean GSX or VMWare Infrastructure or something like that? I don't really know much about how the virtual networking works on that. You'd have to describe how the virtual networks are laid out if you want any more help from us.

scottro
16th February 2009, 04:53 PM
IF (and only if--haven't used VMware in awhile) I remember correctly, it usually defaults to host networking by default--that is, taking a place on the same subnet as the host.

However, there is also a NAT option, which might default to the 10.10.x.x option. (This is simply guessing on my part, extrapolating from KVM-qemu and VirtualBox).

See if you can find out if it's host networking or NAT networking.

Creek Side - Stockholm-Arlanda Airport (ARN) Travel Photos on Instagram - Marina of Koper Travel Photos - Te Whiti Park Instagram Photos - Texas State Fair Photos on Instagram