2002-02-06 22:17:01 +03:00
|
|
|
.\" $NetBSD: pppoe.4,v 1.8 2002/02/06 19:17:01 wiz Exp $
|
2001-12-10 23:49:29 +03:00
|
|
|
.\"
|
|
|
|
.\" Copyright (c) 2001 Martin Husemann. All rights reserved.
|
|
|
|
.\"
|
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
.\" modification, are permitted provided that the following conditions
|
|
|
|
.\" are met:
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
|
|
.\"
|
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
|
|
|
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
.\" SUCH DAMAGE.
|
|
|
|
.\"
|
|
|
|
.Dd December 10, 2001
|
|
|
|
.Dt PPPOE 4
|
|
|
|
.Os
|
|
|
|
.Sh NAME
|
|
|
|
.Nm pppoe
|
2001-12-18 16:33:18 +03:00
|
|
|
.Nd PPP over Ethernet protocol network interface
|
2001-12-10 23:49:29 +03:00
|
|
|
.Sh SYNOPSIS
|
|
|
|
.Nm pseudo-device pppoe
|
|
|
|
.Sh DESCRIPTION
|
|
|
|
The
|
|
|
|
.Nm
|
2002-02-04 01:34:49 +03:00
|
|
|
interface encapsulates
|
2001-12-10 23:49:29 +03:00
|
|
|
.Em Point-to-Point Protocol (PPP)
|
2001-12-18 16:33:18 +03:00
|
|
|
packets inside Ethernet frames as defined by
|
2001-12-10 23:49:29 +03:00
|
|
|
.Li RFC2516 .
|
|
|
|
.Pp
|
|
|
|
This is often used to connect a router via a DSL modem to
|
2001-12-11 03:08:52 +03:00
|
|
|
an access concentrator. The
|
2001-12-10 23:49:29 +03:00
|
|
|
.Nm
|
|
|
|
interface does not by itself transmit or receive frames,
|
2001-12-18 16:33:18 +03:00
|
|
|
but needs an Ethernet interface to do so. This Ethernet interface
|
2001-12-10 23:49:29 +03:00
|
|
|
is connected to the
|
|
|
|
.Nm
|
|
|
|
interface via
|
|
|
|
.Xr pppoectl 8 .
|
2001-12-18 16:33:18 +03:00
|
|
|
The Ethernet interface needs to be marked UP, but does not need to have an
|
2001-12-10 23:49:29 +03:00
|
|
|
IP address.
|
|
|
|
.Pp
|
|
|
|
There are two basic modes of operation, controlled via the
|
|
|
|
.Em link1
|
2001-12-11 03:08:52 +03:00
|
|
|
switch. The default mode,
|
2001-12-10 23:49:29 +03:00
|
|
|
.Em link1
|
|
|
|
not being set, tries to keep the configured session open all the
|
2001-12-11 03:08:52 +03:00
|
|
|
time. If the session is disconnected, a new connection attempt is started
|
|
|
|
immediately. The
|
2001-12-10 23:49:29 +03:00
|
|
|
.Dq dial on demand
|
|
|
|
mode, selected by setting
|
|
|
|
.Em link1 ,
|
|
|
|
only establishes a connection when data is being sent to the interface.
|
|
|
|
.Pp
|
|
|
|
Before a
|
|
|
|
.Nm
|
2001-12-11 03:08:52 +03:00
|
|
|
interface is usable, it needs to be configured. The following steps
|
2001-12-10 23:49:29 +03:00
|
|
|
are necessary:
|
|
|
|
.Bl -bullet
|
|
|
|
.It
|
|
|
|
create the interface
|
|
|
|
.It
|
2001-12-18 16:33:18 +03:00
|
|
|
connect an Ethernet interface
|
2001-12-11 03:08:52 +03:00
|
|
|
This interface is used for the physical communication. As noted above it
|
2001-12-10 23:49:29 +03:00
|
|
|
must be marked UP, but need not have an IP address.
|
|
|
|
.It
|
|
|
|
configure authentication
|
2001-12-11 03:08:52 +03:00
|
|
|
The PPP session needs to identify the client to the peer. For more details
|
2001-12-10 23:49:29 +03:00
|
|
|
on the available options see
|
|
|
|
.Xr pppoectl 8 .
|
|
|
|
.El
|
2001-12-18 16:33:18 +03:00
|
|
|
.Pp
|
|
|
|
This all is typically accomplished using an
|
2001-12-11 03:08:52 +03:00
|
|
|
.Pa /etc/ifconfig.pppoe0
|
|
|
|
file.
|
2002-01-13 21:40:52 +03:00
|
|
|
.Sh IMPORTANT NOTE
|
|
|
|
If you are using a
|
|
|
|
.Nm
|
|
|
|
interface, you will have an unusual low MTU for todays internet.
|
2002-01-14 16:46:53 +03:00
|
|
|
Combined with a lot of misconfigured sites (host using path MTU discovery
|
2002-01-13 21:40:52 +03:00
|
|
|
behind a router blocking all ICMP traffic) this will often cause problems.
|
2002-02-06 22:17:01 +03:00
|
|
|
Connections to this servers will only work if your system advertises the
|
|
|
|
right MSS in the TCP three way handshake. To get the right MSS, you need
|
2002-01-13 21:40:52 +03:00
|
|
|
to set
|
|
|
|
.Bd -literal
|
2002-02-06 22:17:01 +03:00
|
|
|
# Obey interface MTUs when calculating MSS
|
2002-01-13 21:40:52 +03:00
|
|
|
net.inet.tcp.mss_ifmtu=1
|
|
|
|
.Ed
|
2002-01-14 16:46:53 +03:00
|
|
|
.Pp
|
2002-01-13 21:40:52 +03:00
|
|
|
in your
|
|
|
|
.Pa /etc/sysctl.conf
|
|
|
|
file.
|
|
|
|
This causes the calculated MSS to be based on the MTU of the interface
|
2002-02-04 01:22:45 +03:00
|
|
|
via which the packet is sent. This is always the right value if you are
|
2002-01-13 21:40:52 +03:00
|
|
|
sure the answer to this packet will be received on the same interface
|
|
|
|
(I.e. you only have one interface connected to the internet.)
|
|
|
|
.Pp
|
2002-02-04 01:22:45 +03:00
|
|
|
Unfortunately this sysctl does not fix the MSS advertised by hosts in
|
2002-01-13 21:40:52 +03:00
|
|
|
the network behind a
|
|
|
|
.Nm
|
|
|
|
connected router.
|
2001-12-10 23:49:29 +03:00
|
|
|
.Sh EXAMPLES
|
2001-12-11 03:08:52 +03:00
|
|
|
A typical
|
|
|
|
.Pa /etc/ifconfig.pppoe0
|
|
|
|
file looks like this:
|
2001-12-10 23:49:29 +03:00
|
|
|
.Bd -literal
|
|
|
|
create
|
|
|
|
! /sbin/ifconfig ne0 up
|
|
|
|
! /sbin/pppoectl -e ne0 $int
|
|
|
|
! /sbin/pppoectl $int myauthproto=pap myauthname=testcaller myauthsecret=donttell
|
|
|
|
inet 0.0.0.0 0.0.0.1
|
|
|
|
#! /sbin/route add default -iface 0.0.0.1
|
|
|
|
up
|
|
|
|
.Ed
|
|
|
|
The commented out call to
|
|
|
|
.Xr route 8
|
2001-12-11 03:08:52 +03:00
|
|
|
may be omitted and the route added in the ip-up script called by
|
|
|
|
.Xr ifwatchd 8
|
|
|
|
when the real IP address is known. This is easy in the
|
2001-12-10 23:49:29 +03:00
|
|
|
.Dq connect always
|
2002-02-06 22:17:01 +03:00
|
|
|
mode (link1 not set), but hard to accomplish in the
|
2001-12-10 23:49:29 +03:00
|
|
|
.Dq dial on demand
|
2001-12-11 03:08:52 +03:00
|
|
|
mode (link1 set). In the latter case adding an iface route is an easy
|
2001-12-10 23:49:29 +03:00
|
|
|
workaround.
|
|
|
|
.Pp
|
2001-12-11 03:08:52 +03:00
|
|
|
The
|
2001-12-10 23:49:29 +03:00
|
|
|
.Nm
|
|
|
|
interfaces operate completely inside the kernel, without any userland
|
2001-12-11 03:08:52 +03:00
|
|
|
support. Because of this, a special daemon is used to fire ip-up or
|
2001-12-10 23:49:29 +03:00
|
|
|
down scripts to execute arbitrary code when the PPP session is established
|
2001-12-11 03:08:52 +03:00
|
|
|
and addresses of the interface become available. To enable the usage of
|
|
|
|
.Pa /etc/ppp/ip-up
|
|
|
|
and
|
|
|
|
.Pa /etc/ppp/ip-down
|
|
|
|
for this purpose, simply add
|
2001-12-10 23:49:29 +03:00
|
|
|
.Bd -literal
|
|
|
|
ifwatchd=YES
|
|
|
|
.Ed
|
2001-12-11 03:08:52 +03:00
|
|
|
to
|
|
|
|
.Pa /etc/rc.conf .
|
|
|
|
See
|
2001-12-10 23:49:29 +03:00
|
|
|
.Xr ifwatchd 8
|
2001-12-11 03:08:52 +03:00
|
|
|
for details and parameters passed to these scripts.
|
2001-12-10 23:49:29 +03:00
|
|
|
.Pp
|
|
|
|
Since this is a PPP interface, the addresses assigned to the interface
|
2001-12-11 03:08:52 +03:00
|
|
|
may change during PPP negotiation. There is no fine grained control available
|
|
|
|
for deciding which addresses are acceptable and which are not. For the local
|
|
|
|
side and the
|
|
|
|
remote address there is exactly one choice: hard coded address or wildcard.
|
2001-12-10 23:49:29 +03:00
|
|
|
If a real address is assigned to one side of the connection, PPP negotiation
|
2001-12-11 03:08:52 +03:00
|
|
|
will only agree to exactly this address. If one side is wildcarded, every
|
2001-12-10 23:49:29 +03:00
|
|
|
address suggested by the peer will be accepted.
|
|
|
|
.Pp
|
|
|
|
To wildcard the local address set it to 0.0.0.0, to wildcard the remote
|
|
|
|
address set it to 0.0.0.1. Wildcarding is not available (nor necessary)
|
|
|
|
for IPv6 operation.
|
|
|
|
.Sh SEE ALSO
|
2001-12-11 03:08:52 +03:00
|
|
|
.Xr ifwatchd 8 ,
|
|
|
|
.Xr pppoectl 8
|
2001-12-10 23:49:29 +03:00
|
|
|
.Rs
|
|
|
|
.%R RFC
|
|
|
|
.%N 2516
|
|
|
|
.%D February 1999
|
|
|
|
.%T "A Method for Transmitting PPP Over Ethernet (PPPoE)"
|
|
|
|
.Re
|
|
|
|
.Sh HISTORY
|
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
device appeared in
|
|
|
|
.Nx 1.6 .
|
2001-12-11 03:08:52 +03:00
|
|
|
.Sh BUGS
|
|
|
|
This implementation is client side only.
|