summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriyEshenko <snooppy@mail.ua>2019-09-12 19:40:31 +0000
committerDmitriyEshenko <snooppy@mail.ua>2019-09-12 19:40:31 +0000
commitb09fc4dbb2a0dce2d31245fb9b4777aa29bbd356 (patch)
tree3c48bd39e0212d883d45078feb6f65a72a8675c9
parent785a2d26998db580a1996edba584aac612b11b3a (diff)
downloadvyos-1x-b09fc4dbb2a0dce2d31245fb9b4777aa29bbd356.tar.gz
vyos-1x-b09fc4dbb2a0dce2d31245fb9b4777aa29bbd356.zip
[l2tp] T834 Implementation advanced ppp-options/lcp.
-rw-r--r--interface-definitions/l2tp-server.xml24
-rwxr-xr-xsrc/conf_mode/accel_l2tp.py21
2 files changed, 45 insertions, 0 deletions
diff --git a/interface-definitions/l2tp-server.xml b/interface-definitions/l2tp-server.xml
index 721913dfe..f795c96db 100644
--- a/interface-definitions/l2tp-server.xml
+++ b/interface-definitions/l2tp-server.xml
@@ -405,6 +405,7 @@
<leafNode name="disable">
<properties>
<help>Option to disable a L2TP Server user</help>
+ <valueless/>
</properties>
</leafNode>
<leafNode name="password">
@@ -553,6 +554,29 @@
</node>
</children>
</node>
+ <node name="ppp-options">
+ <properties>
+ <help>Advanced protocol options</help>
+ </properties>
+ <children>
+ <leafNode name="lcp-echo-interval">
+ <properties>
+ <help>LCP echo-requests/sec</help>
+ <constraint>
+ <validator name="numeric" argument="--positive"/>
+ </constraint>
+ </properties>
+ </leafNode>
+ <leafNode name="lcp-echo-failure">
+ <properties>
+ <help>Maximum number of Echo-Requests may be sent without valid reply</help>
+ <constraint>
+ <validator name="numeric" argument="--positive"/>
+ </constraint>
+ </properties>
+ </leafNode>
+ </children>
+ </node>
</children>
</node>
</children>
diff --git a/src/conf_mode/accel_l2tp.py b/src/conf_mode/accel_l2tp.py
index fc60a8cd7..244a720db 100755
--- a/src/conf_mode/accel_l2tp.py
+++ b/src/conf_mode/accel_l2tp.py
@@ -134,7 +134,16 @@ single-session=replace
{% if idle_timeout %}
lcp-echo-timeout={{idle_timeout}}
{% endif %}
+{% if ppp_options['lcp-echo-interval'] %}
+lcp-echo-interval={{ppp_options['lcp-echo-interval']}}
+{% else %}
lcp-echo-interval=30
+{% endif %}
+{% if ppp_options['lcp-echo-failure'] %}
+lcp-echo-failure={{ppp_options['lcp-echo-failure']}}
+{% else %}
+lcp-echo-failure=3
+{% endif %}
{% if ccp_disable %}
ccp=0
{% endif %}
@@ -288,6 +297,7 @@ def get_config():
'mtu' : '1436',
'ip6_column' : '',
'ip6_dp_column' : '',
+ 'ppp_options' : {},
}
### general options ###
@@ -440,6 +450,17 @@ def get_config():
if c.exists('ccp-disable'):
config_data['ccp_disable'] = True
+ ### ppp_options
+ ppp_options = {}
+ if c.exists('ppp-options'):
+ if c.exists('ppp-options lcp-echo-failure'):
+ ppp_options['lcp-echo-failure'] = c.return_value('ppp-options lcp-echo-failure')
+ if c.exists('ppp-options lcp-echo-interval'):
+ ppp_options['lcp-echo-interval'] = c.return_value('ppp-options lcp-echo-interval')
+
+ if len(ppp_options) !=0:
+ config_data['ppp_options'] = ppp_options
+
return config_data
def verify(c):