Tidy up the PPPoE howto.

Covers PR:	27320
This commit is contained in:
Brian Somers 2001-09-03 02:29:27 +00:00
parent f586e47f10
commit 3d7ba3a1cf
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/head/; revision=10553

View file

@ -1,7 +1,7 @@
<!--
The FreeBSD Documentation Project
$FreeBSD: doc/en_US.ISO8859-1/books/handbook/ppp-and-slip/chapter.sgml,v 1.51 2001/08/15 20:14:41 logo Exp $
$FreeBSD: doc/en_US.ISO8859-1/books/handbook/ppp-and-slip/chapter.sgml,v 1.52 2001/08/16 18:35:06 chern Exp $
-->
<chapter id="ppp-and-slip">
@ -1812,54 +1812,11 @@ exit 1
PPPoE.</para>
<sect2>
<title>Prerequisites</title>
<title>Configuring the kernel</title>
<para>There are a few requirements that your system will need to meet
in order for PPPoE to function properly. They are:</para>
<itemizedlist>
<listitem>
<para>Kernel source for FreeBSD 3.4 or later</para>
</listitem>
<listitem>
<para><application>ppp</application> from FreeBSD 3.4 or later</para>
</listitem>
</itemizedlist>
</sect2>
<sect2>
<title>Kernel Configuration</title>
<indexterm><primary>kernel</primary><secondary>configuration</secondary></indexterm>
<para>You will need to set the following options in your kernel
configuration file and then <link linkend="kernelconfig">compile a new
kernel</link>.</para>
<itemizedlist>
<listitem>
<para><option>options NETGRAPH</option></para>
</listitem>
</itemizedlist>
<para>Optionally, you can add</para>
<itemizedlist>
<listitem>
<para><option>options NETGRAPH_PPPOE</option></para>
</listitem>
<listitem>
<para><option>options NETGRAPH_SOCKET</option></para>
</listitem>
<listitem>
<para><option>options NETGRAPH_ETHER</option></para>
</listitem>
</itemizedlist>
<para>
although if this functionality is not available at runtime,
<application>ppp</application> will load the relevant modules
on demand
</para>
<para>No kernel configuration is necessary for PPPoE any longer. If
the necessary netgraph support is not built into the kernel, it will
be dynamically loaded by <application>ppp</application>.</para>
</sect2>
<sect2>
@ -1868,28 +1825,17 @@ exit 1
<para>Here is an example of a working
<filename>ppp.conf</filename>:</para>
<programlisting>default: # or name_of_service_provider
<programlisting>default:
set log Phase tun command # you can add more detailed logging if you wish
set ifaddr 10.0.0.1/0 10.0.0.2/0
name_of_service_provider:
set device PPPoE:<replaceable>xl1</replaceable> # replace xl1 with your ethernet device
set mru 1492
set mtu 1492
set authname YOURLOGINNAME
set authkey YOURPASSWORD
set log Phase tun command # you can add more detailed logging if you wish
set dial
set login
set ifaddr 10.0.0.1/0 10.0.0.2/0
add default HISADDR
nat enable yes # if you want to enable nat for your local net
papchap:
set authname YOURLOGINNAME
set authkey YOURPASSWORD</programlisting>
<para>
Care should be taken when running <ulink
url="../FAQ/ppp.html#PPPoEwithNAT">PPPoE with the
<option>-nat</option> option</ulink>.
</para>
add default HISADDR</programlisting>
</sect2>
@ -1910,212 +1856,45 @@ papchap:
<programlisting>ppp_enable="YES"
ppp_mode="ddial"
ppp_nat="YES"
ppp_profile="default" # or your provider</programlisting>
ppp_nat="YES" # if you want to enable nat for your local network, otherwise NO
ppp_profile="name_of_service_provider"</programlisting>
</sect2>
<sect2 id="ppp-3com">
<sect2info>
<authorgroup>
<author>
<firstname>M&aacute;rio S&eacute;rgio Fujikawa</firstname>
<surname>Ferreira</surname>
<contrib>Contributed by </contrib>
</author>
<!-- 7 Apr 2001 -->
</authorgroup>
</sect2info>
<sect2>
<title>Using a PPPoE Service tag</title>
<title>PPPoE with a 3Com HomeConnect ADSL Modem Dual Link</title>
<para>Sometimes it will be necessary to use a service tag to establish
your connection. Service tags are used to distinguish between
different PPPoE servers attached to a given network.</para>
<para>In short, it does not work. It should, but unfortunately,
that is not the case. For whatever reason, this modem does not
follow <ulink url="http://www.faqs.org/rfcs/rfc2516.html">RFC
2516</ulink> (<emphasis>A Method for transmitting PPP over
Ethernet (PPPoE)</emphasis>, written by L. Mamakos, K. Lidl,
J. Evarts, D. Carrel, D. Simone, and R. Wheeler).</para>
<para>You should have been given any required service tag information
in the documentation provided by your ISP. If you cannot locate
it there, ask your ISP's tech support personnel.</para>
<para>Since it does not follow the specification, FreeBSD's PPPoE
implementation will not talk to it. It is very likely that it will
not work under other Unix systems for that same reason.
Complain to <ulink
url="http://www.3com.com/">3Com</ulink> if you think it should
comply with the PPPoE specification.</para>
<para>As a last resort, you could try the method suggested by the
<ulink url="http://www.roaringpenguin.com/pppoe/">Roaring Penguin
PPPoE</ulink> program which can be found in the <link
linkend="ports">ports collection</link>. Bear in mind however,
this may de-program your modem and render it useless, so
think twice before doing it. Simply install the program shipped
with the modem by your provider. Then, access the
<literal>System</literal> menu from the program. The name of your
profile should be listed there. It is usually
<emphasis>ISP</emphasis>.</para>
<indexterm><primary>ADSL</primary></indexterm>
<para>If you absolutely want to use your ADSL connection with
FreeBSD and are stuck with this modem, you can either:</para>
<para>The profile name (service tag) will be used in the PPPoE
configuration entry in <filename>ppp.conf</filename> as the provider
part of the <command>set device</command> command (see the &man.ppp.8;
manual page for full details). It should look like this:</para>
<itemizedlist>
<indexterm><primary>DSL</primary></indexterm>
<listitem>
<para>Try replacing the modem with a different brand or model
if your DSL provider permits you to do so. If you are not
sure which brand(s) will work, the &a.questions; is a good
place to ask.</para>
</listitem>
<programlisting>set device PPPoE:<replaceable>xl1</replaceable>:<replaceable>ISP</replaceable></programlisting>
<listitem>
<para>Try to get it working. Keep in mind that there is no
guarantee it will work, your mileage may vary.</para>
</listitem>
</itemizedlist>
<para>Do not forget to change <replaceable>xl1</replaceable>
to the proper device for your Ethernet card.</para>
<para>Do not forget to change <replaceable>ISP</replaceable>
to the profile you have just found above.</para>
<para>If you want to try to make it work, you can do the
following, but please keep in mind that you do this <emphasis>at
your own risk</emphasis>! Just because it worked for me does
not mean it will work for you.</para>
<para>There are three steps to the process. They are:</para>
<procedure>
<step>
<para>Make sure you already have <filename>ppp.conf</filename>
set up. See the beginning of this chapter for more details
on doing so.</para>
</step>
<step>
<para>Since the modem does not speak the correct protocol, we
need to learn how to speak its variant of the protocol.
This information was obtained from a <ulink
url="http://www.dslreports.com/forum/remark,367540;root=equip,16;mode=flat">DSLreports
forum message</ulink>.</para>
<para>The modem speaks <literal>0x3c12</literal> for
<literal>DISCOVERY</literal>, and <literal>0x3c13</literal>
for <literal>PAYLOAD</literal> identifiers instead of
<literal>0x8863</literal> and <literal>0x8864</literal>
respectively, as mandated by the PPPoE specification.</para>
<informaltable>
<tgroup cols="3">
<thead>
<row>
<entry>Code</entry>
<entry>RFC's Code</entry>
<entry>Dual Link Modem's Code</entry>
</row>
</thead>
<tbody>
<row>
<entry>PAYLOAD</entry>
<entry>0x8863</entry>
<entry>0x3c12</entry>
</row>
<row>
<entry>PAYLOAD</entry>
<entry>0x8864</entry>
<entry>0x3c13</entry>
</row>
</tbody>
</tgroup>
</informaltable>
<para>So, now what? You need to recompile the
<literal>NETGRAPH_PPPOE</literal> code with the modem's
codes. For this, you should have installed the full kernel
sources.</para>
<para>Find the
<filename>/usr/src/sys/netgraph/ng_pppoe.h</filename> file.
Be careful while editing this file. You have to modify both
the little and the big endian entries.</para>
<itemizedlist>
<listitem>
<para>For big endian, find the line with
<literal>0x8863</literal> in it, and replace the number
with <literal>0x3c12</literal>. Do the same with
<literal>0x8864</literal>, replacing it with
<literal>0x3c13</literal>.</para>
</listitem>
<listitem>
<para>For little endian, find the line with
<literal>0x6388</literal>in it, and replace the number
with <literal>0x123c</literal>. Do the same with
<literal>0x6488</literal>, replacing it with
<literal>0x133c</literal>.</para>
</listitem>
</itemizedlist>
<para>Here is a <command>diff</command> of how the new file
should look:</para>
<screen>&prompt.user; <userinput>diff -u ng_pppoe.h.orig ng_pppoe.h</userinput></screen>
<programlisting>
--- ng_pppoe.h.orig Thu Apr 12 13:42:46 2001
+++ ng_pppoe.h Thu Apr 12 13:44:47 2001
@@ -148,8 +148,8 @@
#define PTT_SYS_ERR (0x0202)
#define PTT_GEN_ERR (0x0203)
-#define ETHERTYPE_PPPOE_DISC 0x8863 /* pppoe discovery packets */
-#define ETHERTYPE_PPPOE_SESS 0x8864 /* pppoe session packets */
+#define ETHERTYPE_PPPOE_DISC 0x3c12 /* pppoe discovery packets */
+#define ETHERTYPE_PPPOE_SESS 0x3c13 /* pppoe session packets */
#else
#define PTT_EOL (0x0000)
#define PTT_SRV_NAME (0x0101)
@@ -162,8 +162,8 @@
#define PTT_SYS_ERR (0x0202)
#define PTT_GEN_ERR (0x0302)
-#define ETHERTYPE_PPPOE_DISC 0x6388 /* pppoe discovery packets */
-#define ETHERTYPE_PPPOE_SESS 0x6488 /* pppoe session packets */
+#define ETHERTYPE_PPPOE_DISC 0x123c /* pppoe discovery packets */
+#define ETHERTYPE_PPPOE_SESS 0x133c /* pppoe session packets */
#endif
struct pppoe_tag {</programlisting>
<para>Then do the following as
<username>root</username>:</para>
<screen>&prompt.root; <userinput>cd /usr/src/sys/modules/netgraph/pppoe</userinput>
&prompt.root; <userinput>make clean depend all install</userinput>
&prompt.root; <userinput>make clean</userinput></screen>
<para>Now you can speak the modem's variant of the PPPoE
specification.</para>
<para>The third step is to figure out the name of the profile
your ISP assigned to the modem. The information for this
step was obtained from the <ulink
url="http://www.roaringpenguin.com/pppoe/">Roaring Penguin
PPPoE</ulink> program which can be found in the <link
linkend="ports">ports collection</link>. If you still are
not able to find it, ask your ISP's tech support.</para>
<para>If they do not know it either, and you are feeling bold
(this may de-program your modem and render it useless, so
think twice about doing it).</para>
<para>Install the program shipped with the modem by your
provider. Then, access the <literal>System</literal> menu
from the program. The name of your profile should be
listed there. It is usually <emphasis>ISP</emphasis>.</para>
<para>The profile name will be used in the PPPoE configuration
inside <filename>ppp.conf</filename> as the provider
parameter. See the &man.ppp.8; manual page for more
information.</para>
<para>The PPPoE line in your <filename>ppp.conf</filename>
should look like this:</para>
<programlisting>set device PPPoE:<replaceable>xl1</replaceable>:<replaceable>ISP</replaceable></programlisting>
<para>Do not forget to change <replaceable>xl1</replaceable>
to the proper device for your Ethernet card.</para>
<para>Do not forget to change <replaceable>ISP</replaceable>
to the profile you have just found above.</para>
</step>
</procedure>
<para>For additional information, you can try:</para>
<para>For additional information, see:</para>
<itemizedlist>
<listitem>
@ -2126,12 +1905,6 @@ ppp_profile="default" # or your provider</programlisting>
Waldura</ulink> in <ulink url="http://www.daemonnews.org/">Daemon
News</ulink>.</para>
</listitem>
<listitem>
<para>Another PPPoE tutorial by <ulink
url="http://www.sympaticousers.org/faq/freebsd_howto.htm">Sympatico
Users Group</ulink>.</para>
</listitem>
</itemizedlist>
</sect2>
</sect1>