summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data/templates/pppoe/peer.tmpl16
-rw-r--r--interface-definitions/include/pppoe-access-concentrator.xml.i11
-rw-r--r--interface-definitions/interfaces-pppoe.xml.in12
-rw-r--r--interface-definitions/service_pppoe-server.xml.in10
4 files changed, 23 insertions, 26 deletions
diff --git a/data/templates/pppoe/peer.tmpl b/data/templates/pppoe/peer.tmpl
index e8fda2cae..7e54e95f3 100644
--- a/data/templates/pppoe/peer.tmpl
+++ b/data/templates/pppoe/peer.tmpl
@@ -1,8 +1,5 @@
### Autogenerated by interfaces-pppoe.py ###
-
-{% if description %}
-# {{ description }}
-{% endif %}
+{{ '# ' ~ description if description is defined else '' }}
# Require peer to provide the local IP address if it is not
# specified explicitly in the config file.
@@ -38,6 +35,13 @@ noproxyarp
maxfail 0
plugin rp-pppoe.so
+{% if access_concentrator is defined and access_concentrator is not none %}
+rp_pppoe_ac '{{ access_concentrator }}'
+{% endif %}
+{% if service_name is defined and service_name is not none %}
+rp_pppoe_service '{{ service_name }}'
+{% endif %}
+
{{ source_interface }}
persist
ifname {{ ifname }}
@@ -60,10 +64,6 @@ ipv6cp-use-ipaddr
{% endif %}
{% endif %}
-{% if service_name is defined %}
-rp_pppoe_service "{{ service_name }}"
-{% endif %}
-
{% if connect_on_demand is defined %}
demand
# See T2249. PPP default route options should only be set when in on-demand
diff --git a/interface-definitions/include/pppoe-access-concentrator.xml.i b/interface-definitions/include/pppoe-access-concentrator.xml.i
new file mode 100644
index 000000000..ccfcc1c49
--- /dev/null
+++ b/interface-definitions/include/pppoe-access-concentrator.xml.i
@@ -0,0 +1,11 @@
+<!-- include start from pppoe-access-concentrator.xml.i -->
+<leafNode name="access-concentrator">
+ <properties>
+ <help>Access concentrator name</help>
+ <constraint>
+ <regex>[a-zA-Z0-9]{1,100}</regex>
+ </constraint>
+ <constraintErrorMessage>Access-concentrator name must be alphanumerical only (max. 100 characters)</constraintErrorMessage>
+ </properties>
+</leafNode>
+<!-- include end -->
diff --git a/interface-definitions/interfaces-pppoe.xml.in b/interface-definitions/interfaces-pppoe.xml.in
index 25a82a86b..6d44dfecc 100644
--- a/interface-definitions/interfaces-pppoe.xml.in
+++ b/interface-definitions/interfaces-pppoe.xml.in
@@ -16,15 +16,7 @@
</valueHelp>
</properties>
<children>
- <leafNode name="access-concentrator">
- <properties>
- <help>Access concentrator name (only connect to this concentrator)</help>
- <constraint>
- <regex>[a-zA-Z0-9]+$</regex>
- </constraint>
- <constraintErrorMessage>Access concentrator name must be composed of uppper and lower case letters or numbers only</constraintErrorMessage>
- </properties>
- </leafNode>
+ #include <include/pppoe-access-concentrator.xml.i>
#include <include/interface/authentication.xml.i>
#include <include/interface/dial-on-demand.xml.i>
<leafNode name="default-route">
@@ -140,7 +132,7 @@
<constraint>
<regex>[a-zA-Z0-9]+$</regex>
</constraint>
- <constraintErrorMessage>Service name must be composed of uppper and lower case letters or numbers only</constraintErrorMessage>
+ <constraintErrorMessage>Service name must be alphanumeric only</constraintErrorMessage>
</properties>
</leafNode>
</children>
diff --git a/interface-definitions/service_pppoe-server.xml.in b/interface-definitions/service_pppoe-server.xml.in
index 7b96b5692..79042e0f3 100644
--- a/interface-definitions/service_pppoe-server.xml.in
+++ b/interface-definitions/service_pppoe-server.xml.in
@@ -8,14 +8,8 @@
<priority>900</priority>
</properties>
<children>
+ #include <include/pppoe-access-concentrator.xml.i>
<leafNode name="access-concentrator">
- <properties>
- <help>Access concentrator name</help>
- <constraint>
- <regex>[a-zA-Z0-9]{1,100}</regex>
- </constraint>
- <constraintErrorMessage>access-concentrator name limited to alphanumerical characters only (max. 100)</constraintErrorMessage>
- </properties>
<defaultValue>vyos-ac</defaultValue>
</leafNode>
<node name="authentication">
@@ -129,7 +123,7 @@
<constraint>
<regex>[a-zA-Z0-9\-]{1,100}</regex>
</constraint>
- <constraintErrorMessage>servicename can contain aplhanumerical characters and dashes only (max. 100)</constraintErrorMessage>
+ <constraintErrorMessage>Service-name can contain aplhanumerical characters and dashes only (max. 100)</constraintErrorMessage>
<multi/>
</properties>
</leafNode>