SuSe Linux virtual IP config
Martijn van Oosterhout
kleptog at svana.org
Tue Oct 9 17:43:07 EST 2001
On Tue, Oct 09, 2001 at 05:09:44PM +1000, Kim Holburn wrote:
> Hi,
>
> I want to add a virtual IP to a suse linux box. I think I have to add the
> new IP to /etc/rc.config to IPADDR_1, IFCONFIG_1 but I think I need to add
> a device to NETDEV_1. Should NETDEV_1 be eth0 or eth0:0/eth0:1 .
>
> If you're not familiar with suse how about the actual ifconfig line that
> gets executed. Does it use eth0 or eth0:0 for virtual IP addresses?
Actually, it can be done either way, depending on your kernel.
With pre-2.4 kernels, each interface could only have one IP so someone added
an IP aliasing hack involving the colon. eth0:0 is an alias for eth0. You
configure it like any normal interface.
ifconfig eth0:0 192.168.0.14 up
In 2.4 that was fixed and now an interface can have as many IP addresses as
it wants, even entire subnets. It's not used too much since it is a bit more
complicated, not as easy as the above. It works something like:
ip addr add 192.168.0.14 dev eth0
Although it can get much more complicated. There are some howtos and man
pages around that can help you.
HTH,
--
Martijn van Oosterhout <kleptog at svana.org>
http://svana.org/kleptog/
> Magnetism, electricity and motion are like a three-for-two special offer:
> if you have two of them, the third one comes free.
More information about the linux
mailing list