diff options
Diffstat (limited to 'data/templates')
-rw-r--r-- | data/templates/accel-ppp/config_ip_pool.j2 | 10 | ||||
-rw-r--r-- | data/templates/accel-ppp/config_shaper_radius.j2 | 10 | ||||
-rw-r--r-- | data/templates/accel-ppp/pppoe.config.tmpl | 17 | ||||
-rw-r--r-- | data/templates/pppoe/ip-down.script.tmpl | 2 | ||||
-rw-r--r-- | data/templates/pppoe/ip-up.script.tmpl | 2 | ||||
-rw-r--r-- | data/templates/pppoe/ipv6-up.script.tmpl | 2 |
6 files changed, 36 insertions, 7 deletions
diff --git a/data/templates/accel-ppp/config_ip_pool.j2 b/data/templates/accel-ppp/config_ip_pool.j2 index 3b0f68084..f61a4f148 100644 --- a/data/templates/accel-ppp/config_ip_pool.j2 +++ b/data/templates/accel-ppp/config_ip_pool.j2 @@ -11,4 +11,14 @@ gw-ip-address={{ gateway_address }} {{ subnet }} {% endfor %} {% endif %} +{% if client_ip_pool.name is defined and client_ip_pool.name is not none %} +{% for pool, pool_config in client_ip_pool.name.items() %} +{% if pool_config.subnet is defined and pool_config.subnet is not none %} +{{ pool_config.subnet }},name={{ pool }} +{% endif %} +{% if pool_config.gateway_address is defined and pool_config.gateway_address is not none %} +gw-ip-address={{ pool_config.gateway_address }} +{% endif %} +{% endfor %} +{% endif %} {% endif %} diff --git a/data/templates/accel-ppp/config_shaper_radius.j2 b/data/templates/accel-ppp/config_shaper_radius.j2 index c409c3718..b7bd9c128 100644 --- a/data/templates/accel-ppp/config_shaper_radius.j2 +++ b/data/templates/accel-ppp/config_shaper_radius.j2 @@ -1,7 +1,7 @@ -{% if authentication is defined and authentication.mode is defined and authentication.mode == 'radius' %} -{% if authentication is defined and authentication.radius is defined and authentication.radius.rate_limit is defined and authentication.radius.rate_limit.enable is defined %} +{% if authentication is defined and authentication.mode is defined and authentication.mode == 'radius' or shaper is defined %} [shaper] verbose=1 +{% if authentication is defined and authentication.radius is defined and authentication.radius.rate_limit is defined and authentication.radius.rate_limit.enable is defined %} attr={{ authentication.radius.rate_limit.attribute }} {% if authentication.radius.rate_limit.vendor is defined and authentication.radius.rate_limit.vendor is not none %} vendor={{ authentication.radius.rate_limit.vendor }} @@ -10,4 +10,10 @@ vendor={{ authentication.radius.rate_limit.vendor }} rate-multiplier={{ authentication.radius.rate_limit.multiplier }} {% endif %} {% endif %} +{% if shaper is defined %} +{% if shaper.fwmark is defined and shaper.fwmark is not none %} +fwmark={{ shaper.fwmark }} +down-limiter=htb +{% endif %} +{% endif %} {% endif %} diff --git a/data/templates/accel-ppp/pppoe.config.tmpl b/data/templates/accel-ppp/pppoe.config.tmpl index a44208e15..b37004f5b 100644 --- a/data/templates/accel-ppp/pppoe.config.tmpl +++ b/data/templates/accel-ppp/pppoe.config.tmpl @@ -65,8 +65,6 @@ ccp={{ "1" if ppp_options.ccp is defined else "0" }} unit-preallocate={{ "1" if authentication.radius.preallocate_vif is defined else "0" }} {% if ppp_options.min_mtu is defined and ppp_options.min_mtu is not none %} min-mtu={{ ppp_options.min_mtu }} -{% else %} -min-mtu={{ mtu }} {% endif %} {% if ppp_options.mru is defined and ppp_options.mru is not none %} mru={{ ppp_options.mru }} @@ -138,6 +136,21 @@ pado-delay={{ pado_delay_param.value }} called-sid={{ authentication.radius.called_sid_format }} {% endif %} +{% if authentication is defined and authentication.mode is defined and authentication.mode == 'local' %} +{% if client_ip_pool is defined and client_ip_pool is not none %} +{% if client_ip_pool.name is defined and client_ip_pool.name is not none %} +{% for pool, pool_config in client_ip_pool.name.items() %} +{% if pool_config.subnet is defined and pool_config.subnet is not none %} +ip-pool={{ pool }} +{% if pool_config.gateway_address is defined and pool_config.gateway_address is not none %} +gw-ip-address={{ pool_config.gateway_address }}/{{ pool_config.subnet.split('/')[1] }} +{% endif %} +{% endif %} +{% endfor %} +{% endif %} +{% endif %} +{% endif %} + {% if limits is defined %} [connlimit] {% if limits.connection_limit is defined and limits.connection_limit is not none %} diff --git a/data/templates/pppoe/ip-down.script.tmpl b/data/templates/pppoe/ip-down.script.tmpl index c1d1132b3..9db3219b3 100644 --- a/data/templates/pppoe/ip-down.script.tmpl +++ b/data/templates/pppoe/ip-down.script.tmpl @@ -11,7 +11,7 @@ DIALER_PID=$(cat /var/run/{{ ifname }}.pid) logger -t pppd[$DIALER_PID] "executing $0" {% if connect_on_demand is not defined %} -# See https://phabricator.vyos.net/T2248. Determine if we are enslaved to a +# See https://vyos.dev/T2248. Determine if we are enslaved to a # VRF, this is needed to properly insert the default route. VRF_NAME="" if [ -d /sys/class/net/{{ ifname }}/upper_* ]; then diff --git a/data/templates/pppoe/ip-up.script.tmpl b/data/templates/pppoe/ip-up.script.tmpl index 302756960..7f0c234fe 100644 --- a/data/templates/pppoe/ip-up.script.tmpl +++ b/data/templates/pppoe/ip-up.script.tmpl @@ -12,7 +12,7 @@ DIALER_PID=$(cat /var/run/{{ ifname }}.pid) logger -t pppd[$DIALER_PID] "executing $0" {% if default_route != 'none' %} -# See https://phabricator.vyos.net/T2248 & T2220. Determine if we are enslaved +# See https://vyos.dev/T2248 & T2220. Determine if we are enslaved # to a VRF, this is needed to properly insert the default route. SED_OPT="^ip route" diff --git a/data/templates/pppoe/ipv6-up.script.tmpl b/data/templates/pppoe/ipv6-up.script.tmpl index 238f8c28e..245ef1b87 100644 --- a/data/templates/pppoe/ipv6-up.script.tmpl +++ b/data/templates/pppoe/ipv6-up.script.tmpl @@ -54,7 +54,7 @@ systemctl restart dhcp6c@{{ ifname }}.service {% endif %} {% if default_route != 'none' %} -# See https://phabricator.vyos.net/T2248 & T2220. Determine if we are enslaved +# See https://vyos.dev/T2248 & T2220. Determine if we are enslaved # to a VRF, this is needed to properly insert the default route. SED_OPT="^ipv6 route" |