Overview


Point to Point over Ethernet (PPPoE) is simply a method of encapsulating PPP packets into Ethernet frames. PPPoE is an extension of the standard Point to Point Protocol (PPP) and it the successor of PPPoA. PPPoE standard is defined inRFC 2516. The PPPoE client and server work over any Layer2 Ethernet level interface on the router, for example, Wireless, Ethernet, EoIP, etc. Generally speaking, PPPoE is used to hand out IP addresses to clients based on authentication by username (and also if required, by workstation) as opposed to workstation only authentication where static IP addresses or DHCP are used. It is advised not to use static IP addresses or DHCP on the same interfaces as PPPoE for obvious security reasons.

Introduction

PPPoE provides the ability to connect a network of hosts over a simple bridging access device to a remote Access Concentrator.

Supported connections:

  • MikroTik RouterOS PPPoE client to any PPPoE server;
  • MikroTik RouterOS server (access concentrator) to multiple PPPoE clients (clients are available for almost all operating systems and most routers);

PPPoE Operation

PPPoE has two distinct stages(phases):

  1. Discovery phase;
  2. Session phase;

Discovery phase

There are four steps to the Discovery stage. When it completes, both peers know the PPPoESESSION_IDand the peer's Ethernet address, which together define the PPPoE session uniquely:

  1. PPPoE Active Discovery Initialization (PADI) -The PPPoE client sends out aPADIpacket to the broadcast address. This packet can also populate the "service-name" field if a service name has been entered in the dial-up networking properties of the PPPoE client. If a service name has not been entered, this field is not populated
  2. PPPoE Active Discovery Offer (PADO) -The PPPoE server, or Access Concentrator, should respond to thePADIwith aPADOif the Access Concentrator is able to service the "service-name" field that had been listed in thePADIpacket. If no "service-name" field had been listed, the Access Concentrator will respond with aPADOpacket that has the "service-name" field populated with the service names that the Access Concentrator can service. ThePADOpacket is sent to the unicast address of the PPPoE client
  3. PPPoE Active Discovery Request (PADR) -When aPADOpacket is received, the PPPoE client responds with aPADRpacket. This packet is sent to the unicast address of the Access Concentrator. The client may receive multiplePADOpackets, but the client responds to the first validPADOthat the client received. If the initialPADIpacket had a blank "service-name" field filed, the client populates the "service-name" field of thePADRpacket with the first service name that had been returned in thePADOpacket.
  4. PPPoE Active Discovery Session Confirmation (PADS) -When thePADR收到,访问集中器生成一个unique session identification (ID) for the Point-to-Point Protocol (PPP) session and returns this ID to the PPPoE client in thePADSpacket. This packet is sent to the unicast address of the client.

PPPoE session termination:

  • PPPoE Active Discovery Terminate (PADT) -Can be sent anytime after a session is established to indicate that a PPPoE session terminated. It can be sent by either server or client.

Session phase

When the discovery stage is completed, both peers knowPPPoE Session IDand other peer'sEthernet (MAC) addresswhich together defines the PPPoE session. PPP frames are encapsulated in PPPoE session frames, which have Ethernet frame type0x8864.
When a server sends confirmation and a client receives it, PPP Session is started that consists of the following stages:

  1. LCP negotiationstage
  2. Authentication (CHAP/PAP)stage
  3. IPCP negotiationstage - where the client is assigned an IP address.

If any process fails, the LCP negotiation establishment phase is started again.


PPPoE server sendsEcho-Request包给客户确定的状态e session, otherwise, the server will not be able to determine that session is terminated in cases when a client terminates session without sendingTerminate-Requestpacket.

MTU

Typically, the largest Ethernet frame that can be transmitted without fragmentation is 1500 bytes. PPPoE adds another 6 bytes of overhead and the PPP field adds two more bytes, leaving 1492 bytes for IP datagram. Therefore max PPPoE MRU and MTU values must not be larger than 1492.

TCP stacks try to avoid fragmentation, so they use an MSS (Maximum Segment Size). By default, MSS is chosen as MTU of the outgoing interface minus the usual size of the TCP and IP headers (40 bytes), which results in 1460 bytes for an Ethernet interface. Unfortunately, there may be intermediate links with lower MTU which will cause fragmentation. In such a case TCP stack performs path MTU discovery. Routers that cannot forward the datagram without fragmentation are supposed to drop the packet and sendICMP-Fragmentation-Required原始主机。当主机接收到这样一个ICMP packet, it tries to lower the MTU. This should work in the ideal world, however in the real world many routers do not generate fragmentation-required datagrams, also many firewalls drop all ICMP datagrams.

