Home
Packages
Forums
Wiki
GitLab
Security
AUR
Download
コンテンツにスキップ
メインメニュー
メインメニュー
サイドバーに移動
非表示
案内
メインページ
目次
コミュニティに貢献
最近の出来事
おまかせ表示
特別ページ
交流
ヘルプ
貢献
最近の更新
最近の議論
新しいページ
統計
リクエスト
ArchWiki
検索
検索
表示
アカウント作成
ログイン
個人用ツール
アカウント作成
ログイン
Pppdのソースを表示
ページ
議論
日本語
閲覧
ソースを閲覧
履歴を表示
ツール
ツール
サイドバーに移動
非表示
操作
閲覧
ソースを閲覧
履歴を表示
全般
リンク元
関連ページの更新状況
ページ情報
表示
サイドバーに移動
非表示
←
Pppd
あなたには「このページの編集」を行う権限がありません。理由は以下の通りです:
この操作は、次のグループに属する利用者のみが実行できます:
登録利用者
。
このページのソースの閲覧やコピーができます。
[[Category:ネットワーク]] [[en:Pppd]] [[ru:Pppd]] {{Lowercase title}} '''ppp''' (Paul's PPP Package) は [[Wikipedia:ja:Point-to-Point Protocol|Point-to-Point Protocol]] (PPP) を実装する Linux と Solaris システム用のオープンソースパッケージです。''pppd'' デーモンとして実装されており {{Pkg|xl2tpd}}, {{Pkg|pptpd}}, [[netctl]] のバックエンドとして動作します。 [[Wikipedia:ja:第3世代移動通信システム|3G]], [[Wikipedia:ja:Layer 2 Tunneling Protocol|L2TP]], [[Wikipedia:ja:PPPoE|PPPoE]] 接続は内部的に PPP プロトコルに基づいているため ppp で処理することができます。 == インストール == [[公式リポジトリ]]の {{Pkg|ppp}} を[[インストール]]してください。 カーネルに PPPoE サポートが組み込まれていることを確認してください (デフォルトのカーネルには存在します): {{hc|1=$ zgrep CONFIG_PPPOE /proc/config.gz| 2=CONFIG_PPPOE=m}} == 設定 == === PPPoE === 接続設定ファイルの作成: {{hc|/etc/ppp/peers/''your_provider''| plugin rp-pppoe.so # rp_pppoe_ac 'your ac name' # rp_pppoe_service 'your service name' # network interface eth0 # login name name "''someloginname''" usepeerdns persist # Uncomment this if you want to enable dial on demand #demand #idle 180 defaultroute hide-password noauth}} {{ic|usepeerdns}} オプションを使用すると、''pppd'' は {{ic|/etc/ppp/resolv.conf}} ファイルを作成して接続の確立時に DNS アドレスを取得します。デフォルトでは、{{ic|/etc/ppp/ip-up.d/00_dns}} フックスクリプトがこのファイルを {{ic|/etc/resolv.conf}} に移動して、システムがネームサーバーを使えるようにします。この挙動が望ましくない場合 (例: ローカルのキャッシュ DNS を使う場合)、必要に応じて {{ic|/etc/ppp/ip-up.d/00_dns.sh}} を編集してください。 ISP が使用している認証方法に合わせて以下のような行を {{ic|/etc/ppp/pap-secrets}} か {{ic|/etc/ppp/chap-secrets}} に記述してください。両方のファイルに記述しても問題ありません、''pppd'' は自動的に適切な方を使います: ''someloginname'' * ''yourpassword'' 次のコマンドを使えば接続を開始できます: # pppd call ''your_provider'' もしくは、次のコマンドを使ってください: # pon ''your_provider'' ''your_provider'' は {{ic|/etc/ppp/peers}} のオプションファイルの名前に置き換えてください。 PPPoE 接続が正しく開始されたかどうか確認するには、システムログの ''pppd'' の出力を見て下さい: # journalctl -b --no-pager | grep pppd 接続が成功していれば、以下のようなメッセージが表示されます: Jul 09 22:42:33 localhost pppd[239]: Plugin rp-pppoe.so loaded. Jul 09 22:42:33 localhost pppd[239]: RP-PPPoE plugin version 3.8p compiled against pppd 2.4.6 Jul 09 22:42:33 localhost network[184]: RP-PPPoE plugin version 3.8p compiled against pppd 2.4.6 Jul 09 22:42:33 localhost pppd[239]: pppd 2.4.6 started by root, uid 0 Jul 09 22:42:39 localhost pppd[239]: PPP session is 292 Jul 09 22:42:39 localhost pppd[239]: Connected to a0:f3:e4:4f:e3:b0 via interface enp4s0 Jul 09 22:42:39 localhost pppd[239]: Using interface ppp0 Jul 09 22:42:39 localhost pppd[239]: Connect: ppp0 <--> enp4s0 Jul 09 22:42:39 localhost pppd[239]: CHAP authentication succeeded: CHAP authentication success Jul 09 22:42:39 localhost pppd[239]: CHAP authentication succeeded Jul 09 22:42:39 localhost pppd[239]: peer from calling number A0:F3:E4:4F:E3:B0 authorized Jul 09 22:42:39 localhost pppd[239]: Cannot determine ethernet address for proxy ARP Jul 09 22:42:39 localhost pppd[239]: local IP address 10.6.2.137 Jul 09 22:42:39 localhost pppd[239]: remote IP address 10.6.1.1 Jul 09 22:42:39 localhost pppd[239]: primary DNS address 10.6.1.1 Jul 09 22:42:39 localhost pppd[239]: secondary DNS address 210.21.196.6 デフォルトでは {{ic|/etc/ppp/peers/provider}} の設定がデフォルトとして扱われます。"your_provider" をデフォルトにしたい場合は、以下のようなリンクを作成することができます: # ln -s /etc/ppp/peers/''your_provider'' /etc/ppp/peers/provider これで次を実行するだけで接続を開始できます: # pon 接続を終了するには、次のコマンドを使用: # poff ''your_provider'' === ブート時に pppd を起動 === * {{ic|ppp_generic}} モジュールをブート時にロードするように設定してください。詳しくは[[カーネルモジュール]]を参照。 * systemd のサービスを[[有効化]]してください: # systemctl enable ppp@''your_provider''.service == Tips and tricks == === 自動リダイヤル === ''pppd'' が実行中の場合、{{ic|SIGHUP}} シグナルをプロセスに送ることで強制的に接続をリセットできます: # export PPPD_PID=$(pidof pppd) # kill -s HUP $PPPD_PID And you have redialed the connection. {{Note|Make sure you have {{ic|persist}} option enabled in your {{ic|/etc/ppp/peers/provider}} tab. Additionally you might want to set {{ic|holdoff 0}} to reconnect without waiting.}} === 24時間後に ISP と自動で切断 === {{Note|If you aren't running your computer always on (running 24/7) then you can skip this step.}} If you use a flat-rate always-on connection on a computer, some providers restart your connection after 24h. That makes sure that the IP is rotated every 24h. To compensate, you can use an dynamic DNS service in combination with {{AUR|inadyn}} to compensate for the rotating IP address. But to avoid disconnects when you don't need it, you might try to restart the connection using a cron job or [[systemd]] timer at a time of day you know no one will be using the connection (e.g. at 4 AM). ==== cron を使う ==== root で以下の手順に従ってください: Create a bash script similar to this and give it a name (e.g. {{ic|pppd_redial.sh}}): #!/bin/bash message="Restarting the PPP connection @:" $(date) pppd_id=$(pidof pppd) kill -s HUP $pppd_id echo $message Give it execute permissions and put it on a path visible to root. Then create a cron job using {{ic|crontab -e}}. Check that your {{ic|EDITOR}} env variable is set if the command fails. So add anywhere in the file, 0 4 * * * /bin/bash /root/pppd_redial.sh {{ic|cronie}} サービスが動くことを確認してください。動かない場合は、サービスを[[有効化]]して[[起動]]してください。 保存して終了です。これで PPPoE 接続は毎日朝4時に再起動します。 ==== systemd タイマーを使う ==== [[systemd]] タイマーと ''poff'' スクリプト (特に {{ic|-r}} オプション) を使って強制的に再接続する方法もあります。同じ名前の ''.service'' と ''.timer'' ファイルを作成してください: {{hc|ppp-redial.timer|<nowiki> [Unit] Description=Reconnect PPP connections daily [Timer] OnCalendar=*-*-* 05:00:00 [Install] WantedBy=multi-user.target </nowiki>}} {{hc|ppp-redial.service|<nowiki> [Unit] Description=Reconnect PPP connections [Service] Type=simple ExecStart=/usr/bin/poff -r </nowiki>}} タイマーを[[有効化]]して[[起動]]すれば systemd が特定時刻に再起動するようになります。 == トラブルシューティング == === デフォルトルート === If you have a preconfigured default route before the ''pppd'' is started, the default route is kept, so take a look in {{ic|/var/log/errors.log}} and if you have something like: pppd[nnnn]: not replacing existing default route via ''xxx.xxx.xxx.xxx'' and {{ic|xxx.xxx.xxx.xxx}} is not the correct route for you * Create a new script in {{ic|/etc/ppp/ip-pre-up}} with this content: {{hc|/etc/ppp/ip-pre-up/10-route-del-default.sh| #!/bin/sh /usr/bin/route del default }} * {{ic|pppd}} サービスを[[再起動]]してください。 === マスカレードが動作しているのにサイトが動かない === The MTU under pppoe is 1492 bytes. Most sites use an MTU of 1500. So your connection sends an ICMP 3:4 (fragmentation needed) packet, asking for a smaller MTU, but some sites have their firewall blocking that. Enabling the PMTU clamping in [[iptables]] can solve that: iptables -I FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu Now, for some reason, just trying to save the resulting iptables configuration with ''iptables-save'' and restoring it later, does not work. It has to be executed after the other iptables configuration had been loaded. So, here is a systemd unit to solve it: {{hc|pmtu-clamping.service|<nowiki> [Unit] Description=PMTU clamping for pppoe Requires=iptables.service After=iptables.service [Service] Type=oneshot ExecStart=/usr/bin/iptables -I FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu [Install] WantedBy=multi-user.target </nowiki>}} And [[enable]] it. === pppd が ppp_generic カーネルモジュールをロードできない === When starting PPTP client, the ''pppd'' process cannot locate the appropriate module: Couldn't open the /dev/ppp device: No such device or address Please load the ppp_generic kernel module. The solution is to edit the {{ic|/etc/modprobe.d/modules.conf}} file and change alias char-major-108 ppp to alias char-major-108 ppp_generic or just add such alias if it does not exist. The correct module will be loaded after reboot.
このページで使用されているテンプレート:
テンプレート:AUR
(
ソースを閲覧
)
テンプレート:Aur
(
ソースを閲覧
)
テンプレート:Aur-mirror
(
ソースを閲覧
)
テンプレート:Broken package link
(
ソースを閲覧
)
テンプレート:Hc
(
ソースを閲覧
)
テンプレート:Ic
(
ソースを閲覧
)
テンプレート:Lowercase title
(
ソースを閲覧
)
テンプレート:Note
(
ソースを閲覧
)
テンプレート:Pkg
(
ソースを閲覧
)
Pppd
に戻る。
検索
検索
Pppdのソースを表示
話題を追加