Ever wanted to make your
Ever wanted to make your
m/c support more than one
m/c support more than one
IP addresses?
IP addresses?
Well, here is the good
Well, here is the good
old way:
old way:
1. To make a machine support
1. To make a machine support
a new (virtual) IP address:
a new (virtual) IP address:
$ ifconfig hme0:1 132.186.67.157 255.255.254.0 132.186.67.255 up
$ ifconfig hme0:1 132.186.67.157 255.255.254.0 132.186.67.255 up
Where:
Where:
- First param is hme0 is
- First param is hme0 is
the physical name of the
the physical name of the
primary interface for your
primary interface for your
m/c, (it can be e.g. le0
m/c, (it can be e.g. le0
for other flavours).
for other flavours).
':1' is the logical name.
':1' is the logical name.
To make it simple, logical
To make it simple, logical
name is kinda branch of the
name is kinda branch of the
original. So basically what
original. So basically what
your doing with this command
your doing with this command
is making hme0 to support one
is making hme0 to support one
more IP address on a new
more IP address on a new
branch named 'hme0:1'.
branch named 'hme0:1'.
- Second param is 'new the IP
- Second param is 'new the IP
address'.
address'.
- Third and Fourth are netmask
- Third and Fourth are netmask
and broadcast address
and broadcast address
respectively. Contact your
respectively. Contact your
SysAdm or RTFM. :).
SysAdm or RTFM. :).
Note: bringing up a virtual IP
Note: bringing up a virtual IP
address on a node can be
address on a node can be
divided in two steps:
divided in two steps:
1> Create
1> Create
2> Bring up.
2> Bring up.
In this case both are done by
In this case both are done by
this one command.
this one command.
- Fifth one you know,
don't you?
- Fifth one you know,
don't you?
2. To bring this virtual IP
address down (without
2. To bring this virtual IP
deleting it):
address down (without
deleting it):
$ ifconfig hme0:1 down
$ ifconfig hme0:1 down
3. To bring this virtual IP
address up agn(hme0:1 has to
3. To bring this virtual IP
exist for this):
address up agn(hme0:1 has to
exist for this):
$ ifconfig hme0:1 up
$ ifconfig hme0:1 up
4. To delete this virtual
IP address:
4. To delete this virtual
IP address:
$ ifconfig hme0:1 0 down
$ ifconfig hme0:1 0 down
Note: Assigning 0 as IP
address, deletes it.
Note: Assigning 0 as IP
address, deletes it.
IMPORTANT: All of these commands
requires root permission. If
IMPORTANT: All of these commands
user with lower authority try
to do this, the result may not
requires root permission. If
be good.
user with lower authority try
to do this, the result may not
(manuals say problems arising
be good.
from that can be tough to
diagnose)
(manuals say problems arising
from that can be tough to
Wondering about where to
diagnose)
use it: We're using this in a
cluster environment to give
Wondering about where to
client only one IP address
use it: We're using this in a
which we make sure is always
cluster environment to give
up n running on one of the
client only one IP address
nodes.
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.
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.