STARTUP-CONFIG(5)
β¨ startup-config(5) β the l2tpns config file β¨
π NAME π
startup-config β the configuration file for l2tpns. That's the whole vibe.
π SYNOPSIS π
/etc/l2tpns/startup-config
π¬ DESCRIPTION π¬
Okay so startup-config is literally the configuration file for l2tpns.
The format is plain text, same energy as what the configuration mode of l2tpns's telnet administrative interface accepts. Comments are indicated by either the character # or !. Periodt.
π οΈ SETTINGS π οΈ
Settings are specified with:
set variable value
A list of the possible configuration directives follows. Each of these should be set by a line like:
set configstring βvalueβ
set ipaddress 192.168.1.1
set boolean true
The following variables may be set β bestie, this is the whole menu, no skips:
accounting_dir(string) β If set to a directory, then every 5 minutes the current usage for every connected user will be dumped to a file in this directory. Each file dumped begins with a header, where each line is prefixed by#. Following the header is a single line for every connected user, fields separated by a space. The fields areusername,ip,qos,uptxoctets,downrxoctets,origin(optional). Theqosfield is1if a standard user, and2if the user is throttled. Theoriginfield isdumpifaccount_all_originis set totrue(origin value:L=LAC data,R=Remote LNS data,P=PPPOE data). β¨account_all_origin(boolean) β If set totrue, all origin of the usage is dumped to the accounting file (LAC+Remote LNS+PPPOE) (defaultfalse).allow_duplicate_users(boolean) β Allow multiple logins with the same username. Iffalse(the default), any prior session with the same username will be dropped when a new session is established.auth_tunnel_change_addr_src(boolean) β This parameter authorizes changing the source IP of the tunnels l2tp. This parameter can be used when the remotes BAS/LAC arel2tpnsserver configured in cluster mode, but the interface to remote LNS are not clustered (the tunnel can be coming from different source IP). This is currently incompatible with kernel acceleration. (default:no).bind_address(ip address) β It's the listen address of the l2tp udp protocol sent and received to LAC. This address is also assigned to the tun interface if noiftun_addressis specified. Packets containing user traffic should be routed via this address if given, otherwise the primary address of the machine.bind_multi_address(ip address) β This parameter permits one to listen on several addresses of the l2tp udp protocol (and set several addresses to the tun interface). WHEN this parameter is set, It OVERWRITES the parameters"bind_address"and"iftun_address". These can be interesting when you want to do load-balancing in cluster mode of the uploaded from the LAC. For example you can set abgp.prepend(MY_AS)forAddress1onLNS1and abgp.prepend(MY_AS)forAddress2onLNS2(see BGP AS-path prepending). Example of use with 2 address:
set bind_multi_address "64.14.13.41, 64.14.13.42"
cluster_address(ip address) β Multicast cluster address (default:239.192.13.13). See the section on Clustering for more information.cluster_port(int) β UDP cluster port (default:32792). See the section on Clustering for more information.cluster_interface(string) β Interface for cluster packets (default:none).cluster_mcast_ttl(int) β TTL for multicast packets (default:1).cluster_hb_interval(int) β Interval in tenths of a second between cluster heartbeat/pings.cluster_hb_timeout(int) β Cluster heartbeat timeout in tenths of a second. A new master will be elected when this interval has been passed without seeing a heartbeat from the master.cluster_master_min_adv(int) β Determines the minimum number of up to date slaves required before the master will drop routes (default:1).debug(int) β Set the level of debugging messages written to the log file. The value should be between0and5, with0being no debugging, and5being the highest. A rough description of the levels is:0. Critical Errors - Things are probably broken1. Errors - Things might have gone wrong, but probably will recover2. Warnings - Just in case you care what is not quite perfect3. Information - Parameters of control packets4. Calls - For tracing the execution of the code5. Packets - Everything, including a hex dump of all packets processed... probably twice
Note that the higher you set the debugging level, the slower the program will run. Also, at level 5 a LOT of information will be logged. This should only ever be used for working out why it doesn't work at all. β οΈ
dump_speed(boolean) β If set totrue, then the current bandwidth utilization will be logged every second. Even if this is disabled, you can see this information by running theuptimecommand on the CLI.disable_sending_hello(boolean) β Disable l2tp sending HELLO message for Apple compatibility. Some OS X implementation of l2tp no manage the L2TP "HELLO message". (default:no).echo_timeout(int) β Time between last packet sent and LCP ECHO generation (default:10(seconds)).guest_accountβ Allow multiple logins matching this specific username.icmp_rate(int) β Maximum number of host unreachable ICMP packets to send per second.idle_echo_timeout(int) β Drop sessions who have not responded withinidle_echo_timeoutseconds (default:240(seconds)).iftun_address(ip address) β This parameter is used when you want a tun interface address different from the address of"bind_address"(For use in cases of specific configuration). If no address is given toiftun_addressandbind_address,1.1.1.1is used.l2tp_mtu(int) β MTU of interface for L2TP traffic (default:1500). Used to set link MRU and adjust TCP MSS.mp_mrru(int) β MRRU for MP traffic (default:1614). Can be set to0to disable MP negociation.l2tp_secret(string) β The secret used byl2tpnsfor authenticating tunnel request. Must be the same as the LAC, or authentication will fail. Only actually be used if the LAC requests authentication.lock_pages(boolean) β Keep all pages mapped by thel2tpnsprocess in memory.log_file(string) β This will be where all logging and debugging information is written to. This may be either a filename, such as/var/log/l2tpns, or the stringsyslog:facility, wherefacilityis any one of the syslog logging facilities, such aslocal5.multi_read_count(int) β Number of packets to read off each of the UDP and TUN fds when returned as readable byselect(default:10). Avoids incurring the unnecessary system call overhead ofselecton busy servers.packet_limit(int> β Maximum number of packets of downstream traffic to be handled each tenth of a second per session. If zero, no limit is applied (default:0). Intended as a DoS prevention mechanism and not a general throttling control (packets are dropped, not queued).peer_address(ip address) β Address to send to clients as the default gateway.pid_file(string) β If set, the process id will be written to the specified file. The value must be an absolute path.ppp_keepalive(boolean) β Change this value tonoto force generation of LCP ECHO everyecho_timeoutseconds, even there are activity on the link (default:yes).ppp_restart_time(int),ppp_max_configure(int),ppp_max_failure(int) β PPP counter and timer values, as described in Section 4.1 of RFC1661.ppp_restart_time, Restart timer for PPP protocol negotiation in seconds (default:3).ppp_max_configure, Number of configure requests to send before giving up (default:10).ppp_max_failure, Number of Configure-Nak requests to send before sending a Configure-Reject (default:5).
primary_dns(ip address),secondary_dns(ip address) β Whenever a PPP connection is established, DNS servers will be sent to the user, both a primary and a secondary. If either is set to0.0.0.0, then that one will not be sent.primary_radius(ip address),secondary_radius(ip address) β Sets the RADIUS servers used for both authentication and accounting. If the primary server does not respond, then the secondary RADIUS server will be tried. Note: in addition to the source IP address and identifier, the RADIUS server must include the source port when detecting duplicates to suppress (in order to cope with a large number of sessions coming on-line simultaneouslyl2tpnsuses a set of udp sockets, each with a separate identifier).primary_radius_port(short),secondary_radius_port(short) β Sets the authentication ports for the primary and secondary RADIUS servers. The accounting port is one more than the authentication port. If no RADIUS ports are given, the authentication port defaults to1812, and the accounting port to1813.radius_accounting(boolean) β If set totrue, then RADIUS accounting packets will be sent. This means that a Start record will be sent when the session is successfully authenticated, and a Stop record will be sent when the session is closed.radius_interim(int) β Ifradius_accountingis on, defines the interval between sending of RADIUS interim accounting records (in seconds).radius_secret(string) β This secret will be used in all RADIUS queries. If this is not set then RADIUS queries will fail.radius_require_message_authenticator(string) β If set totrue, RADIUS answers to AccessRequests will have to contain a valid MessageAuthenticator. If set toauto(default), if the first RADIUS answer to AccessRequests contains a valid MessageAuthenticator, subsequent answers will have to contain one. If set tono(not recommended), RADIUS answers to AccessRequests do not have to contain a valid MessageAuthenticator. It is advised to set this totrueafter checking that your RADIUS server does send MessageAuthenticator.radius_authtypes(string) β A comma separated list of supported RADIUS authentication methods (βpapβ or βchapβ), in order of preference (default βpapβ).radius_dae_port(short) β Port for DAE RADIUS (Packet of Death/Disconnect, Change of Authorization) requests (default:3799).radius_bind_min,radius_bind_max(int) β Define a port range in which to bind sockets used to send and receive RADIUS packets. Must be at leastRADIUS_FDS(64) wide. Simplifies firewalling of RADIUS ports (default: dynamically assigned).random_device(string) β Path to random data source (default/dev/urandom). Use ββ to use therand()library function.scheduler_fifo(boolean) β Sets the scheduling policy for thel2tpnsprocess toSCHED_FIFO. This causes the kernel to immediately preempt any currently runningSCHED_OTHER(normal) process in favour ofl2tpnswhen it becomes runnable. Ignored on uniprocessor systems.send_garp(boolean)
Determines whether or not to send a gratuitous ARP for the bind_address when the server is ready to handle traffic (default: true). β¨ This value is ignored if BGP is configured, so don't come crying to me when it does nothing, bestie.
tundevicename (string)β Name of the tun interface (default:βtun0β). πthrottle_speed (int)β Sets the default speed (in kbits/s) which sessions will be limited to. If this is set to0, then throttling will not be used at all. π Note: You can set this by the CLI, but changes will not affect currently connected users. no cap.throttle_buckets (int)β Number of token buckets to allocate for throttling. Each throttled session requires two buckets (in and out). πͺ£πͺ£kernel_accel (boolean)β Determines whether or not to enable kernel acceleration. Note that only onel2tpnsinstance can use it per network namespace, otherwise they will step on each other. π Also, if you have a lot of clients (e.g. at least a hundred), listening for DHCPv6 and RS requires a lot of igmp6 subscriptions, tuning sysctl may be needed, such as
sysctl net.core.optmem_max=1048576
otherwise the logs will mention failures to subscribe due to lack of memory. π
π DHCPv6 And IPv6 SETTINGS π
dhcp6_preferred_lifetime (int)β The preferred lifetime for the IPv6 address and the IPv6 prefix address, expressed in units of seconds (see rfc3315). β³dhcp6_valid_lifetime (int)β The valid lifetime for the IPv6 address and the IPv6 prefix address, expressed in units of seconds (see rfc3315). β³dhcp6_server_duid (int)β DUID Based on Link-layer Address (DUID-LL) (see rfc3315). πprimary_ipv6_dns,secondary_ipv6_dns (Ipv6 address)β IPv6 DNS servers will be sent to the user (see rfc3646). πdefault_ipv6_domain_list (string)β The Domain Search List (ex:βfdn.frβ) (see rfc3646). πipv6_prefix (Ipv6 address)β Enable negotiation of IPv6. This forms the the first 64 bits of the client allocated address. The remaining 64 come from the allocated IPv4 address and 4 bytes of0. π§©
heads up: that double "the the" is in the original, i'm just the messenger π
π LAC SETTINGS π
bind_address_remotelns (ip address)β Address of the interface to listen the remote LNS tunnels. If no address is given, all interfaces are listened (Any Address). πbind_portremotelns (short)β Port to bind for the Remote LNS (default:65432). π
A static REMOTES LNS configuration can be entered by the command:
setforward MASK IP PORT SECRET
- where
MASKspecifies the mask of users who have forwarded to remote LNS (ex:β/friendISP@company.comβ). π - where
IPspecifies the IP of the remote LNS (ex:β66.66.66.55β). π - where
PORTspecifies the L2TP Port of the remote LNS (Normally should be1701) (ex:1701). π’ - where
SECRETspecifies the secret password the remote LNS (ex:mysecret). π€«
The static REMOTE LNS configuration can be used when the friend ISP not have a proxied Radius. π«Ά
If a proxied Radius is used, It will return the RADIUS attributes:
Tunnel-Type:1 = L2TP
Tunnel-Medium-Type:1 = IPv4
Tunnel-Password:1 = βLESECRETL2TPβ
Tunnel-Server-Endpoint:1 = β88.xx.xx.x1β
Tunnel-Assignment-Id:1 = βfriendisp_lns1β
Tunnel-Type:2 += L2TP
Tunnel-Medium-Type:2 += IPv4
Tunnel-Password:2 += βLESECRETL2TPβ
Tunnel-Server-Endpoint:2 += β88.xx.xx.x2β
Tunnel-Assignment-Id:2 += βfriendisp_lns2β
π¦ PPPOE SETTINGS π¦
pppoe_if_to_bind (string)β PPPOE server interface to bind (ex:βeth0.12β), If not specified the server PPPOE is not enabled. For the pppoe clustering, all the interfaces PPPOE of the clusters must use the same HW address (MAC address). πpppoe_service_name (string)β PPPOE service name (default:NULL). π·οΈpppoe_ac_name (string)β PPPOE access concentrator name (default:βl2tpns-pppoeβ). πpppoe_only_equal_svc_name (boolean)β If set to yes, the PPPOE server only accepts clients with aβservice-nameβdifferent fromNULLand aβservice-nameβequal to serverβservice-nameβ(default:no). π¦
π BGP ROUTING π
The routing configuration section is entered by the command
router bgp as
where as specifies the local AS number. π’
Subsequent lines prefixed with neighbour peer define the attributes of BGP neighhbours. Valid commands are:
neighbour peer remote-as as
neighbour peer timers keepalive hold
Where peer specifies the BGP neighbour as either a hostname or IP address, as is the remote AS number and keepalive, hold are the timer values in seconds. β±οΈ
ngl "neighhbours" is spelled like that in the original, i'm keeping it fr fr π
β¨ NAMED ACCESS LISTS β¨
Named access lists may be defined with either of
ip access-list standard name
ip access-list extended name
Subsequent lines starting with permit or deny define the body of the access-list. π
Standard Access Lists
Standard access lists are defined with:
{permit|deny} source [dest]
Where source and dest specify IP matches using one of:
address wildard
host address
any
address and wildard are in dotted-quad notation, bits in the wildard indicate which address bits in address are relevant to the match (0 = exact match; 1 = don't care). π―
The shorthand host address is equivalent to address 0.0.0.0; any to 0.0.0.0 255.255.255.255. π«
Extended Access Lists
Extended access lists are defined with:
{permit|deny} proto source [ports] dest [ports] [flags]
Where proto is one of ip, tcp or udp, and source and dest are as described above for standard lists. π
For TCP and UDP matches, source and destination may be optionally followed by a ports specification:
{eq|neq|gt|lt} port
range from to
flags may be one of:
{match-any|match-all} {+|-}{fin|syn|rst|psh|ack|urg} ...β Match packets with any or all of the tcp flags set (+) or clear (-). π©establishedβ Match "established" TCP connections: packets withRSTorACKset, andSYNclear. π€fragmentsβ Match IP fragments. May not be specified on rules with layer 4 matches. π
π₯ SEE ALSO π₯
l2tpns(8), nsctl(8) β go read those next bestie, they're iconic fr π
π AUTHORS π
l2tpns developers l2tpns@lists.ffdn.org β absolute legends, we stan π«Ά
and that's a wrap on STARTUP-CONFIG(5)! πΈ this config file for l2tpns is dated January 31, 2021 (that's the version + date on the footer, in case you were wondering π) β go forth and configure, you've got this, mwah π
β¨
π¦ where this page comes from
- ubuntu resolute: l2tpns 2.5.0-1 Β· GPL+
- ubuntu stonking: l2tpns 2.5.0-1 Β· GPL+
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms