UGU Unix Guru Universe
For Unix Admins, By Unix Admins
Follow ugucom on Twitter      Search  in 
Home
BEGINNERS & USERS

Events

Internet
 
 Linux
BEGINNERS & USERS
Software
Linux Vendors
Usenet NewsGroups
Books & Publications
 
 Shop
Cool Admin Gifts!
Gadgets
T-Shirts
Books
 
 Unix Guru Universe
About
Add Link
Feedback
 
 
UGU: Unix Guru Universe - Unix Tip #4519- July 25, 2024 - Home : Help : Today's Tip : Help : Today's Tip
Unix Tip #4519- July 25, 2024

MULTIPLE IP ADDRESSES

MULTIPLE IP ADDRESSES



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.


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

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:


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:

 
Copyright 1994-2024 Unix Guru Universe