summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data/templates/accel-ppp/pppoe.config.tmpl20
-rw-r--r--interface-definitions/service_pppoe-server.xml.in39
-rw-r--r--op-mode-definitions/monitor-bandwidth-test.xml.in48
-rw-r--r--op-mode-definitions/vpn-ipsec.xml.in2
-rwxr-xr-xsrc/op_mode/monitor_bandwidth_test.sh2
5 files changed, 97 insertions, 14 deletions
diff --git a/data/templates/accel-ppp/pppoe.config.tmpl b/data/templates/accel-ppp/pppoe.config.tmpl
index f444af85c..05ac31d18 100644
--- a/data/templates/accel-ppp/pppoe.config.tmpl
+++ b/data/templates/accel-ppp/pppoe.config.tmpl
@@ -17,6 +17,10 @@ net-snmp
{% if limits is defined %}
connlimit
{% endif %}
+{% if extended_scripts is defined %}
+sigchld
+pppd_compat
+{% endif %}
[core]
thread-count={{ thread_count }}
@@ -133,6 +137,9 @@ service-name={{ service_name | join(',') }}
{% endfor %}
pado-delay={{ pado_delay_param.value }}
{% endif %}
+{% if authentication.radius.called_sid_format is defined and authentication.radius.called_sid_format is not none %}
+called-sid={{ authentication.radius.called_sid_format }}
+{% endif %}
{% if limits is defined %}
[connlimit]
@@ -146,12 +153,19 @@ burst={{ limits.burst }}
timeout={{ limits.timeout }}
{% endif %}
{% endif %}
-{% if authentication.radius.called_sid_format is defined and authentication.radius.called_sid_format is not none %}
-called-sid={{ authentication.radius.called_sid_format }}
-{% endif %}
{# Common RADIUS shaper configuration #}
{% include 'accel-ppp/config_shaper_radius.j2' %}
+{% if extended_scripts is defined %}
+[pppd-compat]
+verbose=1
+radattr-prefix=/run/accel-pppd/radattr
+{% set script_name = {'on_up': 'ip-up', 'on_down': 'ip-down', 'on_change':'ip-change', 'on_pre_up':'ip-pre-up'} %}
+{% for script in extended_scripts %}
+{{ script_name[script] }}={{ extended_scripts[script] }}
+{% endfor %}
+{% endif %}
+
[cli]
tcp=127.0.0.1:2001
diff --git a/interface-definitions/service_pppoe-server.xml.in b/interface-definitions/service_pppoe-server.xml.in
index dc8af67af..9d0f887a9 100644
--- a/interface-definitions/service_pppoe-server.xml.in
+++ b/interface-definitions/service_pppoe-server.xml.in
@@ -334,6 +334,45 @@
</leafNode>
</children>
</node>
+ <node name="extended-scripts">
+ <properties>
+ <help>Extended script execution</help>
+ </properties>
+ <children>
+ <leafNode name="on-pre-up">
+ <properties>
+ <help>Script to run before PPPoE session interface comes up</help>
+ <constraint>
+ <validator name="script"/>
+ </constraint>
+ </properties>
+ </leafNode>
+ <leafNode name="on-up">
+ <properties>
+ <help>Script to run when PPPoE session interface is completely configured and started</help>
+ <constraint>
+ <validator name="script"/>
+ </constraint>
+ </properties>
+ </leafNode>
+ <leafNode name="on-down">
+ <properties>
+ <help>Script to run when PPPoE session interface going to terminate</help>
+ <constraint>
+ <validator name="script"/>
+ </constraint>
+ </properties>
+ </leafNode>
+ <leafNode name="on-change">
+ <properties>
+ <help>Script to run when PPPoE session interface changed by RADIUS CoA handling</help>
+ <constraint>
+ <validator name="script"/>
+ </constraint>
+ </properties>
+ </leafNode>
+ </children>
+ </node>
</children>
</node>
</children>
diff --git a/op-mode-definitions/monitor-bandwidth-test.xml.in b/op-mode-definitions/monitor-bandwidth-test.xml.in
index 5b36b1da5..965591280 100644
--- a/op-mode-definitions/monitor-bandwidth-test.xml.in
+++ b/op-mode-definitions/monitor-bandwidth-test.xml.in
@@ -7,21 +7,51 @@
<help>Initiate or wait for bandwidth test</help>
</properties>
<children>
- <leafNode name="accept">
+ <node name="accept">
<properties>
<help>Wait for bandwidth test connections (port TCP/5001)</help>
</properties>
<command>/usr/bin/iperf -V -s</command>
- </leafNode>
- <tagNode name="initiate">
+ <children>
+ <leafNode name="tcp">
+ <properties>
+ <help>Wait for bandwidth test connections (port TCP/5001)</help>
+ </properties>
+ <command>/usr/bin/iperf -V -s</command>
+ </leafNode>
+ <leafNode name="udp">
+ <properties>
+ <help>Wait for bandwidth test connections (port UDP/5001)</help>
+ </properties>
+ <command>/usr/bin/iperf -V -s -u</command>
+ </leafNode>
+ </children>
+ </node>
+ <node name="initiate">
<properties>
- <help>Initiate a bandwidth test to specified host (port TCP/5001)</help>
- <completionHelp>
- <list>&lt;hostname&gt; &lt;x.x.x.x&gt; &lt;h:h:h:h:h:h:h:h&gt;</list>
- </completionHelp>
+ <help>Initiate a bandwidth test to specified host</help>
</properties>
- <command>${vyos_op_scripts_dir}/monitor_bandwidth_test.sh "$4"</command>
- </tagNode>
+ <children>
+ <tagNode name="tcp">
+ <properties>
+ <help>Initiate a bandwidth test to specified host (port TCP/5001)</help>
+ <completionHelp>
+ <list>&lt;hostname&gt; &lt;x.x.x.x&gt; &lt;h:h:h:h:h:h:h:h&gt;</list>
+ </completionHelp>
+ </properties>
+ <command>${vyos_op_scripts_dir}/monitor_bandwidth_test.sh "$5"</command>
+ </tagNode>
+ <tagNode name="udp">
+ <properties>
+ <help>Initiate a bandwidth test to specified host (port UDP/5001)</help>
+ <completionHelp>
+ <list>&lt;hostname&gt; &lt;x.x.x.x&gt; &lt;h:h:h:h:h:h:h:h&gt;</list>
+ </completionHelp>
+ </properties>
+ <command>${vyos_op_scripts_dir}/monitor_bandwidth_test.sh "$5" "-u"</command>
+ </tagNode>
+ </children>
+ </node>
</children>
</node>
</children>
diff --git a/op-mode-definitions/vpn-ipsec.xml.in b/op-mode-definitions/vpn-ipsec.xml.in
index b836b193f..76f4893c1 100644
--- a/op-mode-definitions/vpn-ipsec.xml.in
+++ b/op-mode-definitions/vpn-ipsec.xml.in
@@ -124,7 +124,7 @@
<children>
<tagNode name="tunnel">
<properties>
- <help>Show debugging information for a peer's tunnel</help>
+ <help>Show debug information for peer tunnel</help>
</properties>
<command>sudo ${vyos_op_scripts_dir}/vpn_ipsec.py --action="vpn-debug" --name="$5" --tunnel="$7"</command>
</tagNode>
diff --git a/src/op_mode/monitor_bandwidth_test.sh b/src/op_mode/monitor_bandwidth_test.sh
index 6da0291c5..900223bca 100755
--- a/src/op_mode/monitor_bandwidth_test.sh
+++ b/src/op_mode/monitor_bandwidth_test.sh
@@ -26,5 +26,5 @@ elif [[ $(dig $1 AAAA +short | grep -v '\.$' | wc -l) -gt 0 ]]; then
OPT="-V"
fi
-/usr/bin/iperf $OPT -c $1
+/usr/bin/iperf $OPT -c $1 $2