summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data/templates/accel-ppp/pppoe.config.tmpl4
-rwxr-xr-xsrc/conf_mode/interfaces-tunnel.py11
2 files changed, 12 insertions, 3 deletions
diff --git a/data/templates/accel-ppp/pppoe.config.tmpl b/data/templates/accel-ppp/pppoe.config.tmpl
index 537b2770d..b6a239fad 100644
--- a/data/templates/accel-ppp/pppoe.config.tmpl
+++ b/data/templates/accel-ppp/pppoe.config.tmpl
@@ -1,4 +1,3 @@
-
### generated by accel_pppoe.py ###
[modules]
log_syslog
@@ -6,13 +5,13 @@ pppoe
{% if auth_mode == 'radius' %}
radius
{% endif %}
+chap-secrets
ippool
{% if ppp_ipv6 != 'deny' %}
ipv6pool
ipv6_nd
ipv6_dhcp
{% endif %}
-chap-secrets
auth_pap
auth_chap_md5
auth_mschap_v1
@@ -87,6 +86,7 @@ wins{{ loop.index }}={{ server }}
{% if auth_mode == 'local' %}
[chap-secrets]
+gw-ip-address={{ ppp_gw }}
chap-secrets={{ chap_secrets_file }}
{% elif auth_mode == 'radius' %}
[radius]
diff --git a/src/conf_mode/interfaces-tunnel.py b/src/conf_mode/interfaces-tunnel.py
index 06c2ea29b..be0279bd2 100755
--- a/src/conf_mode/interfaces-tunnel.py
+++ b/src/conf_mode/interfaces-tunnel.py
@@ -25,7 +25,7 @@ from vyos.config import Config
from vyos.ifconfig import Interface, GREIf, GRETapIf, IPIPIf, IP6GREIf, IPIP6If, IP6IP6If, SitIf, Sit6RDIf
from vyos.ifconfig.afi import IP4, IP6
from vyos.configdict import list_diff
-from vyos.validate import is_ipv4, is_ipv6
+from vyos.validate import is_ipv4, is_ipv6, is_bridge_member
from vyos import ConfigError
from vyos.dicts import FixedDict
@@ -275,6 +275,7 @@ default_config_data = {
'tclass': 'inherit',
'6rd-prefix': '',
'6rd-relay-prefix': '',
+ 'bridge': '',
}
# dict name -> config name, multiple values, default
@@ -405,6 +406,9 @@ def get_config():
ct = conf.get_config_dict()['tunnel']
options['tunnel'] = {}
+ # check for bridges
+ options['bridge'] = is_bridge_member(conf, ifname)
+
for name in ct:
tunnel = ct[name]
encap = tunnel.get('encapsulation', '')
@@ -429,6 +433,11 @@ def verify(conf):
if changes['section'] == 'delete':
if ifname in options['nhrp']:
raise ConfigError(f'Can not delete interface tunnel {iftype} {ifname}, it is used by nhrp')
+
+ bridge = changes['bridge']
+ if bridge:
+ raise ConfigError(f'Interface "{ifname}" can not be deleted as it belongs to bridge "{bridge}"!')
+
# done, bail out early
return None