summaryrefslogtreecommitdiff
path: root/data/templates/accel-ppp/ipoe.config.j2
blob: f59428509994187a84ba45599801dba751c7b7a0 (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
{# j2lint: disable=operator-enclosed-by-spaces #}
### generated by ipoe.py ###
[modules]
log_syslog
ipoe
shaper
{# Common authentication backend definitions #}
{% include 'accel-ppp/config_modules_auth_mode.j2' %}
ipv6pool
ipv6_nd
ipv6_dhcp
ippool

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

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

[ipoe]
verbose=1
{% if interface is vyos_defined %}
{%     for iface, iface_config in interface.items() %}
{%         set tmp = 'interface=' %}
{%         if iface_config.vlan is vyos_defined %}
{%             set tmp = tmp ~ 're:^' ~ iface ~ '\.' ~ iface_config.vlan | range_to_regex ~ '$' %}
{%         else %}
{%             set tmp = tmp ~ iface %}
{%         endif %}
{%         set shared = '' %}
{%         if iface_config.network is vyos_defined('shared') %}
{%             set shared = 'shared=1,' %}
{%         elif iface_config.network is vyos_defined('vlan') %}
{%             set shared = 'shared=0,' %}
{%         endif %}
{%         set range = 'range=' ~ iface_config.client_subnet ~ ',' if iface_config.client_subnet is vyos_defined else '' %}
{%         set relay = ',' ~ 'relay=' ~ iface_config.external_dhcp.dhcp_relay  if iface_config.external_dhcp.dhcp_relay is vyos_defined else '' %}
{%         set giaddr = ',' ~ 'giaddr=' ~ iface_config.external_dhcp.giaddr if iface_config.external_dhcp.giaddr is vyos_defined else '' %}
{{ tmp }},{{ shared }}mode={{ iface_config.mode | upper }},ifcfg=1,{{ range }}start=dhcpv4,ipv6=1{{ relay }}{{ giaddr }}
{%         if iface_config.vlan is vyos_defined %}
vlan-mon={{ iface }},{{ iface_config.vlan | join(',') }}
{%         endif %}
{%     endfor %}
{% endif %}
{% if authentication.mode is vyos_defined('noauth') %}
noauth=1
{% elif authentication.mode is vyos_defined('local') %}
username=ifname
password=csid
{% endif %}
{% if client_ip_pool.name is vyos_defined %}
{%     if first_named_pool is vyos_defined %}
ip-pool={{ first_named_pool }}
{%     else %}
{%         for pool, pool_options in client_ip_pool.name.items() %}
{%             if pool_options.subnet is vyos_defined %}
ip-pool={{ pool }}
{%             endif %}
{%         endfor %}
{%     endif %}
{%     for pool, pool_options in client_ip_pool.name.items() %}
{%         if pool_options.gateway_address is vyos_defined %}
gw-ip-address={{ pool_options.gateway_address }}/{{ pool_options.subnet.split('/')[1] }}
{%         endif %}
{%     endfor %}
{% endif %}
proxy-arp=1

{% if ordered_named_pools is vyos_defined %}
[ip-pool]
{%     for p in ordered_named_pools %}
{%         for pool, pool_options in p.items() %}
{%             set next_named_pool = ',next=' ~ pool_options.next_pool if pool_options.next_pool is vyos_defined else '' %}
{{ pool_options.subnet }},name={{ pool }}{{ next_named_pool }}
{%         endfor %}
{%     endfor %}
{%     for p in ordered_named_pools %}
{%         for pool, pool_options in p.items() %}
gw-ip-address={{ pool_options.gateway_address }}/{{ pool_options.subnet.split('/')[1] }}
{%         endfor %}
{%     endfor %}
{% endif %}

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

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

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

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

[cli]
tcp=127.0.0.1:2002