Linux で ADSL 接続

Linux活用日記



Last modified: Mon Oct 8 2001


Table of Contents




rp-pppoe による ADSL 接続


この項では, Linux で PPPoE(PPP over Ethernet) プロトコルによる ADSL 接続を行う一例をご紹介します(Yahoobb の場合は PPPoE を使っていませんので下記の手順は必要ありません. dhcpcd を起動させておけば後はネットワークの設定を行えばいいでしょう).

Linux で PPPoE プロトコルによる ADSL 接続を行うには rp-pppoe というソフトウエアを使うのが便利です. これは, Redhat Linux 7.x や Turbolinux 7.0 など最近のディストリビューションにはインストール済みになっていますが無ければ PPPoE SoftWere のサイトから入手することが出来ます. その他, pppd も必要ですがこれも大抵, インストール済みでしょう.

次に, ADSL モデムに接続されている NIC が認識されていることを確認しておきましょう. この場合, デフォルトゲートウェイやゲートウェイデバイスの設定はしないようにします. また, IP アドレスは通常, 割り当てないようにすること, 起動時にアクティブにならないようにします.

次に, ADSL の初期設定を行うために adsl-setup コマンドを実行します. この例では, プロバイダから指定されたユーザー ID が test@hoge.net, NIC が eth1であると仮定します.

# adsl-setup

まず, ユーザー ID を入力します.
Welcome to the Roaring Penguin ADSL client setup. First, I will run
some checks on your system to make sure the PPPoE client is installed
properly...

Looks good! Now, please enter some information:

USER NAME

>>> Enter your PPPoE user name (default bxxxnxnx@sympatico.ca): test@hoge.net

次に ADSL モデムに接続されている NIC を入力します.

INTERFACE

>>> Enter the Ethernet interface connected to the ADSL modem
For Solaris, this is likely to be something like /dev/hme0.
For Linux, it will be ethn, where 'n' is a number.
(default eth0):
eth1

次に, 一定時間, 通信が途絶えた場合に自動切断したい時は切断までの秒数を入力します. 常時接続の場合は no にしておきます.

Do you want the link to come up on demand, or stay up continuously?
If you want it to come up on demand, enter the idle time in seconds
after which the link should be dropped. If you want the link to
stay up permanently, enter 'no' (two letters, lower-case.)
NOTE: Demand-activated links do not interact well with dynamic IP
addresses. You may have some problems with demand-activated links.
>>> Enter the demand value (default no): no

次に, DNS サーバーの IP アドレスを入力します. ただし, /etc/resolv.conf に直接書いている場合は不要です.

DNS

Please enter the IP address of your ISP's primary DNS server.
If your ISP claims that 'the server will provide DNS addresses',
enter 'server' (all lower-case) here.
If you just press enter, I will assume you know what you are
doing and not modify your DNS setup.
>>> Enter the DNS information here:

次にプロバイダのパスワードを入力します.

PASSWORD

>>> Please enter your PPPoE password: ??????

次に, ファイヤーウォールの設定を後で行う場合は 0, スタンドアロンで利用する場合は 1, LAN 上のマシンからも利用させる場合は 2 を入力します.

The firewall choices are:
0 - NONE: This script will not set any firewall rules. You are responsible
for ensuring the security of your machine. You are STRONGLY
recommended to use some kind of firewall rules.
1 - STANDALONE: Appropriate for a basic stand-alone web-surfing workstation
2 - MASQUERADE: Appropriate for a machine acting as an Internet gateway
for a LAN
>>> Choose a type of firewall (0-2): 1

** Summary of what you entered **

Ethernet Interface: eth1
User name: test@hoge.net
Activate-on-demand: No
DNS: Do not adjust
Firewalling: STANDALONE


以上の設定で問題なければ y を入力して終了します.

>>> Accept these settings and adjust configuration files (y/n)? y

この設定は, /etc/ppp/pppoe.conf に書き込まれます. ADSL の接続には下記のコマンドを実行します.

# adsl-start

切断するには下記のコマンドを実行します.

# adsl-stop

以上で ADSL 接続のための設定は完了です. 尚, ここまでの設定をマウス操作と必要項目を入力していくことが出来るツールである rp-pppoe-gui もあります. PPPoE SoftWere のサイト にありますのでコマンド操作よりも GUI の方が好みの方は試してみるといいでしょう. 尚, Turbolinux 7 には初めからインストール済みです




ブロードバンドルーターを使った接続


ブリッジタイプのモデムの場合, 複数の PC から同時接続するにはルーターが必要です. 私の場合はフレッツ ADSL で, ブロードバンドルーターに NTT-ME BA5000 SOHO といった環境です. こういった環境ではルーター側の設定さえ出来てしまえば上述のようなソフトウエアや設定等は必要ありません.





HOME