Be explicit in examples about the correct grammar for 'alias' and

'-alias', and that 'add' and 'delete are in fact synonyms for these
in the ifconfig(8) grammar.

Use network prefixes explicitly specified in IETF RFCs for
documentation purposes. (bz)

PR:		102701
MFC after:	1 day
See also:	RFC 3330, RFC 3849
Submitted by:	bz
This commit is contained in:
Bruce M Simpson 2007-02-04 16:48:56 +00:00
parent cd83bbd2aa
commit 9bb9973c66
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=166498

View File

@ -28,7 +28,7 @@
.\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94
.\" $FreeBSD$
.\"
.Dd February 3, 2007
.Dd February 4, 2007
.Dt IFCONFIG 8
.Os
.Sh NAME
@ -1569,32 +1569,47 @@ The media selection system is relatively new and only some drivers support
it (or have need for it).
.Sh EXAMPLES
Assign the IPv4 address
.Li 192.168.1.10 ,
.Li 192.0.2.10 ,
with a network mask of
.Li 255.255.255.0 ,
to the interface
.Li fxp0 :
.Dl # ifconfig fxp0 inet 192.168.1.10 netmask 255.255.255.0
.Dl # ifconfig fxp0 inet 192.0.2.10 netmask 255.255.255.0
.Pp
Assign the IPv4 address
.Li 172.16.20.2 ,
Add the IPv4 address
.Li 192.0.2.45 ,
with the CIDR network prefix
.Li /22 ,
.Li /28 ,
to the interface
.Li ed0 :
.Dl # ifconfig ed0 inet 172.16.20.2/22
.Li ed0 ,
using
.Cm add
as a synonym for the canonical form of the option
.Cm alias :
.Dl # ifconfig ed0 inet 192.0.2.45/28 add
.Pp
Assign the IPv6 address
.Li 3ffe:112:fffc:10:1::2/64
Remove the IPv4 address
.Li 192.0.2.45
from the interface
.Li ed0 :
.Dl # ifconfig ed0 inet 192.0.2.45 -alias
.Pp
Add the IPv6 address
.Li 2001:DB8:DBDB::123/48
to the interface
.Li em0 :
.Dl # ifconfig em0 inet6 add 3ffe:112:fffc:10:1::2 prefixlen 64
.Dl # ifconfig em0 inet6 2001:db8:bdbd::123 prefixlen 48 alias
Note that lower case hexadecimal IPv6 addresses are acceptable.
.Pp
Remove the IPv6 address added in the above example,
using the
.Li /
character as shorthand for the network prefix:
.Dl # ifconfig em0 inet6 3ffe:112:fffc:10:1::2/64 delete
character as shorthand for the network prefix,
and using
.Cm delete
as a synonym for the canonical form of the option
.Fl alias :
.Dl # ifconfig em0 inet6 2001:db8:bdbd::123/48 delete
.Pp
Configure the interface
.Li xl0 ,