[Gllug] Multiple IPs on one interface in RedHat

Vincent AE Scott gllug at codex.net
Thu Oct 3 23:13:35 UTC 2002


Paul(paul at rbg.uklinux.net)@Thu, Oct 03, 2002 at 09:40:53PM +0100:
> I've got a RedHat 7.1 server with one ethernet card and an IP which is
> in the process of being changed over. At the moment it the card has two
> IP addresses, but the old one will be phased out soon:
> I've done "/sbin/ifconfig eth0:0 xx.yy.zz.tt" to create an interface
> alias for the new IP address. This seems to work but how do I get it to
> come up OK on reboot?
> 
> I think I need to add:
> /etc/sysconfig/network-scripts/ifcfg-eth0:0
> with appropriate entries.

i am not a redhat expert, but if memory serves correctly, then yes that
is teh way to do it.

 
> but what do I do with:
> /etc/ifconfig/network?
> at the moment it just says:
> 
> NETWORKING=yes
> HOSTNAME="my.domain.com"
> GATEWAY="111.222.333.444"
> GATEWAYDEV="eth0"
> FORWARD_IPV4="no"
> 
> (where I've obfuscated the real IP/domain)

this is just for teh default routing information.

 
> can I have this define two GATEWAY or GATEWAYDEV entries at once?

i doubt it.  having an idea about how the contents of that file are
manipulated from the shell.

> or do I need to switch over the gateway from one IP to the other at some
> point?

on a mandrake install, IIRC you add extra routes via the file
/etc/sysconfig/static-routes where you can add extra routes to other
networks.  i think this should be fairly similar on redhat.

 
> I'm taking this slowly because I don't want to restart the networking
> and lock myself out. If I have an ssh connection already open when I
> restart the networking will it die or can I use it to rectify my
> mistake?

a wise decision.  that kind of depends, if you had a static route to
another network, upon which you had a box with access, then you'd
probably still be able to login to it.  remember, if you only have one
default route, and thats removed, or inocrrect for the network
configuration, then yes, you will be locked out.

 
> I know also I'll have to tweak bind and apache but getting this wrong
> isn't so crucial.

true, ensuring you still have network access is the most important
thing.  my advice would be to have the aliased interfaces, until you are
confident that you can make the necessary editions and reboot, and still
have access.  in theory, the simplest way, is to edit the config file
which gets the NIC's main IP address, along with the config which
controls the default route.  reboot, and hey presto it should all be
working.  but there are other things you should understand, like do you
have any firewalling rules?  if eth0's IP changes maybe the rules will
stop you from logging in... etc.

i know of at least one linux distro, that will fail to bring up sshd if
any of the interfaces fail to start.  i dont think redhat falls into
this category tho.

-v

-- 
keys:  http://codex.net/pgp/gpg.asc http://codex.net/pgp/pgp.asc

 To err is human...to really foul up requires the root password
 -- David Weingart


-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list