Re: IP address aliases



Grant Edwards <grante@xxxxxxxx> writes:
On 2007-06-11, phil-news-nospam@xxxxxxxx <phil-news-nospam@xxxxxxxx> wrote:
Would you be able to write a script to use the above (which currently
makes no sense to me) to implement simple IP address add/delete like:

ipalias -a 192.168.3.4
ipalias -a 172.31.0.0/24
ipalias -d 192.168.3.4
ipalias -d 172.31.0.0/24


How is the script supposed to know which interface to tweak on?
If you add a parameter for the interface, then it's really not
much shorter than the "long" way of doing it:

ifconfig eth0:1 192.168.3.4
ifconfig eth0:2 172.31.0.0/24
ifconfig eth0:1 down
ifconfig eth0:2 down

Since this has been obsolete since Linux 2.2, it should really be
called the 'old way of doing it'. For non-manual configuration, this
is PITA, because it is necessary to keep track of the 'alias numbers'
associated with each additional protocol address.
.



Relevant Pages

  • Re: IP address aliases
    ... |> Would you be able to write a script to use the above (which currently ... |> ipalias -a 172.31.0.0/24 ... | How is the script supposed to know which interface to tweak on? ... | ifconfig eth0:2 172.31.0.0/24 ...
    (comp.os.linux.development.system)
  • Re: IP address aliases
    ... makes no sense to me) to implement simple IP address add/delete like: ... ipalias -a 172.31.0.0/24 ... How is the script supposed to know which interface to tweak on? ... ifconfig eth0:2 172.31.0.0/24 ...
    (comp.os.linux.development.system)
  • Re: IP address aliases
    ... |> an interface could have only one. ... | can be associated with 'labels' so that operations on address groups ... ip addr add a.b.c.d dev eth1 label eth1:snat ... ipalias -a 172.31.0.0/24 ...
    (comp.os.linux.development.system)