[afnog] Two IP Addresses on the same Interface

Phil Regnauld regnauld at x0.dk
Wed Jul 11 12:49:23 UTC 2007


stevem at accesskenya.com (stevem) writes:
> 
> If your NIC is something other than fxp0 (like rl0) replace that. Of
> course your router has to have an IP on the same subnet as well.....

That's not necessarily the only option.

If you have:

------+-----------------------+---- A.B.C.0/24
      |                       |
    Router                  Host
      .1                      .2

... and you want to add aliases on Host which are from another subnet,
say X.Y.Z.0/28, then you can route individual hosts to .2 from .1, avoiding
wasting net and bcast addresses in the process.  I.e., you can do:

route add X.Y.Z.1/32 A.B.C.2
route add X.Y.Z.2/32 A.B.C.2
...

Or you can even route the entire X.Y.Z.0/28 subnet to .2 ( if you need
all 16 aliases ).

We do this a lot to save IP addresses -- the interconnect is then RFC1918.
It's gross (especially on traceroutes) so it helps to set the correct
source IP on ICMP replies.

Phil



More information about the afnog mailing list