summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/conf_mode/vpp.py43
-rw-r--r--src/conf_mode/vpp_interfaces_gre.py8
2 files changed, 43 insertions, 8 deletions
diff --git a/src/conf_mode/vpp.py b/src/conf_mode/vpp.py
index 32dd0d01a..923ac7f31 100755
--- a/src/conf_mode/vpp.py
+++ b/src/conf_mode/vpp.py
@@ -335,6 +335,49 @@ def verify(config):
if iface_config['xdp_options']['num_rx_queues'] != 'all':
Warning(f'Not all RX queues will be connected to VPP for {iface}!')
+ # check GRE tunnels as part of the bridge, only tunnel-type teb is allowed
+ # set vpp interfaces bridge br1 member interface gre1
+ # set vpp interfaces gre gre1 tunnel-type teb
+ if 'interfaces' in config:
+ if 'bridge' in config['interfaces']:
+ for iface, iface_config in config['interfaces']['bridge'].items():
+ if 'member' in iface_config:
+ for member in iface_config['member'].get('interface', []):
+ if member.startswith('gre'):
+ if (
+ 'gre' in config['interfaces']
+ and config['interfaces']['gre']
+ .get(member, {})
+ .get('tunnel_type')
+ != 'teb'
+ ):
+ raise ConfigError(
+ f'Only tunnel-type teb is allowed for GRE interfaces in bridge {iface}'
+ )
+
+ # Only one multipoint GRE tunnel is allowed from the same source address
+ # set vpp interfaces gre gre0 mode 'point-to-multipoint'
+ # set vpp interfaces gre gre0 remote '0.0.0.0'
+ # set vpp interfaces gre gre0 source-address '192.0.2.1'
+ # set vpp interfaces gre gre1 mode 'point-to-multipoint'
+ # set vpp interfaces gre gre1 remote '0.0.0.0'
+ # set vpp interfaces gre gre1 source-address '192.0.2.1'
+ if 'gre' in config['interfaces']:
+ for iface, iface_config in config['interfaces']['gre'].items():
+ if iface_config['mode'] == 'point-to-multipoint':
+ for other_iface, other_iface_config in config['interfaces'][
+ 'gre'
+ ].items():
+ if (
+ other_iface_config['mode'] == 'point-to-multipoint'
+ and other_iface_config['source_address']
+ == iface_config['source_address']
+ and iface != other_iface
+ ):
+ raise ConfigError(
+ 'Only one multipoint GRE tunnel is allowed from the same source address'
+ )
+
if 'cpu' in config['settings']:
if (
'corelist_workers' in config['settings']['cpu']
diff --git a/src/conf_mode/vpp_interfaces_gre.py b/src/conf_mode/vpp_interfaces_gre.py
index 334725994..817345135 100644
--- a/src/conf_mode/vpp_interfaces_gre.py
+++ b/src/conf_mode/vpp_interfaces_gre.py
@@ -136,14 +136,6 @@ def verify(config):
# For multipoint mode, remote IP must be 0.0.0.0
if config.get('remote') != '0.0.0.0':
raise ConfigError('For point-to-multipoint mode, remote must be 0.0.0.0')
- # Only one multipoint GRE tunnel is allowed from the same source address
- for ifname, iface in config.get('vpp_interfaces', {}).items():
- if iface.get('mode') == 'point-to-multipoint' and iface.get(
- 'source_address'
- ) == config.get('source_address'):
- raise ConfigError(
- 'Only one multipoint GRE tunnel is allowed from the same source address'
- )
# Change 'vpp interfaces gre greX kernel-interface vpp-tunX'
# => 'vpp interfaces gre greX kernel-interface vpp-tunY'