diff options
author | Christian Poessinger <christian@poessinger.com> | 2020-04-22 18:16:13 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2020-04-22 18:35:43 +0200 |
commit | d55ab3a9fa06f3b4827665d269cef6819b549771 (patch) | |
tree | cbe5ba90e8912b3dcda2ecd5e9bd6c59eb281c45 | |
parent | f9fbda14a2559794999f3391e420c70b31e6a343 (diff) | |
download | vyos-1x-d55ab3a9fa06f3b4827665d269cef6819b549771.tar.gz vyos-1x-d55ab3a9fa06f3b4827665d269cef6819b549771.zip |
vpn: pptp: T2351: migrate to common radius CLI
-rw-r--r-- | interface-definitions/vpn_pptp.xml.in | 34 | ||||
-rwxr-xr-x | src/conf_mode/vpn_pptp.py | 8 | ||||
-rwxr-xr-x | src/migration-scripts/pptp/1-to-2 | 8 |
3 files changed, 12 insertions, 38 deletions
diff --git a/interface-definitions/vpn_pptp.xml.in b/interface-definitions/vpn_pptp.xml.in index 2cafae60f..34b528690 100644 --- a/interface-definitions/vpn_pptp.xml.in +++ b/interface-definitions/vpn_pptp.xml.in @@ -152,39 +152,7 @@ </tagNode> </children> </node> - <node name="radius"> - <properties> - <help>RADIUS specific configuration</help> - </properties> - <children> - <tagNode name="server"> - <properties> - <help>IP address of radius server</help> - <valueHelp> - <format>ipv4</format> - <description>IP address of RADIUS server</description> - </valueHelp> - </properties> - <children> - <leafNode name="key"> - <properties> - <help>Key for accessing the specified server</help> - </properties> - </leafNode> - <leafNode name="req-limit"> - <properties> - <help>Maximum number of simultaneous requests to server (default: unlimited)</help> - </properties> - </leafNode> - <leafNode name="fail-time"> - <properties> - <help>If server does not responds mark it as unavailable for this time (seconds)</help> - </properties> - </leafNode> - </children> - </tagNode> - </children> - </node> + #include <include/radius-server.xml.i> </children> </node> </children> diff --git a/src/conf_mode/vpn_pptp.py b/src/conf_mode/vpn_pptp.py index 841c1b375..a602de412 100755 --- a/src/conf_mode/vpn_pptp.py +++ b/src/conf_mode/vpn_pptp.py @@ -119,8 +119,8 @@ def get_config(): if conf.exists(['port']): radius['port'] = conf.return_value(['port']) - if conf.exists(['secret']): - radius['key'] = conf.return_value(['secret']) + if conf.exists(['key']): + radius['key'] = conf.return_value(['key']) if not conf.exists(['disable']): pptp['radius_server'].append(radius) @@ -161,8 +161,8 @@ def get_config(): if conf.exists(['dynamic-author', 'port']): dae['port'] = conf.return_value(['dynamic-author', 'port']) - if conf.exists(['dynamic-author', 'secret']): - dae['key'] = conf.return_value(['dynamic-author', 'secret']) + if conf.exists(['dynamic-author', 'key']): + dae['key'] = conf.return_value(['dynamic-author', 'key']) pptp['radius_dynamic_author'] = dae diff --git a/src/migration-scripts/pptp/1-to-2 b/src/migration-scripts/pptp/1-to-2 index 605081f1c..a13cc3a4f 100755 --- a/src/migration-scripts/pptp/1-to-2 +++ b/src/migration-scripts/pptp/1-to-2 @@ -15,6 +15,7 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. # - migrate dns-servers node to common name-servers +# - remove radios req-limit node from sys import argv, exit @@ -55,7 +56,12 @@ else: config.delete(wins_base) - + # Remove RADIUS server req-limit node + radius_base = base + ['authentication', 'radius'] + if config.exists(radius_base): + for server in config.list_nodes(radius_base + ['server']): + if config.exists(radius_base + ['server', server, 'req-limit']): + config.delete(radius_base + ['server', server, 'req-limit']) try: with open(file_name, 'w') as f: |