Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

T5091: IPoE-server verify RADIUS settings #1895

Merged
merged 1 commit into from
Mar 16, 2023
Merged

Conversation

sever-sever
Copy link
Member

@sever-sever sever-sever commented Mar 16, 2023

Change Summary

We don't have the global option gateway-address for ipoe-server we cannot use the general configverify.verify_accel_ppp_base_service

def verify_accel_ppp_base_service(config, local_users=True):

Add verify radius setting for configuration mode `radius Radius authentication required at least one RADIUS server

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes)
  • Migration from an old Vyatta component to vyos-1x, please link to related PR inside obsoleted component
  • Other (please describe):

Related Task(s)

Component(s) name

ipoe-server

Proposed changes

How to test

VyOS configuration:

set service ipoe-server authentication mode 'radius'
set service ipoe-server client-ip-pool name POOL1 gateway-address '192.0.2.1'
set service ipoe-server client-ip-pool name POOL1 subnet '192.0.2.0/24'
set service ipoe-server interface eth1 vlan '2000-3000'

Before the fix:

Traceback (most recent call last):
  File "/usr/libexec/vyos/conf_mode/service_ipoe-server.py", line 99, in <module>
    generate(c)
  File "/usr/libexec/vyos/conf_mode/service_ipoe-server.py", line 75, in generate
    render(ipoe_conf, 'accel-ppp/ipoe.config.j2', ipoe)
  File "/usr/lib/python3/dist-packages/vyos/template.py", line 141, in render
    rendered = render_to_string(template, content, formater, location)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/vyos/template.py", line 110, in render_to_string
    rendered = template.render(content)
               ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 1301, in render
    self.environment.handle_exception()
  File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 936, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "/usr/share/vyos/templates/accel-ppp/ipoe.config.j2", line 78, in top-level template code
    {% include 'accel-ppp/config_chap_secrets_radius.j2' %}
    ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/vyos/templates/accel-ppp/config_chap_secrets_radius.j2", line 7, in top-level template code
    {%     for server, options in authentication.radius.server.items() if not options.disable is vyos_defined %}
    ^^^^^^^^^^^^^^^^^^^^^^^^^
jinja2.exceptions.UndefinedError: 'dict object' has no attribute 'server'



[[service ipoe-server]] failed
Commit failed
[edit]
vyos@r14#

After the fix:

vyos@r14# commit
[ service ipoe-server ]
RADIUS authentication requires at least one server

[[service ipoe-server]] failed
Commit failed
[edit]
vyos@r14# 

Checklist:

  • I have read the CONTRIBUTING document
  • I have linked this PR to one or more Phabricator Task(s)
  • I have run the components SMOKETESTS if applicable
  • My commit headlines contain a valid Task id
  • My change requires a change to the documentation
  • I have updated the documentation accordingly

As we don't have global option 'gateway-address' for ipoe-server
we cannot use general configverify.verify_accel_ppp_base_service
Add verify radius setting for configuration mode 'radius'
Radius authentication required at least one RADIUS server
@vyosbot vyosbot requested review from a team, dmbaturin, sarthurdev, zdc, jestabro and c-po and removed request for a team March 16, 2023 13:23
@c-po c-po merged commit da42b37 into vyos:current Mar 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants