summaryrefslogtreecommitdiff
path: root/src/conf_mode/service_ipoe-server.py
diff options
context:
space:
mode:
authoraapostoliuk <a.apostoliuk@vyos.io>2024-03-22 16:10:59 +0200
committeraapostoliuk <a.apostoliuk@vyos.io>2024-03-26 17:48:07 +0200
commit9d34c488251c0d5111b4a3c880f2291548645db3 (patch)
treede8affb4a205ae68a217dfe50abbd0e586e40f41 /src/conf_mode/service_ipoe-server.py
parent713b2f3702134abd9a34c539019a83d0e354eb22 (diff)
downloadvyos-1x-9d34c488251c0d5111b4a3c880f2291548645db3.tar.gz
vyos-1x-9d34c488251c0d5111b4a3c880f2291548645db3.zip
T6150: Fixed setting a static IP address by Radius in IPoE
Fixed setting a static IP address by Radius in IPoE Allowing using named pools by default Allowed adding 'gateway-address' without named pool.
Diffstat (limited to 'src/conf_mode/service_ipoe-server.py')
-rwxr-xr-xsrc/conf_mode/service_ipoe-server.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/conf_mode/service_ipoe-server.py b/src/conf_mode/service_ipoe-server.py
index 42cfd0f12..86185f37f 100755
--- a/src/conf_mode/service_ipoe-server.py
+++ b/src/conf_mode/service_ipoe-server.py
@@ -44,6 +44,7 @@ default_config_data = {
'client_named_ip_pool': [],
'client_ipv6_pool': [],
'client_ipv6_delegate_prefix': [],
+ 'gateway_address':[],
'radius_server': [],
'radius_acct_inter_jitter': '',
'radius_acct_tmo': '3',
@@ -275,9 +276,14 @@ def get_config(config=None):
ipoe['client_ipv6_delegate_prefix'].append(tmp)
+ if conf.exists(['gateway-address']):
+ for gw in conf.return_values(['gateway-address']):
+ ipoe['gateway_address'].append(gw)
+
return ipoe
+
def verify(ipoe):
if not ipoe:
return None
@@ -303,6 +309,13 @@ def verify(ipoe):
if ipoe['client_ipv6_delegate_prefix'] and not ipoe['client_ipv6_pool']:
raise ConfigError('IPoE IPv6 deletate-prefix requires IPv6 prefix to be configured!')
+ if ipoe['gateway_address']:
+ if ipoe['client_named_ip_pool']:
+ ipoe_gateways = ' '.join(ipoe['gateway_address'])
+ for pool in ipoe['client_named_ip_pool']:
+ if f'{pool["gateway_address"]}/' in ipoe_gateways:
+ raise ConfigError(
+ 'IPoE "gateway-address" exists in IPoE "client-ip-pool"!')
return None