Re: ifconfig.if(5) documentation
This is a multi-part message in MIME format.
------=_NextPart_000_0C3B_01C50F09.099E2A90
Content-Type: text/plain;
format=flowed;
charset="iso-8859-1";
reply-type=response
Content-Transfer-Encoding: 7bit
"Thomas Edward Spanjaard" <t.e.spanjaard@student.utwente.nl> wrote in
message news:420a9cb5$0$718$415eb37d@crater_reader.dragonflybsd.org...
> This isn't something I do often, so bear with me :).
Without further ado, this time with MIME.
cheers,
-- Thomas E. Spanjaard
------=_NextPart_000_0C3B_01C50F09.099E2A90
Content-Type: application/octet-stream;
name="ifconfig.if.5.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="ifconfig.if.5.patch"
=3D=3D=3D share/man/man5/ifconfig.if.5
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A=
--- share/man/man5/ifconfig.if.5=0A=
+++ share/man/man5/ifconfig.if.5=0A=
@@ -0,0 +1,110 @@=0A=
+.\" $NetBSD: ifconfig.if.5,v 1.7 2002/10/13 00:46:59 wiz Exp $=0A=
+.\"=0A=
+.\" Copyright (c) 1996 Matthew R. Green=0A=
+.\" All rights reserved.=0A=
+.\"=0A=
+.\" Redistribution and use in source and binary forms, with or without=0A=
+.\" modification, are permitted provided that the following conditions=0A=
+.\" are met:=0A=
+.\" 1. Redistributions of source code must retain the above copyright=0A=
+.\" notice, this list of conditions and the following disclaimer.=0A=
+.\" 2. Redistributions in binary form must reproduce the above copyright=0A=
+.\" notice, this list of conditions and the following disclaimer in =
the=0A=
+.\" documentation and/or other materials provided with the =
distribution.=0A=
+.\" 3. The name of the author may not be used to endorse or promote =
products=0A=
+.\" derived from this software without specific prior written =
permission.=0A=
+.\"=0A=
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR=0A=
+.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED =
WARRANTIES=0A=
+.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE =
DISCLAIMED.=0A=
+.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,=0A=
+.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,=0A=
+.\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;=0A=
+.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER =
CAUSED=0A=
+.\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT =
LIABILITY,=0A=
+.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY=0A=
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY =
OF=0A=
+.\" SUCH DAMAGE.=0A=
+.\"=0A=
+.Dd February 9, 2005=0A=
+.Dt IFCONFIG.IF 5=0A=
+.Os=0A=
+.Sh NAME=0A=
+.Nm ifconfig.if=0A=
+.Nd interface-specific configuration files=0A=
+.Sh DESCRIPTION=0A=
+The=0A=
+.Nm=0A=
+files contain information regarding the configuration of each network =
interface.=0A=
+.Nm=0A=
+is processed by=0A=
+.Pa /etc/rc.d/network=0A=
+at system boot time.=0A=
+.Pp=0A=
+One file should exist for each interface that is to be configured, such =
as=0A=
+.Pa /etc/ifconfig.fxp0 .=0A=
+The file will get evaluated only if the interface exists on the system.=0A=
+Multiple lines can be placed in a file, and will be evaluated =
sequentially.=0A=
+.Pp=0A=
+Normally, a line will be evaluated as command line arguments to=0A=
+.Xr ifconfig 8 .=0A=
+.Dq Li ifconfig if=0A=
+will be prepended on evaluation.=0A=
+.Pp=0A=
+If a line is empty, or starts with=0A=
+.Sq # ,=0A=
+the line will be ignored as comment.=0A=
+.Pp=0A=
+If a line starts with=0A=
+.Sq \&! ,=0A=
+the rest of line will get evaluated as shell script fragment.=0A=
+Shell variables declared in=0A=
+.Pa /etc/rc.d/network=0A=
+are accessible.=0A=
+The most useful variable is=0A=
+.Li $int ,=0A=
+as it will be bound to the interface being configured with the file.=0A=
+.Pp=0A=
+For example, the following illustrates static interface configuration:=0A=
+.Bd -literal -offset indent=0A=
+# IPv4, with an alias=0A=
+inet 10.0.1.12 netmask 255.255.255.0 media 100baseTX=0A=
+inet 10.0.1.13 netmask 255.255.255.255 alias=0A=
+# let us have IPv6 address on this interface=0A=
+inet6 fec0::1 prefixlen 64 alias=0A=
+# have subnet router anycast address too=0A=
+inet6 fec0:: prefixlen 64 alias anycast=0A=
+.Ed=0A=
+.Pp=0A=
+The following illustrates dynamic configuration setup with=0A=
+.Xr dhclient 8=0A=
+and=0A=
+.Xr rtsol 8 :=0A=
+.Bd -literal -offset indent=0A=
+up=0A=
+# autoconfigure IPv4 address=0A=
+!dhclient $int=0A=
+# autoconfigure IPv6 address. Be sure to set $ip6mode to autohost.=0A=
+!rtsol $int=0A=
+.Ed=0A=
+.Pp=0A=
+The following example is for dynamically-created pseudo interfaces like=0A=
+.Xr gif 4 :=0A=
+.Bd -literal -offset indent=0A=
+up=0A=
+# configure IPv6 default route toward the interface=0A=
+!route add -inet6 default ::1=0A=
+!route change -inet6 default -ifp $int=0A=
+.Ed=0A=
+.Pp=0A=
+Earlier versions of=0A=
+.Pa /etc/rc.d/network=0A=
+required an explicit=0A=
+.Sq create=0A=
+command for such interfaces.=0A=
+This is now handled automatically.=0A=
+.Sh FILES=0A=
+.Pa /etc/rc.d/network=0A=
+.Sh SEE ALSO=0A=
+.Xr rc.conf 5 ,=0A=
+.Xr ifconfig 8=0A=
=0A=
=3D=3D=3D share/man/man5/rc.conf.5
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A=
--- share/man/man5/rc.conf.5=0A=
+++ share/man/man5/rc.conf.5=0A=
@@ -23,8 +23,8 @@=0A=
.\" SUCH DAMAGE.=0A=
.\"=0A=
.\" $FreeBSD: src/share/man/man5/rc.conf.5,v 1.197 2003/07/28 13:56:00 =
mbr Exp $=0A=
-.\" $DragonFly$=0A=
-.Dd March 3, 2002=0A=
+.\" $DragonFly: src/share/man/man5/rc.conf.5,v 1.8 2005/01/11 20:01:07 =
swildner Exp $=0A=
+.Dd February 9, 2005=0A=
.Dt RC.CONF 5=0A=
.Os=0A=
.Sh NAME=0A=
@@ -739,6 +739,18 @@=0A=
.Va ifconfig_ Ns Ao Ar interface Ac Ns Va _alias Ns Aq Ar n=0A=
variables.=0A=
.Pp=0A=
+If the=0A=
+.Pa /etc/ifconfig. Ns Aq Ar interface=0A=
+file is present, it is read and executed by=0A=
+.Pa /etc/rc.d/network=0A=
+replacing any=0A=
+.Va ifconfig_ Ns Aq Ar interface=0A=
+or=0A=
+.Va ifconfig_ Ns Ao Ar interface Ac Ns Va _alias Aq Ar n=0A=
+variables. Only interfaces set in=0A=
+.Va net_interfaces=0A=
+are processed.=0A=
+.Pp=0A=
It is possible to bring up an interface with DHCP by setting the=0A=
.Va ifconfig_ Ns Aq Ar interface=0A=
variable to=0A=
------=_NextPart_000_0C3B_01C50F09.099E2A90--
討論串 (同標題文章)