summaryrefslogtreecommitdiff
path: root/data/templates/l2tp/l2tp.config.tmpl
blob: cce526dd83c35ed10d16c785e3ac1453187e6af6 (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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
### generated by accel_l2tp.py ###
[modules]
log_syslog
l2tp
chap-secrets
{% for proto in auth_proto: %}
{{proto}}
{% endfor%}

{% if auth_mode == 'radius' %}
radius
{% endif -%}

ippool
shaper
ipv6pool
ipv6_nd
ipv6_dhcp

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

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

{% if dnsv4 %}
[dns]
{% for dns in dnsv4 -%}
dns{{ loop.index }}={{ dns }}
{% endfor -%}
{% endif %}

{% if dnsv6 %}
[ipv6-dns]
{% for dns in dnsv6 -%}
{{ dns }}
{% endfor -%}
{% endif %}

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

[l2tp]
verbose=1
ifname=l2tp%d
ppp-max-mtu={{mtu}}
mppe={{authentication['mppe']}}
{% if outside_addr %}
bind={{outside_addr}}
{% endif %}
{% if lns_shared_secret %}
secret={{lns_shared_secret}}
{% endif %}

[client-ip-range]
0.0.0.0/0

{% if (client_ip_pool) or (client_ip_subnets) %}
[ip-pool]
{% if client_ip_pool %}
{{client_ip_pool}}
{% endif -%}
{% if client_ip_subnets %}
{% for sn in client_ip_subnets %}
{{sn}}
{% endfor -%}
{% endif %}
{% endif %}
{% if gateway_address %}
gw-ip-address={{gateway_address}}
{% endif %}

{% if auth_mode == 'local' %}
[chap-secrets]
chap-secrets=/etc/accel-ppp/l2tp/chap-secrets
{% if gateway_address %}
gw-ip-address={{gateway_address}}
{% endif %}
{% endif %}

[ppp]
verbose=1
check-ip=1
single-session=replace
{% if idle_timeout %}
lcp-echo-timeout={{idle_timeout}}
{% endif %}
{% if ppp_options['lcp-echo-interval'] %}
lcp-echo-interval={{ppp_options['lcp-echo-interval']}}
{% else %}
lcp-echo-interval=30
{% endif %}
{% if ppp_options['lcp-echo-failure'] %}
lcp-echo-failure={{ppp_options['lcp-echo-failure']}}
{% else %}
lcp-echo-failure=3
{% endif %}
{% if ccp_disable %}
ccp=0
{% endif %}
{% if client_ipv6_pool %}
ipv6=allow
{% endif %}

{% if auth_mode == 'radius' %}
[radius]
{% for rsrv in authentication['radiussrv']: %}
server={{rsrv}},{{authentication['radiussrv'][rsrv]['secret']}},\
req-limit={{authentication['radiussrv'][rsrv]['req-limit']}},\
fail-time={{authentication['radiussrv'][rsrv]['fail-time']}}
{% endfor %}
{% if authentication['radiusopt']['timeout'] %}
timeout={{authentication['radiusopt']['timeout']}}
{% endif %}
{% if authentication['radiusopt']['acct-timeout'] %}
acct-timeout={{authentication['radiusopt']['acct-timeout']}}
{% endif %}
{% if authentication['radiusopt']['max-try'] %}
max-try={{authentication['radiusopt']['max-try']}}
{% endif %}
{% if authentication['radiusopt']['nas-id'] %}
nas-identifier={{authentication['radiusopt']['nas-id']}}
{% endif %}
{% if authentication['radius_source_address'] %}
nas-ip-address={{authentication['radius_source_address']}}
{% endif -%}
{% if authentication['radiusopt']['dae-srv'] %}
dae-server={{authentication['radiusopt']['dae-srv']['ip-addr']}}:\
{{authentication['radiusopt']['dae-srv']['port']}},\
{{authentication['radiusopt']['dae-srv']['secret']}}
{% endif -%}
gw-ip-address={{gateway_address}}
verbose=1
{% endif -%}

{% if client_ipv6_pool %}
[ipv6-pool]
{% for prfx in client_ipv6_pool.prefix: %}
{{prfx}}
{% endfor %}
{% for prfx in client_ipv6_pool.delegate_prefix: %}
delegate={{prfx}}
{% endfor %}
{% endif %}

{% if client_ipv6_pool['delegate_prefix'] %}
[ipv6-dhcp]
verbose=1
{% endif %}

{% if authentication['radiusopt']['shaper'] %}
[shaper]
verbose=1
attr={{authentication['radiusopt']['shaper']['attr']}}
{% if authentication['radiusopt']['shaper']['vendor'] %}
vendor={{authentication['radiusopt']['shaper']['vendor']}}
{% endif -%}
{% endif %}

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