# prol2tpd configuration - L2TPv2 LNS

# The system block defines system-wide settings.

system {
    # Set the IP addresses and optionally UDP ports that prol2tpd listens on.
    listen 10.42.42.10

    # When the LNS communicates with peers to setup L2TP tunnels, it
    # indicates its hostname to peers. This defaults to the Linux
    # system's hostname but can be overridden.
    hostname "mylns"

    # Tunnel and session limits. By default, limits are set by the license.
    max_tunnels 5
    max_sessions 10000

    # Log level.
    log_level notice
}

# The set of L2TP peers from which L2TP tunnel setup requests are
# accepted is defined by peer profiles.
peer profile "lac1" {
    peer_ipaddr 1.2.3.4
    tunnel_profile_name "lac1"
}
peer profile "lac2" {
    peer_ipaddr 10.20.30.40
    tunnel_profile_name "lac2"
}

# When a tunnel setup request is received from a peer, parameters for
# the new tunnel are defined in a tunnel profile. Tunnel profiles may
# be shared by multiple tunnel instances if those tunnels share the
# same settings.
tunnel profile "lac1" {
    # Force L2TPv2. If proto_version is not set, we allow L2TPv2 or
    # L2TPv3 peers.
    proto_version 2

    # Authenticate the peer using the shared secret configured here.
    auth_mode authenticated
    secret "lac1-tunnel-secret"

    # Enable AVP hiding. Some AVPs in L2TP control messages may be
    # hidden to obscure their values from network snoopers.
    hide_avps yes

    # Disable UDP checksums. Enable if required.
    use_udp_checksums no

    # Tune L2TP control message reliable delivery.
    #retry_timeout 1
    #max_retries 5
    #rx_window_size 10
    #tx_window_size 10

    # Send a periodic L2TP Hello message to the peer every 60s.
    hello_timeout 60

    # Close the tunnel if it has no sessions for longer than 60s.
    idle_timeout 60

    # Indicate the session profile to use for sessions in this tunnel.
    session_profile_name "lac"
}
tunnel profile "lac2" {
    proto_version 2
    auth_mode authenticated
    secret "lac2-tunnel-secret"
    hide_avps no
    use_udp_checksums yes
    hello_timeout 60
    rx_window_size 4
    tx_window_size 4
    retry_timeout 1
    idle_timeout 60
    session_profile_name "lac"
}

# Session parameters are defined in session profiles. With L2TPv2, all
# sessions are PPP. The session profile calls out the pseudowire
# profile to use.
session profile "lac" {
    pseudowire_profile_name "ppp"
}

# For PPP, the pseudowire configuration is defined in a propppd profile.
pseudowire profile "ppp" {
    pseudowire_type ppp

    # Add args to be added in proppp create requests. PPP parameters
    # for the session can be overridden here. In this config, we use
    # the config of propppd's default profile.
    #extra_options "profile default"
}
