{% if helpers.exists('OPNsense.freeradius.general.enabled') and OPNsense.freeradius.general.enabled == '1' %}

{% if helpers.exists('OPNsense.freeradius.user.users.user') %}
{%   for user_list in helpers.toList('OPNsense.freeradius.user.users.user') %}
{%     if user_list.enabled == '1' %}
{{ user_list.username }}  Cleartext-Password := "{{ user_list.password }}"{% if user_list.sessionlimit_max_session_limit is defined %}, Max-Daily-Session := {{ user_list.sessionlimit_max_session_limit }}{% endif %}

       Framed-Protocol = PPP{% if user_list.ip is defined %},
       Framed-IP-Address = {{ user_list.ip }}{% endif %}{% if user_list.subnet is defined %},
       Framed-IP-Netmask = {{ user_list.subnet }}{% endif %}{% if user_list.vlan is defined %},
       Tunnel-Type = VLAN,
       Tunnel-Medium-Type = IEEE-802,
       Tunnel-Private-Group-Id = {{ user_list.vlan }}{% endif %}{% if user_list.wispr_bw_min_up is defined %},
       WISPr-Bandwidth-Min-Up = {{ user_list.wispr_bw_min_up }}{% endif %}{% if user_list.wispr_bw_max_up is defined %},
       WISPr-Bandwidth-Max-Up = {{ user_list.wispr_bw_max_up }}{% endif %}{% if user_list.wispr_bw_min_down is defined %},
       WISPr-Bandwidth-Min-Down = {{ user_list.wispr_bw_min_down }}{% endif %}{% if user_list.wispr_bw_max_down is defined %},
       WISPr-Bandwidth-Max-Down = {{ user_list.wispr_bw_max_down }}{% endif %}{% if user_list.chillispot_bw_max_up is defined %},
       ChilliSpot-Bandwidth-Max-Up = {{ user_list.chillispot_bw_max_up }}{% endif %}{% if user_list.chillispot_bw_max_down is defined %},
       ChilliSpot-Bandwidth-Max-Down = {{ user_list.chillispot_bw_max_down }}
{%       endif %}

{%     endif %}

{%   endfor %}
{% endif %}

DEFAULT Framed-Protocol == PPP
        Framed-Protocol = PPP,
        Framed-Compression = Van-Jacobson-TCP-IP

DEFAULT Hint == "CSLIP"
        Framed-Protocol = SLIP,
        Framed-Compression = Van-Jacobson-TCP-IP

DEFAULT Hint == "SLIP"
        Framed-Protocol = SLIP

{% endif %}
