Unix Tip #4519- July 26, 2014


SEARCH : Home : Help : Today's Tip

MULTIPLE IP ADDRESSES


Ever wanted to make your
m/c support more than one
IP addresses?

Well, here is the good
old way:

1. To make a machine support
a new (virtual) IP address:

$ ifconfig hme0:1 132.186.67.157 255.255.254.0 132.186.67.255 up

Where:
- First param is hme0 is
the physical name of the
primary interface for your
m/c, (it can be e.g. le0
for other flavours).
':1' is the logical name.
To make it simple, logical
name is kinda branch of the
original. So basically what
your doing with this command
is making hme0 to support one
more IP address on a new
branch named 'hme0:1'.

- Second param is 'new the IP
address'.

- Third and Fourth are netmask
and broadcast address
respectively. Contact your
SysAdm or RTFM. :).

Note: bringing up a virtual IP
address on a node can be
divided in two steps:
1> Create
2> Bring up.
In this case both are done by
this one command.

- Fifth one you know,
don't you?

2. To bring this virtual IP
address down (without
deleting it):

$ ifconfig hme0:1 down

3. To bring this virtual IP
address up agn(hme0:1 has to
exist for this):

$ ifconfig hme0:1 up

4. To delete this virtual
IP address:

$ ifconfig hme0:1 0 down

Note: Assigning 0 as IP
address, deletes it.

IMPORTANT: All of these commands
requires root permission. If
user with lower authority try
to do this, the result may not
be good.

(manuals say problems arising
from that can be tough to
diagnose)

Wondering about where to
use it: We're using this in a
cluster environment to give
client only one IP address
which we make sure is always
up n running on one of the
nodes.


This tip generously supported by: bhatt.kashyap@blr.spcnl.co.in

NOTE: All tips provided are USE AT YOUR OWN RISK. Tips are submitted by various unix admins around the globe. UGU suggest you read and test each tip in a non-volitile environment before placing into production.


LAST 5 TIPS
4518 - LINE # OF A PATTERN
4517 - SPLIT SCREEN EDITING
4516 - ACCIDENTS WITH CRONTAB
4515 - ROTATE THE ALPHABET
4514 - RECREATING DIRECTORY TREES


I want to SUBSCRIBE and get a UGU Tip everyday.
I want to UNSUBSCRIBE and NOT get a UGU Tip everyday.

If you have a UNIX TIP let us know, we just may use it:
(All tips become the property of the Unix Guru Universe)
Email Address:

Yes, email me a Hot Unix Tip everday.

Enter Hot Unix Tip (optional):

Yes, I will support this tip

Captcha (not case sensitive):


Please enter the above letters:


HOME | Flavors | Admin | Network | Security | S/W | Help | Events | Vendors | Careers | Internet
About | Add Link | Feedback | Search

Copyright © 1994-2005 Unix Guru Universe