Difference between revisions of "Pppd"

From ArchWiki
Jump to: navigation, search
(added proper summary)
m (style cleanup)
Line 7: Line 7:
 
{{Article summary end}}
 
{{Article summary end}}
  
'''ppp''' (Paul's PPP Package) is an open source package which implements the [[Wikipedia:point-to-point protocol|point-to-point protocol]] (PPP) on Linux and Solaris systems. It is implemented as single '''pppd''' daemon and can be used as backend by {{Pkg|xl2tpd}}, {{Pkg|pptpd}} and other network tools including [[netcfg]]. [[Wikipedia:3G|3G]], [[Wikipedia:L2TP|L2TP]] and [[Wikipedia:PPPoE|PPPoE]] connections are internally based on PPP protocol and therefore can be managed by {{Pkg|ppp}}.
+
'''ppp''' (Paul's PPP Package) is an open source package which implements the [[Wikipedia:point-to-point protocol|point-to-point protocol]] (PPP) on Linux and Solaris systems. It is implemented as single '''pppd''' daemon and acts as backend for {{Pkg|xl2tpd}}, {{Pkg|pptpd}} and [[netcfg]]. [[Wikipedia:3G|3G]], [[Wikipedia:L2TP|L2TP]] and [[Wikipedia:PPPoE|PPPoE]] connections are internally based on PPP protocol and therefore can be managed by {{Pkg|ppp}}.
  
== Configuration ==
+
== Installation ==
 +
[[pacman|Install]] {{Pkg|ppp}}, available in the [[official repositories]].
  
* Make sure '''pppd''' is installed and your kernel is compiled with PPPoE support
+
Make sure that your kernel is compiled with PPPoE support (present in default kernel):
  
$ pacman -Q ppp
+
{{hc|1=$ zgrep CONFIG_PPPOE /proc/config.gz|
ppp 2.4.3-1
+
2=CONFIG_PPPOE=m}}
  
$ zgrep CONFIG_PPPOE /proc/config.gz
+
== Configuration ==
CONFIG_PPPOE=m
+
=== PPPoE ===
 +
Create the connection configuration file:
  
* Create the configuration file <code>/etc/ppp/peers/your_provider</code>
+
{{hc|/etc/ppp/peers/''your_provider''|
 
+
plugin rp-pppoe.so
# /etc/ppp/peers/your_provider
+
# rp_pppoe_ac 'your ac name'
 
+
# rp_pppoe_service 'your service name'
plugin rp-pppoe.so
+
# rp_pppoe_ac 'your ac name'
+
# rp_pppoe_service 'your service name'
+
 
    
 
    
# network interface
+
# network interface
eth0
+
eth0
# login name
+
# login name
name "someloginname"
+
name ''"someloginname"''
usepeerdns
+
usepeerdns
persist
+
persist
# Uncomment this if you want to enable dial on demand
+
# Uncomment this if you want to enable dial on demand
#demand
+
#demand
#idle 180
+
#idle 180
defaultroute
+
defaultroute
hide-password
+
hide-password
noauth
+
noauth}}
  
If you want usepeerdns to work, you have to edit your <code>/etc/ppp/ip-up</code> and add a command that copies <code>/etc/ppp/resolv.conf</code> to <code>/etc/resolv.conf</code>.
+
If you want usepeerdns to work, you have to edit your {{Ic|/etc/ppp/ip-up}} and add a command that copies {{Ic|/etc/ppp/resolv.conf}} to {{Ic|/etc/resolv.conf}}.
  
* Edit <code>/etc/ppp/pap-secrets</code>
+
Edit {{Ic|/etc/ppp/pap-secrets}}:
  
Put a line like this in <code>/etc/ppp/pap-secrets</code>
+
Put a line like this in {{Ic|/etc/ppp/pap-secrets}}
  
  someloginname * yourpassword
+
  ''someloginname'' * ''yourpassword''
  
 
You can now start the link using the command
 
You can now start the link using the command
  
  pppd call your_provider
+
  # pppd ''call your_provider''
  
 
Alternatively, you can use this
 
Alternatively, you can use this
  
  pon your_provider
+
  # pon ''your_provider''
  
By default the configuration in <code>/etc/ppp/peers/provider</code> is treated as the default, so if you want to make "your_provider" the default, you can create a link like this
+
By default the configuration in {{Ic|/etc/ppp/peers/provider}} is treated as the default, so if you want to make "your_provider" the default, you can create a link like this
  
  ln -s /etc/ppp/peers/your_provider /etc/ppp/peers/provider
+
  # ln -s /etc/ppp/peers/''your_provider'' /etc/ppp/peers/provider
  
 
Now you can start the link by simply running
 
Now you can start the link by simply running
  
  pon
+
  # pon
  
To close a pppoe connection, use this
+
To close a connection, use this
  
  poff your_provider
+
  # poff your_provider
  
 
== Starting pppd with Arch ==
 
== Starting pppd with Arch ==
  
* The init script <code>/etc/rc.d/ppp</code> calls the default ppp provider (<code>/etc/ppp/peers/provider</code>), so make sure you have the right configuration file there, otherwhise you could create a symlink to the desired provider as explained before.
+
* The init script {{Ic|/etc/rc.d/ppp}} calls the default ppp provider ({{Ic|/etc/ppp/peers/provider}}), so make sure you have the right configuration file there, otherwhise you could create a symlink to the desired provider as explained before.
  
* Make sure ppp module is loaded
+
* Make sure '''ppp''' module is loaded. If ppp support is compiled as a module, you have to load the {{Ic|ppp_generic}} module. In this case, add this to {{Ic|rc.conf}}:
 
+
If ppp support is compiled as a module, you have to load the <code>ppp_generic</code> module. In this case, add this to <code>rc.conf</code>:
+
  
 
  MODULES=(... ppp-generic ...)
 
  MODULES=(... ppp-generic ...)
  
* Add ppp to DAEMONS in <code>/etc/rc.conf</code>, and make sure that you also have the network daemon listed:
+
* Add ppp to {{Ic|DAEMONS}} in {{Ic|/etc/rc.conf}}, and make sure that you also have the network daemon listed:
  
 
  DAEMONS=(... network ... ppp ...)
 
  DAEMONS=(... network ... ppp ...)
  
* Also make sure that you have the correct interface declared in the networking section of <code>/etc/rc.conf</code>.
+
* Also make sure that you have the correct interface declared in the networking section of {{Ic|/etc/rc.conf}}.
== Troubleshooting ==
+
  
 +
== Troubleshooting ==
 
If you have a preconfigured default route before the pppd is started, the default route is kept, so take a look in <code>/var/log/errors.log</code> and if you have something like:
 
If you have a preconfigured default route before the pppd is started, the default route is kept, so take a look in <code>/var/log/errors.log</code> and if you have something like:
  

Revision as of 06:53, 9 June 2012

This template has only maintenance purposes. For linking to local translations please use interlanguage links, see Help:i18n#Interlanguage links.


Local languages: Català – Dansk – English – Español – Esperanto – Hrvatski – Indonesia – Italiano – Lietuviškai – Magyar – Nederlands – Norsk Bokmål – Polski – Português – Slovenský – Česky – Ελληνικά – Български – Русский – Српски – Українська – עברית – العربية – ไทย – 日本語 – 正體中文 – 简体中文 – 한국어


External languages (all articles in these languages should be moved to the external wiki): Deutsch – Français – Română – Suomi – Svenska – Tiếng Việt – Türkçe – فارسی

Summary help replacing me
This article explains how to set up a point-ti-point connections using pppd and the kernel PPPoE driver.

ppp (Paul's PPP Package) is an open source package which implements the point-to-point protocol (PPP) on Linux and Solaris systems. It is implemented as single pppd daemon and acts as backend for xl2tpd, pptpd and netcfg. 3G, L2TP and PPPoE connections are internally based on PPP protocol and therefore can be managed by ppp.

Installation

Install ppp, available in the official repositories.

Make sure that your kernel is compiled with PPPoE support (present in default kernel):

$ zgrep CONFIG_PPPOE /proc/config.gz
CONFIG_PPPOE=m

Configuration

PPPoE

Create the connection configuration file:

/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

If you want usepeerdns to work, you have to edit your /etc/ppp/ip-up and add a command that copies /etc/ppp/resolv.conf to /etc/resolv.conf.

Edit /etc/ppp/pap-secrets:

Put a line like this in /etc/ppp/pap-secrets

someloginname * yourpassword

You can now start the link using the command

# pppd call your_provider

Alternatively, you can use this

# pon your_provider

By default the configuration in /etc/ppp/peers/provider is treated as the default, so if you want to make "your_provider" the default, you can create a link like this

# ln -s /etc/ppp/peers/your_provider /etc/ppp/peers/provider

Now you can start the link by simply running

# pon

To close a connection, use this

# poff your_provider

Starting pppd with Arch

  • The init script /etc/rc.d/ppp calls the default ppp provider (/etc/ppp/peers/provider), so make sure you have the right configuration file there, otherwhise you could create a symlink to the desired provider as explained before.
  • Make sure ppp module is loaded. If ppp support is compiled as a module, you have to load the ppp_generic module. In this case, add this to rc.conf:
MODULES=(... ppp-generic ...)
  • Add ppp to DAEMONS in /etc/rc.conf, and make sure that you also have the network daemon listed:
DAEMONS=(... network ... ppp ...)
  • Also make sure that you have the correct interface declared in the networking section of /etc/rc.conf.

Troubleshooting

If you have a preconfigured default route before the pppd is started, the default route is kept, so take a look in /var/log/errors.log and if you have something like:

pppd[nnnn]: not replacing existing default route via xx.xx.xx.xx

and xx.xx.xx.xx is not the correct route for you

  • Create a new script /etc/ppp/ip-pre-up
$ chmod +x /etc/ppp/ip-pre-up

with this content:

#!/bin/sh
/sbin/route del default
  • Restart pppd:
$ /etc/rc.d/ppp restart