Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 Feb 2011 06:07:43 +0000
From:      Matthew Seaman <m.seaman@infracaninophile.co.uk>
To:        freebsd-questions@freebsd.org
Subject:   Re: how to add a few hundred ip on one interface?
Message-ID:  <4D54D22F.2060607@infracaninophile.co.uk>
In-Reply-To: <AANLkTikQ10rJ5up-idYadytaa3xCJpQCXGYQTe5YaFMF@mail.gmail.com>
References:  <4D547675.60506@ukr.net> <AANLkTikQ10rJ5up-idYadytaa3xCJpQCXGYQTe5YaFMF@mail.gmail.com>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig768D621D2C1E274B1397B9C4
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On 10/02/2011 23:52, patrick wrote:
> The standard way is to configure this in your /etc/rc.conf[.local]:
>=20
> ifconfig_re0=3D"inet xxx.xxx.yyy.134 netmask 0xffffffnn"
> ifconfig_re0_alias0=3D"inet xxx.xxx.yyy.135 netmask 0xffffffff"
> ifconfig_re0_alias1=3D"inet xxx.xxx.yyy.136 netmask 0xffffffff"
> ... etc.

That used to be the case, but in fact no longer.  Nowadays you can put
this single line into /etc/rc.conf to configure a whole raft of IP
addresses on an interface:

ipv4_addrs_re0=3D"xxx.xxx.yyy.134-147/23"

See rc.conf(5) for details.

> See http://www.freebsd.org/doc/en/books/faq/networking.html#ETHERNET-AL=
IASES
> for more info. Note that aliases should have a netmask of 0xffffffff
> (255.255.255.255).

Also something that was once true, but is actually no longer required.
Nowadays you can give alias IPs the natural netmask of the network they
belong to.  Which has the handy consequence that there's no real
distinction between what was the first address, and what are aliases --
so you can easily renumber an interface on the fly, simply by adding a
new address/netmask, then removing the old one.

	Cheers,

	Matthew

--=20
Dr Matthew J Seaman MA, D.Phil.                   7 Priory Courtyard
                                                  Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey     Ramsgate
JID: matthew@infracaninophile.co.uk               Kent, CT11 9PW


--------------enig768D621D2C1E274B1397B9C4
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.16 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk1U0jUACgkQ8Mjk52CukIzXiACff+rDkH0RF+un4jjuJ02Mk5R9
mkQAn16b/9XUYLkIKlbaBdWtGBgf+ISI
=Hgkc
-----END PGP SIGNATURE-----

--------------enig768D621D2C1E274B1397B9C4--



Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?4D54D22F.2060607>