27.5. 在 ATM 使用 PPP (PPPoA)
前一頁 | 章 27. PPP | 下一頁

## 27.5. 在 ATM 使用 PPP (PPPoA)

The following describes how to set up PPP over ATM (PPPoA). PPPoA is a popular choice among European DSL providers.

### 27.5.1. 使用 mpd

The mpd application can be used to connect to a variety of services, in particular PPTP services. It can be installed using the net/mpd5 package or port. Many ADSL modems require that a PPTP tunnel is created between the modem and computer.

Once installed, configure mpd to suit the provider's settings. The port places a set of sample configuration files which are well documented in `/usr/local/etc/mpd/`. A complete guide to configure mpd is available in HTML format in `/usr/ports/share/doc/mpd/`. Here is a sample configuration for connecting to an ADSL service with mpd. The configuration is spread over two files, first the `mpd.conf`:

### 注意:

This example `mpd.conf` only works with mpd 4.x.

    default:
        load adsl

    adsl:
        new -i ng0 adsl adsl
        set bundle authname username
        set bundle password password
        set bundle disable multilink

        set link no pap acfcomp protocomp
        set link disable chap
        set link accept chap
        set link keep-alive 30 10

        set ipcp no vjcomp
        set ipcp ranges 0.0.0.0/0 0.0.0.0/0

        set iface route default
        set iface disable on-demand
        set iface enable proxy-arp
        set iface idle 0

        open

| The username used to authenticate with your ISP.
| The password used to authenticate with your ISP.

Information about the link, or links, to establish is found in `mpd.links`. An example `mpd.links` to accompany the above example is given beneath:

    adsl:
        set link type pptp
        set pptp mode active
        set pptp enable originate outcall
        set pptp self 10.0.0.1
        set pptp peer 10.0.0.138

| The IP address of FreeBSD computer running mpd.
| The IP address of the ADSL modem. The Alcatel SpeedTouch™ Home defaults to `10.0.0.138`.

It is possible to initialize the connection easily by issuing the following command as `root`:

    # mpd -b adsl

To view the status of the connection:

    % ifconfig ng0
    ng0: flags=88d1<UP,POINTOPOINT,RUNNING,NOARP,SIMPLEX,MULTICAST> mtu 1500
         inet 216.136.204.117 --> 204.152.186.171 netmask 0xffffffff

Using mpd is the recommended way to connect to an ADSL service with FreeBSD.

### 27.5.2. 使用 pptpclient

It is also possible to use FreeBSD to connect to other PPPoA services using net/pptpclient.

To use net/pptpclient to connect to a DSL service, install the port or package, then edit `/etc/ppp/ppp.conf`. An example section of `ppp.conf` is given below. For further information on `ppp.conf` options consult ppp(8).

    adsl:
     set log phase chat lcp ipcp ccp tun command
     set timeout 0
     enable dns
     set authname username
     set authkey password
     set ifaddr 0 0
     add default HISADDR

| The username for the DSL provider.
| The password for your account.

### 警告:

Since the account's password is added to `ppp.conf`in plain text form, make sure nobody can read the contents of this file:

    # chown root:wheel /etc/ppp/ppp.conf
    # chmod 600 /etc/ppp/ppp.conf

This will open a tunnel for a PPP session to the DSL router. Ethernet DSL modems have a preconfigured LAN IP address to connect to. In the case of the Alcatel SpeedTouch™ Home, this address is `10.0.0.138`. The router's documentation should list the address the device uses. To open the tunnel and start a PPP session:

    # pptp address adsl

### 提示:

If an ampersand (“&”) is added to the end of this command, pptp will return the prompt.

A `tun` virtual tunnel device will be created for interaction between the pptp and ppp processes. Once the prompt is returned, or the pptp process has confirmed a connection, examine the tunnel:

    % ifconfig tun0
    tun0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1500
            inet 216.136.204.21 --> 204.152.186.171 netmask 0xffffff00
    	Opened by PID 918

If the connection fails, check the configuration of the router, which is usually accessible using a web browser. Also, examine the output of `pptp` and the contents of the log file, `/var/log/ppp.log` for clues.

前一頁 | 上一層 | 下一頁
27.4. 在乙太網路使用 PPP (PPPoE) | 起始頁 | 章 28. 電子郵件

本文及其他文件，可由此下載： ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/。

若有 FreeBSD 方面疑問，請先閱讀 FreeBSD 相關文件，如不能解決的話，再洽詢 <questions@FreeBSD.org>。
關於本文件的問題，請洽詢 <doc@FreeBSD.org>。