The workaround for this problem is toadjust MSSif it is too big.

PPPoE Client

Properties

Property Description
ac-name(string; Default:"") Access Concentrator name, this may be left blank and the client will connect to any access concentrator on the broadcast domain
add-default-route(yes|no; Default:no) Enable/Disable whether to add default route automatically
allow(mschap2|mschap1|chap|pap; Default:mschap2,mschap1,chap,pap) allowed authentication methods, by default all methods are allowed
default-route-distance(byte [0..255]; Default:1) sets distance value applied to auto created default route, if add-default-route is also selected
dial-on-demand(yes|no; Default:no) connects to AC only when outbound traffic is generated. If selected, then route with gateway address from 10.112.112.0/24 network will be added while connection is not established.
interface(string; Default: ) interface name on which client will run
keepalive-timeout(integer; Default:60) Sets keepalive timeout in seconds.
max-mru(integer; Default:1460) Maximum Receive Unit
max-mtu(integer; Default:1460) Maximum Transmission Unit
mrru(integer: 512..65535|disabled; Default:disabled) maximum packet size that can be received on the link. If a packet is bigger than tunnel MTU, it will be split into multiple packets, allowing full size IP or Ethernet packets to be sent over the tunnel.
name(string; Default:pppoe-out[i]) name of the PPPoE interface, generated by RouterOS if not specified
password(string; Default: ) password used to authenticate
profile(string; Default:default) Specifies which PPP profile configuration will be used when establishing the tunnel.
service-name(string; Default:"") specifies the service name set on the access concentrator, can be left blank to connect to any PPPoE server
use-peer-dns(yes|no; Default:no) enable/disable getting DNS settings from the peer
user(string; Default:"")

username used for authentication

Status

Command/interface pppoe-client monitorwill display current PPPoE status.

Available read only properties:

Property Description
ac-mac(MAC address) MAC address of the access concentrator (AC) the client is connected to
ac-name(string) name of the Access Concentrator
active-links(integer) Number of bonded MLPPP connections, ('1' if not using MLPPP)
encoding(string) encryption and encoding (if asymmetric, separated with '/') being used in this connection
local-address(IP Address) IP Address allocated to client
remote-address(IP Address) Remote IP Address allocated to server (ie gateway address)
mru(integer) effective MRU of the link
mtu(integer) effective MTU of the link
service-name(string) used service name
status(string) current link status. Available values are:
  • dialing,
  • verifying password...,
  • connected,
  • disconnected.
uptime(time) connection time displayed in days, hours, minutes and seconds

Scanner

PPPoE Scanner allows scanning all active PPPoE servers in the layer2 broadcast domain. Command to run scanner is as follows:

/interface pppoe-client scan [interface]

Available read only properties:

Property Description
service(string) Service name configured on server
mac-address(MAC) Mac address of detected server
ac-name(string) name of the Access Concentrator

For Windows, some connection instructions may use the form where the "phone number", such as "MikroTik_AC\mt1", is specified to indicate that "MikroTik_AC" is the access concentrator name and "mt1" is the service name.

Specifying MRRU means enabling MP (Multilink PPP) over a single link. This protocol is used to split big packets into smaller ones. Under Windows, it can be enabled in the Networking tab, Settings button, "Negotiate multi-link for single link connections". MRRU is hardcoded to 1614 on Windows. This setting is useful to overcome PathMTU discovery failures. The MP setting should be enabled on both peers.

PPPoE Server

There are two types of interface (tunnel) items in PPPoE server configuration - static users and dynamic connections. An interface is created for each tunnel established to the given server. Static interfaces are added administratively if there is a need to reference the particular interface name (in firewall rules or elsewhere) created for the particular user. Dynamic interfaces are added to this list automatically whenever a user is connected and its username does not match any existing static entry (or in case the entry is active already, as there can not be two separate tunnel interfaces referenced by the same name - setone-session-per-hostvalue if this is a problem). Dynamic interfaces appear when a user connects and disappear once the user disconnects, so it is impossible to reference the tunnel created for that use in router configuration (for example, in firewall), so if you need a persistent rule for that user, create a static entry for him/her. Otherwise, it is safe to use a dynamic configuration.

