summaryrefslogtreecommitdiff
path: root/data/templates/accel-ppp/l2tp.config.j2
blob: f041e278e0c1dbafa5a9ee1f89a3b4bf1b90edf7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
### generated by accel_l2tp.py ###
[modules]
log_syslog
l2tp
shaper
{# Common authentication backend definitions #}
{% include 'accel-ppp/config_modules_auth_mode.j2' %}
ippool
{# Common IPv6 definitions #}
{% include 'accel-ppp/config_modules_ipv6.j2' %}
{# Common authentication protocols (pap, chap ...) #}
{% include 'accel-ppp/config_modules_auth_protocols.j2' %}

[core]
thread-count={{ thread_count }}

[common]
{% if max_concurrent_sessions is vyos_defined %}
max-starting={{ max_concurrent_sessions }}
{% endif %}

[log]
syslog=accel-l2tp,daemon
copy=1
level=5

{# Common DNS name-server definition #}
{% include 'accel-ppp/config_name_server.j2' %}

{% if wins_server is vyos_defined %}
[wins]
{%     for server in wins_server %}
wins{{ loop.index }}={{ server }}
{%     endfor %}
{% endif %}

[l2tp]
verbose=1
ifname=l2tp%d
ppp-max-mtu={{ mtu }}
mppe={{ ppp_options.mppe }}
{% if outside_address is vyos_defined %}
bind={{ outside_address }}
{% endif %}
{% if lns.shared_secret is vyos_defined %}
secret={{ lns.shared_secret }}
{% endif %}
{% if lns.host_name is vyos_defined %}
host-name={{ lns.host_name }}
{% endif %}
{% if default_pool is vyos_defined %}
ip-pool={{ default_pool }}
{% endif %}
{% if default_ipv6_pool is vyos_defined %}
ipv6-pool={{ default_ipv6_pool }}
ipv6-pool-delegate={{ default_ipv6_pool }}
{% endif %}

[client-ip-range]
0.0.0.0/0

{# Common IP pool definitions #}
{% include 'accel-ppp/config_ip_pool.j2' %}

{# Common chap-secrets and RADIUS server/option definitions #}
{% include 'accel-ppp/config_chap_secrets_radius.j2' %}

[ppp]
verbose=1
check-ip=1
single-session=replace
lcp-echo-interval={{ ppp_options.lcp_echo_interval }}
lcp-echo-timeout={{ ppp_options.lcp_echo_timeout }}
lcp-echo-failure={{ ppp_options.lcp_echo_failure }}
{# MTU #}
mtu={{ mtu }}
ipv6={{ 'allow' if ppp_options.ipv6 is vyos_defined("deny") and client_ipv6_pool is vyos_defined else ppp_options.ipv6 }}
ipv4={{ ppp_options.ipv4 }}
mppe={{ ppp_options.mppe }}
{% if ccp_disable is vyos_defined %}
ccp=0
{% endif %}
unit-preallocate={{ "1" if authentication.radius.preallocate_vif is vyos_defined else "0" }}

{% if ppp_options.ipv6_intf_id is vyos_defined %}
ipv6-intf-id={{ ppp_options.ipv6_intf_id }}
{% endif %}
{% if ppp_options.ipv6_peer_intf_id is vyos_defined %}
ipv6-peer-intf-id={{ ppp_options.ipv6_peer_intf_id }}
{% endif %}
ipv6-accept-peer-intf-id={{ "1" if ppp_options.ipv6_accept_peer_intf_id is vyos_defined else "0" }}

{# Common IPv6 pool definitions #}
{% include 'accel-ppp/config_ipv6_pool.j2' %}

{# Common RADIUS shaper configuration #}
{% include 'accel-ppp/config_shaper_radius.j2' %}

[cli]
tcp=127.0.0.1:2004
sessions-columns=ifname,username,calling-sid,ip,{{ ip6_column | join(',') }}{{ ',' if ip6_column }}rate-limit,type,comp,state,rx-bytes,tx-bytes,uptime