In both cases PPP users must be configured properly - static entries do not replace PPP configuration.

Access concentrator

/interface pppoe-server server

Properties

Property Description
authentication(mschap2 | mschap1 | chap | pap; Default:"mschap2, mschap1, chap, pap") Authentication algorithm
default-profile(string; Default:"default")
interface(string; Default:"") Interface that the clients are connected to
keepalive-timeout(time; Default:"10") Defines the time period (in seconds) after which the router is starting to send keepalive packets every second. If there is no traffic and no keepalive responses arrive for that period of time (i.e. 2 * keepalive-timeout), the non responding client is proclaimed disconnected.
max-mru(integer; Default:"1480") Maximum Receive Unit. The optimal value is the MTU of the interface the tunnel is working over reduced by 20 (so, for 1500-byte Ethernet link, set the MTU to 1480 to avoid fragmentation of packets)
max-mtu(integer; Default:"1480") 最大传输单位。最优值是the MTU of the interface the tunnel is working over reduced by 20 (so, for 1500-byte Ethernet link, set the MTU to 1480 to avoid fragmentation of packets)
max-sessions(integer; Default:"0") Maximum number of clients that the AC can serve. '0' = no limitations.
mrru(integer: 512..65535 | disabled; Default:"disabled") Maximum packet size that can be received on the link. If a packet is bigger than tunnel MTU, it will be split into multiple packets, allowing full size IP or Ethernet packets to be sent over the tunnel.
one-session-per-host(yes | no; Default:"no") Allow only one session per host (determined by MAC address). If a host tries to establish a new session, the old one will be closed.
service-name(string; Default:"") The PPPoE service name. Server will accept clients which sends PADI message with service-names that matches this setting or if service-name field in PADI message is not set.

The PPPoE server (access concentrator) supports multiple servers for each interface - with differing service names. The access concentrator name and PPPoE service name are used by clients to identify the access concentrator to register with. The access concentrator name is the same as the identity of the router displayed before the command prompt. The identity may be set within the/system identitysubmenu.

Do not assign an IP address to the interface you will be receiving the PPPoE requests on.


Specifying MRRU means enabling MP (Multilink PPP) over a single link. This protocol is used to split big packets into smaller ones. Their MRRU is hardcoded to 1614. This setting is useful to overcome PathMTU discovery failures. The MP setting should be enabled on both peers.

The defaultkeepalive-timeoutvalue of 10s is OK in most cases. If you set it to 0, the router will not disconnect clients until they explicitly log out or the router is restarted. To resolve this problem, the one-session-per-host property can be used.

Quick Example

PPPoE Client

To configure MikroTik RouterOS to be a PPPoE client, just add a PPPoE-client with the following parameters as in the example:

[admin@MikroTik] > interface pppoe-client add interface=ether2 password=StrongPass service-name=pppoeservice name=PPPoE-Out disabled=no user=MT-User [admin@MikroTik] > interface pppoe-client print Flags: X - disabled, I - invalid, R - running 0 R name="PPPoE-Out" max-mtu=auto max-mru=auto mrru=disabled interface=ether2 user="MT-User" password="StrongPass" profile=default keepalive-timeout=10 service-name="pppoeservice" ac-name="" add-default-route=no dial-on-demand=no use-peer-dns=no allow=pap,chap,mschap1,mschap2

PPPoE Server

To configure MikroTik RouterOS to be an Access Concentrator (PPPoE Server):

  • add an IP address pool for the clients from 10.0.0.2-10.0.0.5;
  • add PPP profile;
  • add PPP secret (username/password);
  • add the PPPoE server itself;
[admin@MikroTik] > /ip pool add name=pppoe-pool ranges=10.0.0.2-10.0.0.5 [admin@MikroTik] > /ppp profile add local-address=10.0.0.1 name=for-pppoe remote-address=pppoe-pool [admin@MikroTik] > /ppp secret add name=MT-User password=StrongPass profile=for-pppoe service=pppoe [admin@MikroTik] > /interface pppoe-server server add default-profile=for-pppoe disabled=no interface=ether3 service-name=pppoeservice



  • No labels