├── .gitignore ├── Makefile ├── debian ├── changelog ├── control ├── copyright ├── docs ├── libpve-network-api-perl.install ├── libpve-network-perl.install ├── libpve-network-perl.postinst ├── rules ├── source │ └── format └── triggers └── src ├── Makefile ├── PVE ├── API2 │ ├── Makefile │ └── Network │ │ ├── Makefile │ │ ├── SDN.pm │ │ └── SDN │ │ ├── Controllers.pm │ │ ├── Dns.pm │ │ ├── Ipams.pm │ │ ├── Ips.pm │ │ ├── Makefile │ │ ├── Subnets.pm │ │ ├── Vnets.pm │ │ ├── Zones.pm │ │ └── Zones │ │ ├── Content.pm │ │ ├── Makefile │ │ └── Status.pm ├── Makefile └── Network │ ├── Makefile │ ├── SDN.pm │ └── SDN │ ├── Controllers.pm │ ├── Controllers │ ├── BgpPlugin.pm │ ├── EvpnPlugin.pm │ ├── FaucetPlugin.pm │ ├── IsisPlugin.pm │ ├── Makefile │ └── Plugin.pm │ ├── Dhcp.pm │ ├── Dhcp │ ├── Dnsmasq.pm │ ├── Makefile │ └── Plugin.pm │ ├── Dns.pm │ ├── Dns │ ├── Makefile │ ├── Plugin.pm │ └── PowerdnsPlugin.pm │ ├── Ipams.pm │ ├── Ipams │ ├── Makefile │ ├── NetboxPlugin.pm │ ├── PVEPlugin.pm │ ├── PhpIpamPlugin.pm │ └── Plugin.pm │ ├── Makefile │ ├── SubnetPlugin.pm │ ├── Subnets.pm │ ├── VnetPlugin.pm │ ├── Vnets.pm │ ├── Zones.pm │ └── Zones │ ├── EvpnPlugin.pm │ ├── FaucetPlugin.pm │ ├── Makefile │ ├── Plugin.pm │ ├── QinQPlugin.pm │ ├── SimplePlugin.pm │ ├── VlanPlugin.pm │ └── VxlanPlugin.pm ├── services ├── 00-dnsmasq-after-networking.conf └── Makefile └── test ├── Makefile ├── debug ├── documentation.txt ├── generateconfig.pl └── statuscheck.pl ├── dns └── powerdns │ ├── dns_config │ ├── expected.add_a_multiple_record.ipv4 │ ├── expected.add_a_multiple_record.ipv6 │ ├── expected.add_a_record.ipv4 │ ├── expected.add_a_record.ipv6 │ ├── expected.add_ptr_record.ipv4 │ ├── expected.add_ptr_record.ipv6 │ ├── expected.del_a_multiple_record.ipv4 │ ├── expected.del_a_multiple_record.ipv6 │ ├── expected.del_a_record.ipv4 │ ├── expected.del_a_record.ipv6 │ ├── expected.del_ptr_record.ipv4 │ ├── expected.del_ptr_record.ipv6 │ ├── expected.verify_zone │ └── sdn_config ├── ipams ├── netbox │ ├── expected.add_ip │ ├── expected.add_ip_notgateway │ ├── expected.add_next_freeip │ ├── expected.add_subnet │ ├── expected.del_ip │ ├── expected.del_subnet │ ├── expected.update_ip │ ├── ipam_config │ └── sdn_config └── phpipam │ ├── expected.add_ip │ ├── expected.add_ip_notgateway │ ├── expected.add_next_freeip │ ├── expected.add_subnet │ ├── expected.del_ip │ ├── expected.del_subnet │ ├── expected.update_ip │ ├── ipam_config │ └── sdn_config ├── run_test_dns.pl ├── run_test_ipams.pl ├── run_test_subnets.pl ├── run_test_vnets_blackbox.pl ├── run_test_zones.pl ├── subnets ├── ipv4 │ ├── ipam_config │ └── sdn_config ├── ipv6 │ ├── ipam_config │ └── sdn_config └── noipam │ ├── ipam_config │ └── sdn_config ├── vnets ├── ipv4 │ ├── ipam.db │ ├── ipam_config │ └── sdn_config ├── ipv4noipam │ ├── ipam.db │ ├── ipam_config │ └── sdn_config └── ipv6 │ ├── ipam.db │ ├── ipam_config │ └── sdn_config └── zones ├── evpn ├── advertise_subnets │ ├── expected_controller_config │ ├── expected_sdn_interfaces │ ├── interfaces │ └── sdn_config ├── disable_arp_nd_suppression │ ├── expected_controller_config │ ├── expected_sdn_interfaces │ ├── interfaces │ └── sdn_config ├── ebgp │ ├── expected_controller_config │ ├── expected_sdn_interfaces │ ├── interfaces │ └── sdn_config ├── ebgp_loopback │ ├── expected_controller_config │ ├── expected_sdn_interfaces │ ├── interfaces │ └── sdn_config ├── exitnode │ ├── expected_controller_config │ ├── expected_sdn_interfaces │ ├── interfaces │ └── sdn_config ├── exitnode_local_routing │ ├── expected_controller_config │ ├── expected_sdn_interfaces │ ├── interfaces │ └── sdn_config ├── exitnode_primary │ ├── expected_controller_config │ ├── expected_sdn_interfaces │ ├── interfaces │ └── sdn_config ├── exitnode_snat │ ├── expected_controller_config │ ├── expected_sdn_interfaces │ ├── interfaces │ └── sdn_config ├── exitnodenullroute │ ├── expected_controller_config │ ├── expected_sdn_interfaces │ ├── interfaces │ └── sdn_config ├── ipv4 │ ├── expected_controller_config │ ├── expected_sdn_interfaces │ ├── interfaces │ └── sdn_config ├── ipv4ipv6 │ ├── expected_controller_config │ ├── expected_sdn_interfaces │ ├── interfaces │ └── sdn_config ├── ipv4ipv6nogateway │ ├── expected_controller_config │ ├── expected_sdn_interfaces │ ├── interfaces │ └── sdn_config ├── ipv6 │ ├── expected_controller_config │ ├── expected_sdn_interfaces │ ├── interfaces │ └── sdn_config ├── ipv6underlay │ ├── expected_controller_config │ ├── expected_sdn_interfaces │ ├── interfaces │ └── sdn_config ├── isis │ ├── expected_controller_config │ ├── expected_sdn_interfaces │ ├── interfaces │ └── sdn_config ├── isis_loopback │ ├── expected_controller_config │ ├── expected_sdn_interfaces │ ├── interfaces │ └── sdn_config ├── multipath_relax │ ├── expected_controller_config │ ├── expected_sdn_interfaces │ ├── interfaces │ └── sdn_config ├── multiplezones │ ├── expected_controller_config │ ├── expected_sdn_interfaces │ ├── interfaces │ └── sdn_config ├── rt_import │ ├── expected_controller_config │ ├── expected_sdn_interfaces │ ├── interfaces │ └── sdn_config └── vxlanport │ ├── expected_controller_config │ ├── expected_sdn_interfaces │ ├── interfaces │ └── sdn_config ├── qinq ├── bridge │ ├── expected_sdn_interfaces │ ├── interfaces │ └── sdn_config ├── bridge_notagvnet │ ├── expected_sdn_interfaces │ ├── interfaces │ └── sdn_config ├── bridge_vlanaware │ ├── expected_sdn_interfaces │ ├── interfaces │ └── sdn_config ├── bridge_vlanaware_notagvnet │ ├── expected_sdn_interfaces │ ├── interfaces │ └── sdn_config ├── bridge_vlanaware_vlanawarevnet │ ├── expected_sdn_interfaces │ ├── interfaces │ └── sdn_config ├── bridge_vlanaware_vlanprotocol │ ├── expected_sdn_interfaces │ ├── interfaces │ └── sdn_config ├── bridge_vlanawarevnet │ ├── expected_sdn_interfaces │ ├── interfaces │ └── sdn_config ├── bridge_vlanprotocol │ ├── expected_sdn_interfaces │ ├── interfaces │ └── sdn_config ├── ovs │ ├── expected_sdn_interfaces │ ├── interfaces │ └── sdn_config ├── ovs_notagvnet │ ├── expected_sdn_interfaces │ ├── interfaces │ └── sdn_config ├── ovs_vlanawarevnet │ ├── expected_sdn_interfaces │ ├── interfaces │ └── sdn_config └── ovs_vlanprotocol │ ├── expected_sdn_interfaces │ ├── interfaces │ └── sdn_config ├── simple ├── basic │ ├── expected_sdn_interfaces │ ├── interfaces │ └── sdn_config ├── hetzner │ ├── expected_sdn_interfaces │ ├── interfaces │ └── sdn_config ├── ipv4 │ ├── expected_sdn_interfaces │ ├── interfaces │ └── sdn_config ├── ipv4snat │ ├── expected_sdn_interfaces │ ├── interfaces │ └── sdn_config ├── ipv4v6 │ ├── expected_sdn_interfaces │ ├── interfaces │ └── sdn_config ├── ipv4v6nogateway │ ├── expected_sdn_interfaces │ ├── interfaces │ └── sdn_config └── ipv6snat │ ├── expected_sdn_interfaces │ ├── interfaces │ └── sdn_config ├── vlan ├── bridge │ ├── expected_sdn_interfaces │ ├── interfaces │ └── sdn_config ├── bridge_vlanaware │ ├── expected_sdn_interfaces │ ├── interfaces │ └── sdn_config ├── bridge_vlanaware_vlanawarevnet │ ├── expected_sdn_interfaces │ ├── interfaces │ └── sdn_config ├── ovs │ ├── expected_sdn_interfaces │ ├── interfaces │ └── sdn_config └── ovs_vlanware_vnet │ ├── expected_sdn_interfaces │ ├── interfaces │ └── sdn_config └── vxlan ├── basic ├── expected_sdn_interfaces ├── interfaces └── sdn_config ├── vlanawarevnet ├── expected_sdn_interfaces ├── interfaces └── sdn_config └── vxlanport ├── expected_sdn_interfaces ├── interfaces └── sdn_config /.gitignore: -------------------------------------------------------------------------------- 1 | *.deb 2 | /*.build 3 | /*.buildinfo 4 | /*.changes 5 | /*.dsc 6 | /.vscode/ 7 | /libpve-network-perl-[0-9]*/ 8 | /libpve-network-perl_[0-9]*.tar.xz 9 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | include /usr/share/dpkg/pkg-info.mk 2 | 3 | PACKAGE=libpve-network-perl 4 | 5 | BUILDDIR ?= $(PACKAGE)-$(DEB_VERSION_UPSTREAM) 6 | 7 | DEBS=\ 8 | $(PACKAGE)_$(DEB_VERSION_UPSTREAM_REVISION)_all.deb \ 9 | libpve-network-api-perl_$(DEB_VERSION_UPSTREAM_REVISION)_all.deb \ 10 | 11 | DSC=$(PACKAGE)_$(DEB_VERSION_UPSTREAM_REVISION).dsc 12 | 13 | all: deb 14 | 15 | .PHONY: dinstall 16 | dinstall: deb 17 | dpkg -i $(DEBS) 18 | 19 | $(BUILDDIR): src debian 20 | rm -rf $@ $@.tmp 21 | cp -a src $@.tmp 22 | cp -a debian $@.tmp/ 23 | echo "git clone git://git.proxmox.com/git/pve-network.git\\ngit checkout $(shell git rev-parse HEAD)" > $@.tmp/debian/SOURCE 24 | mv $@.tmp $@ 25 | 26 | .PHONY: deb 27 | deb: $(DEBS) 28 | $(DEBS): $(BUILDDIR) 29 | cd $(BUILDDIR); dpkg-buildpackage -b -us -uc 30 | lintian $(DEBS) 31 | 32 | .PHONY: dsc 33 | dsc: clean 34 | $(MAKE) $(DSC) 35 | lintian $(DSC) 36 | 37 | $(DSC): $(BUILDDIR) 38 | cd $(BUILDDIR); dpkg-buildpackage -S -us -uc -d 39 | 40 | sbuild: $(DSC) 41 | sbuild $(DSC) 42 | 43 | .PHONY: clean distclean 44 | distclean: clean 45 | clean: 46 | rm -rf *~ *.deb *.changes $(PACKAGE)-[0-9]*/ $(PACKAGE)*.tar* *.build *.buildinfo *.dsc 47 | 48 | .PHONY: upload 49 | upload: UPLOAD_DIST ?= $(DEB_DISTRIBUTION) 50 | upload: $(DEBS) 51 | tar cf - $(DEBS)|ssh -X repoman@repo.proxmox.com -- upload --product pve --dist $(UPLOAD_DIST) 52 | -------------------------------------------------------------------------------- /debian/control: -------------------------------------------------------------------------------- 1 | Source: libpve-network-perl 2 | Section: perl 3 | Priority: optional 4 | Maintainer: Proxmox Support Team 5 | Build-Depends: debhelper-compat (= 13), 6 | lintian, 7 | libfile-slurp-perl , 8 | libnet-subnet-perl , 9 | libtest-mockmodule-perl , 10 | pve-cluster (>= 8.0.10) , 11 | pve-firewall (>= 5.1.0~) , 12 | pve-doc-generator (>= 5.3-3) , 13 | libpve-access-control , 14 | Standards-Version: 4.6.1 15 | Homepage: https://www.proxmox.com 16 | 17 | Package: libpve-network-perl 18 | Architecture: all 19 | Depends: libpve-common-perl (>= 5.0-45), 20 | pve-cluster (>= 8.0.10), 21 | libio-socket-ssl-perl, 22 | libnet-subnet-perl, 23 | libnet-ip-perl, 24 | libnetaddr-ip-perl, 25 | ${misc:Depends}, 26 | ${perl:Depends}, 27 | Recommends: ifupdown2 28 | Suggests: frr-pythontools (>= 8.5.1~), dnsmasq, 29 | Description: Proxmox VE's SDN (Software Defined Network) stack 30 | This package contains the perl side of the Software Defined Network 31 | implementation for Proxmox VE. 32 | 33 | Package: libpve-network-api-perl 34 | Architecture: all 35 | Depends: libpve-common-perl (>= 5.0-45), 36 | pve-firewall (>= 5.1.0~), 37 | pve-cluster (>= 8.0.9), 38 | libpve-network-perl (= ${binary:Version}), 39 | ${misc:Depends}, 40 | ${perl:Depends}, 41 | Breaks: libpve-network-perl (<< 0.9.9~), 42 | Replaces: pve-cluster (<< 0.9.9~), 43 | Description: API endpoints for Proxmox VE's SDN stack 44 | This package contains the API endpoints for the Software Defined Network of 45 | Proxmox VE. 46 | -------------------------------------------------------------------------------- /debian/copyright: -------------------------------------------------------------------------------- 1 | Copyright (C) 2019 Proxmox Server Solutions GmbH 2 | 3 | This software is written by Proxmox Server Solutions GmbH 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU Affero General Public License as published by 7 | the Free Software Foundation, either version 3 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU Affero General Public License for more details. 14 | 15 | You should have received a copy of the GNU Affero General Public License 16 | along with this program. If not, see . 17 | -------------------------------------------------------------------------------- /debian/docs: -------------------------------------------------------------------------------- 1 | debian/SOURCE 2 | -------------------------------------------------------------------------------- /debian/libpve-network-api-perl.install: -------------------------------------------------------------------------------- 1 | usr/share/perl5/PVE/API2 2 | -------------------------------------------------------------------------------- /debian/libpve-network-perl.install: -------------------------------------------------------------------------------- 1 | lib/systemd/system/dnsmasq@.service.d/00-dnsmasq-after-networking.conf 2 | usr/share/perl5/PVE/Network 3 | -------------------------------------------------------------------------------- /debian/libpve-network-perl.postinst: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | migrate_ipam_db() { 6 | LEGACY_IPAM_DB_FILE="/etc/pve/priv/ipam.db" 7 | IPAM_DB_FILE="/etc/pve/sdn/pve-ipam-state.json" 8 | 9 | if test -f "$LEGACY_IPAM_DB_FILE" && test ! -f "$IPAM_DB_FILE"; then 10 | echo "copying over existing legacy IPAM state file to new path..." 11 | cp $LEGACY_IPAM_DB_FILE $IPAM_DB_FILE || echo "copying IPAM state file failed!" 12 | fi 13 | } 14 | 15 | migrate_mac_cache() { 16 | LEGACY_MAC_DB_FILE="/etc/pve/priv/macs.db" 17 | MAC_DB_FILE="/etc/pve/sdn/mac-cache.json" 18 | 19 | if test -f "$LEGACY_MAC_DB_FILE" && test ! -f "$MAC_DB_FILE"; then 20 | echo "copying over existing legacy IPAM MAC-map cache file to new path..." 21 | cp $LEGACY_MAC_DB_FILE $MAC_DB_FILE || echo "copying IPAM MAC-map cache file failed!" 22 | fi 23 | } 24 | 25 | case "$1" in 26 | configure) 27 | # TODO: remove with PVE 9+ 28 | if dpkg --compare-versions "$2" 'lt' '0.9.9'; then 29 | migrate_ipam_db 30 | migrate_mac_cache 31 | fi 32 | ;; 33 | esac 34 | 35 | exit 0 36 | -------------------------------------------------------------------------------- /debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # -*- makefile -*- 3 | # Sample debian/rules that uses debhelper. 4 | # This file was originally written by Joey Hess and Craig Small. 5 | # As a special exception, when this file is copied by dh-make into a 6 | # dh-make output file, you may use that output file without restriction. 7 | # This special exception was added by Craig Small in version 0.37 of dh-make. 8 | 9 | # Uncomment this to turn on verbose mode. 10 | #export DH_VERBOSE=1 11 | 12 | %: 13 | dh $@ 14 | -------------------------------------------------------------------------------- /debian/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (native) 2 | -------------------------------------------------------------------------------- /debian/triggers: -------------------------------------------------------------------------------- 1 | activate-noawait pve-api-updates 2 | -------------------------------------------------------------------------------- /src/Makefile: -------------------------------------------------------------------------------- 1 | SUBDIRS := PVE services 2 | 3 | all: 4 | set -e && for i in $(SUBDIRS); do $(MAKE) -C $$i; done 5 | 6 | .PHONY: clean 7 | clean: 8 | $(MAKE) -C test $@ 9 | set -e && for i in $(SUBDIRS); do $(MAKE) -C $$i $@; done 10 | 11 | .PHONY: test 12 | test: 13 | $(MAKE) -C $@ 14 | 15 | .PHONY: install 16 | install: 17 | set -e && for i in $(SUBDIRS); do $(MAKE) -C $$i $@; done 18 | -------------------------------------------------------------------------------- /src/PVE/API2/Makefile: -------------------------------------------------------------------------------- 1 | 2 | .PHONY: install 3 | install: 4 | make -C Network install 5 | -------------------------------------------------------------------------------- /src/PVE/API2/Network/Makefile: -------------------------------------------------------------------------------- 1 | SOURCES=SDN.pm 2 | 3 | 4 | PERL5DIR=${DESTDIR}/usr/share/perl5 5 | 6 | .PHONY: install 7 | install: 8 | for i in ${SOURCES}; do install -D -m 0644 $$i ${PERL5DIR}/PVE/API2/Network/$$i; done 9 | make -C SDN install 10 | -------------------------------------------------------------------------------- /src/PVE/API2/Network/SDN.pm: -------------------------------------------------------------------------------- 1 | package PVE::API2::Network::SDN; 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use PVE::Cluster qw(cfs_lock_file cfs_read_file cfs_write_file); 7 | use PVE::Exception qw(raise_param_exc); 8 | use PVE::JSONSchema qw(get_standard_option); 9 | use PVE::RESTHandler; 10 | use PVE::RPCEnvironment; 11 | use PVE::SafeSyslog; 12 | use PVE::Tools qw(run_command); 13 | use PVE::Network::SDN; 14 | 15 | use PVE::API2::Network::SDN::Controllers; 16 | use PVE::API2::Network::SDN::Vnets; 17 | use PVE::API2::Network::SDN::Zones; 18 | use PVE::API2::Network::SDN::Ipams; 19 | use PVE::API2::Network::SDN::Dns; 20 | 21 | use base qw(PVE::RESTHandler); 22 | 23 | __PACKAGE__->register_method ({ 24 | subclass => "PVE::API2::Network::SDN::Vnets", 25 | path => 'vnets', 26 | }); 27 | 28 | __PACKAGE__->register_method ({ 29 | subclass => "PVE::API2::Network::SDN::Zones", 30 | path => 'zones', 31 | }); 32 | 33 | __PACKAGE__->register_method ({ 34 | subclass => "PVE::API2::Network::SDN::Controllers", 35 | path => 'controllers', 36 | }); 37 | 38 | __PACKAGE__->register_method ({ 39 | subclass => "PVE::API2::Network::SDN::Ipams", 40 | path => 'ipams', 41 | }); 42 | 43 | __PACKAGE__->register_method ({ 44 | subclass => "PVE::API2::Network::SDN::Dns", 45 | path => 'dns', 46 | }); 47 | 48 | __PACKAGE__->register_method({ 49 | name => 'index', 50 | path => '', 51 | method => 'GET', 52 | description => "Directory index.", 53 | permissions => { 54 | check => ['perm', '/sdn', [ 'SDN.Audit' ]], 55 | }, 56 | parameters => { 57 | additionalProperties => 0, 58 | properties => {}, 59 | }, 60 | returns => { 61 | type => 'array', 62 | items => { 63 | type => "object", 64 | properties => { 65 | id => { type => 'string' }, 66 | }, 67 | }, 68 | links => [ { rel => 'child', href => "{id}" } ], 69 | }, 70 | code => sub { 71 | my ($param) = @_; 72 | 73 | my $res = [ 74 | { id => 'vnets' }, 75 | { id => 'zones' }, 76 | { id => 'controllers' }, 77 | { id => 'ipams' }, 78 | { id => 'dns' }, 79 | ]; 80 | 81 | return $res; 82 | }}); 83 | 84 | my $create_reload_network_worker = sub { 85 | my ($nodename) = @_; 86 | 87 | # FIXME: how to proxy to final node ? 88 | my $upid; 89 | print "$nodename: reloading network config\n"; 90 | run_command(['pvesh', 'set', "/nodes/$nodename/network"], outfunc => sub { 91 | my $line = shift; 92 | if ($line =~ /["']?(UPID:[^\s"']+)["']?$/) { 93 | $upid = $1; 94 | } 95 | }); 96 | #my $upid = PVE::API2::Network->reload_network_config(node => $nodename}); 97 | my $res = PVE::Tools::upid_decode($upid); 98 | 99 | return $res->{pid}; 100 | }; 101 | 102 | __PACKAGE__->register_method ({ 103 | name => 'reload', 104 | protected => 1, 105 | path => '', 106 | method => 'PUT', 107 | description => "Apply sdn controller changes && reload.", 108 | permissions => { 109 | check => ['perm', '/sdn', ['SDN.Allocate']], 110 | }, 111 | parameters => { 112 | additionalProperties => 0, 113 | }, 114 | returns => { 115 | type => 'string', 116 | }, 117 | code => sub { 118 | my ($param) = @_; 119 | 120 | my $rpcenv = PVE::RPCEnvironment::get(); 121 | my $authuser = $rpcenv->get_user(); 122 | 123 | PVE::Network::SDN::commit_config(); 124 | 125 | my $code = sub { 126 | $rpcenv->{type} = 'priv'; # to start tasks in background 127 | PVE::Cluster::check_cfs_quorum(); 128 | my $nodelist = PVE::Cluster::get_nodelist(); 129 | for my $node (@$nodelist) { 130 | my $pid = eval { $create_reload_network_worker->($node) }; 131 | warn $@ if $@; 132 | } 133 | 134 | # FIXME: use libpve-apiclient (like in cluster join) to create 135 | # tasks and moitor the tasks. 136 | 137 | return; 138 | }; 139 | 140 | return $rpcenv->fork_worker('reloadnetworkall', undef, $authuser, $code); 141 | 142 | }}); 143 | 144 | 145 | 1; 146 | -------------------------------------------------------------------------------- /src/PVE/API2/Network/SDN/Makefile: -------------------------------------------------------------------------------- 1 | SOURCES=Vnets.pm Zones.pm Controllers.pm Subnets.pm Ipams.pm Dns.pm Ips.pm 2 | 3 | 4 | PERL5DIR=${DESTDIR}/usr/share/perl5 5 | 6 | .PHONY: install 7 | install: 8 | for i in ${SOURCES}; do install -D -m 0644 $$i ${PERL5DIR}/PVE/API2/Network/SDN/$$i; done 9 | make -C Zones install 10 | 11 | -------------------------------------------------------------------------------- /src/PVE/API2/Network/SDN/Zones/Content.pm: -------------------------------------------------------------------------------- 1 | package PVE::API2::Network::SDN::Zones::Content; 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use PVE::SafeSyslog; 7 | use PVE::Cluster; 8 | use PVE::INotify; 9 | use PVE::Exception qw(raise_param_exc); 10 | use PVE::RPCEnvironment; 11 | use PVE::RESTHandler; 12 | use PVE::JSONSchema qw(get_standard_option); 13 | use PVE::Network::SDN; 14 | 15 | use base qw(PVE::RESTHandler); 16 | 17 | __PACKAGE__->register_method ({ 18 | name => 'index', 19 | path => '', 20 | method => 'GET', 21 | description => "List zone content.", 22 | permissions => { 23 | check => ['perm', '/sdn/zones/{zone}', ['SDN.Audit'], any => 1], 24 | }, 25 | protected => 1, 26 | proxyto => 'node', 27 | parameters => { 28 | additionalProperties => 0, 29 | properties => { 30 | node => get_standard_option('pve-node'), 31 | zone => get_standard_option('pve-sdn-zone-id', { 32 | completion => \&PVE::Network::SDN::Zones::complete_sdn_zone, 33 | }), 34 | }, 35 | }, 36 | returns => { 37 | type => 'array', 38 | items => { 39 | type => "object", 40 | properties => { 41 | vnet => { 42 | description => "Vnet identifier.", 43 | type => 'string', 44 | }, 45 | status => { 46 | description => "Status.", 47 | type => 'string', 48 | optional => 1, 49 | }, 50 | statusmsg => { 51 | description => "Status details", 52 | type => 'string', 53 | optional => 1, 54 | }, 55 | }, 56 | }, 57 | links => [ { rel => 'child', href => "{vnet}" } ], 58 | }, 59 | code => sub { 60 | my ($param) = @_; 61 | 62 | my $rpcenv = PVE::RPCEnvironment::get(); 63 | 64 | my $authuser = $rpcenv->get_user(); 65 | 66 | my $zoneid = $param->{zone}; 67 | 68 | my $res = []; 69 | 70 | my ($zone_status, $vnet_status) = PVE::Network::SDN::status(); 71 | 72 | foreach my $id (keys %{$vnet_status}) { 73 | if ($vnet_status->{$id}->{zone} eq $zoneid) { 74 | my $item->{vnet} = $id; 75 | $item->{status} = $vnet_status->{$id}->{'status'}; 76 | $item->{statusmsg} = $vnet_status->{$id}->{'statusmsg'}; 77 | push @$res,$item; 78 | } 79 | } 80 | 81 | return $res; 82 | }}); 83 | 84 | 1; 85 | -------------------------------------------------------------------------------- /src/PVE/API2/Network/SDN/Zones/Makefile: -------------------------------------------------------------------------------- 1 | SOURCES=Status.pm Content.pm 2 | 3 | 4 | PERL5DIR=${DESTDIR}/usr/share/perl5 5 | 6 | .PHONY: install 7 | install: 8 | for i in ${SOURCES}; do install -D -m 0644 $$i ${PERL5DIR}/PVE/API2/Network/SDN/Zones/$$i; done 9 | -------------------------------------------------------------------------------- /src/PVE/API2/Network/SDN/Zones/Status.pm: -------------------------------------------------------------------------------- 1 | package PVE::API2::Network::SDN::Zones::Status; 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use File::Path; 7 | use File::Basename; 8 | use PVE::Tools; 9 | use PVE::INotify; 10 | use PVE::Cluster; 11 | use PVE::API2::Network::SDN::Zones::Content; 12 | use PVE::RESTHandler; 13 | use PVE::RPCEnvironment; 14 | use PVE::JSONSchema qw(get_standard_option); 15 | use PVE::Exception qw(raise_param_exc); 16 | 17 | use base qw(PVE::RESTHandler); 18 | 19 | __PACKAGE__->register_method ({ 20 | subclass => "PVE::API2::Network::SDN::Zones::Content", 21 | path => '{zone}/content', 22 | }); 23 | 24 | __PACKAGE__->register_method ({ 25 | name => 'index', 26 | path => '', 27 | method => 'GET', 28 | description => "Get status for all zones.", 29 | permissions => { 30 | description => "Only list entries where you have 'SDN.Audit'", 31 | user => 'all', 32 | }, 33 | protected => 1, 34 | proxyto => 'node', 35 | parameters => { 36 | additionalProperties => 0, 37 | properties => { 38 | node => get_standard_option('pve-node') 39 | }, 40 | }, 41 | returns => { 42 | type => 'array', 43 | items => { 44 | type => "object", 45 | properties => { 46 | zone => get_standard_option('pve-sdn-zone-id'), 47 | status => { 48 | description => "Status of zone", 49 | type => 'string', 50 | enum => ['available', 'pending', 'error'], 51 | }, 52 | }, 53 | }, 54 | links => [ { rel => 'child', href => "{zone}" } ], 55 | }, 56 | code => sub { 57 | my ($param) = @_; 58 | 59 | my $rpcenv = PVE::RPCEnvironment::get(); 60 | my $authuser = $rpcenv->get_user(); 61 | 62 | my $localnode = PVE::INotify::nodename(); 63 | 64 | my $res = []; 65 | 66 | my ($zone_status, $vnet_status) = PVE::Network::SDN::status(); 67 | 68 | foreach my $id (sort keys %{$zone_status}) { 69 | my $item->{zone} = $id; 70 | $item->{status} = $zone_status->{$id}->{'status'}; 71 | push @$res, $item; 72 | } 73 | 74 | return $res; 75 | }}); 76 | 77 | __PACKAGE__->register_method ({ 78 | name => 'diridx', 79 | path => '{zone}', 80 | method => 'GET', 81 | description => "", 82 | permissions => { 83 | check => ['perm', '/sdn/zones/{zone}', ['SDN.Audit'], any => 1], 84 | }, 85 | parameters => { 86 | additionalProperties => 0, 87 | properties => { 88 | node => get_standard_option('pve-node'), 89 | zone => get_standard_option('pve-sdn-zone-id'), 90 | }, 91 | }, 92 | returns => { 93 | type => 'array', 94 | items => { 95 | type => "object", 96 | properties => { 97 | subdir => { type => 'string' }, 98 | }, 99 | }, 100 | links => [ { rel => 'child', href => "{subdir}" } ], 101 | }, 102 | code => sub { 103 | my ($param) = @_; 104 | my $res = [ 105 | { subdir => 'content' }, 106 | ]; 107 | 108 | return $res; 109 | }}); 110 | 111 | 1; 112 | -------------------------------------------------------------------------------- /src/PVE/Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | 3 | .PHONY: install 4 | install: 5 | make -C Network install 6 | make -C API2 install 7 | 8 | clean: 9 | -------------------------------------------------------------------------------- /src/PVE/Network/Makefile: -------------------------------------------------------------------------------- 1 | SOURCES=SDN.pm 2 | 3 | 4 | PERL5DIR=${DESTDIR}/usr/share/perl5 5 | 6 | .PHONY: install 7 | install: 8 | for i in ${SOURCES}; do install -D -m 0644 $$i ${PERL5DIR}/PVE/Network/$$i; done 9 | make -C SDN install 10 | -------------------------------------------------------------------------------- /src/PVE/Network/SDN/Controllers/FaucetPlugin.pm: -------------------------------------------------------------------------------- 1 | package PVE::Network::SDN::Controllers::FaucetPlugin; 2 | 3 | use strict; 4 | use warnings; 5 | use PVE::Network::SDN::Controllers::Plugin; 6 | use PVE::Tools; 7 | use PVE::INotify; 8 | use PVE::JSONSchema qw(get_standard_option); 9 | use CPAN::Meta::YAML; 10 | use Encode; 11 | 12 | use base('PVE::Network::SDN::Controllers::Plugin'); 13 | 14 | sub type { 15 | return 'faucet'; 16 | } 17 | 18 | sub properties { 19 | return { 20 | }; 21 | } 22 | 23 | # Plugin implementation 24 | sub generate_controller_config { 25 | my ($class, $plugin_config, $controller_cfg, $id, $uplinks, $config) = @_; 26 | 27 | } 28 | 29 | sub generate_controller_zone_config { 30 | my ($class, $plugin_config, $controller, $controller_cfg, $id, $uplinks, $config) = @_; 31 | 32 | my $dpid = $plugin_config->{'dp-id'}; 33 | my $dphex = printf("%x",$dpid); 34 | 35 | my $zone_config = { 36 | dp_id => $dphex, 37 | hardware => "Open vSwitch", 38 | }; 39 | 40 | $config->{faucet}->{dps}->{$id} = $zone_config; 41 | 42 | } 43 | 44 | 45 | sub generate_controller_vnet_config { 46 | my ($class, $plugin_config, $controller, $zone, $zoneid, $vnetid, $config) = @_; 47 | 48 | my $mac = $plugin_config->{mac}; 49 | my $ipv4 = $plugin_config->{ipv4}; 50 | my $ipv6 = $plugin_config->{ipv6}; 51 | my $tag = $plugin_config->{tag}; 52 | my $alias = $plugin_config->{alias}; 53 | 54 | my @ips = (); 55 | push @ips, $ipv4 if $ipv4; 56 | push @ips, $ipv6 if $ipv6; 57 | 58 | my $vlan_config = { vid => $tag }; 59 | 60 | $vlan_config->{description} = $alias if $alias; 61 | $vlan_config->{faucet_mac} = $mac if $mac; 62 | $vlan_config->{faucet_vips} = \@ips if scalar @ips > 0; 63 | 64 | $config->{faucet}->{vlans}->{$vnetid} = $vlan_config; 65 | 66 | push(@{$config->{faucet}->{routers}->{$zoneid}->{vlans}} , $vnetid); 67 | 68 | } 69 | 70 | sub write_controller_config { 71 | my ($class, $plugin_config, $config) = @_; 72 | 73 | my $rawconfig = encode('UTF-8', CPAN::Meta::YAML::Dump($config->{faucet})); 74 | 75 | return if !$rawconfig; 76 | return if !-d "/etc/faucet"; 77 | 78 | my $frr_config_file = "/etc/faucet/faucet.yaml"; 79 | 80 | my $writefh = IO::File->new($frr_config_file,">"); 81 | print $writefh $rawconfig; 82 | $writefh->close(); 83 | } 84 | 85 | sub reload_controller { 86 | my ($class) = @_; 87 | 88 | my $conf_file = "/etc/faucet/faucet.yaml"; 89 | my $bin_path = "/usr/bin/faucet"; 90 | 91 | if (-e $conf_file && -e $bin_path) { 92 | PVE::Tools::run_command(['systemctl', 'reload', 'faucet']); 93 | } 94 | } 95 | 96 | 1; 97 | 98 | -------------------------------------------------------------------------------- /src/PVE/Network/SDN/Controllers/IsisPlugin.pm: -------------------------------------------------------------------------------- 1 | package PVE::Network::SDN::Controllers::IsisPlugin; 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use PVE::INotify; 7 | use PVE::JSONSchema qw(get_standard_option); 8 | use PVE::Tools qw(run_command file_set_contents file_get_contents); 9 | 10 | use PVE::Network::SDN::Controllers::Plugin; 11 | use PVE::Network::SDN::Zones::Plugin; 12 | use Net::IP; 13 | 14 | use base('PVE::Network::SDN::Controllers::Plugin'); 15 | 16 | sub type { 17 | return 'isis'; 18 | } 19 | 20 | PVE::JSONSchema::register_format('pve-sdn-isis-net', \&pve_verify_sdn_isis_net); 21 | sub pve_verify_sdn_isis_net { 22 | my ($net) = @_; 23 | 24 | if ($net !~ m/^[a-fA-F0-9]{2}(\.[a-fA-F0-9]{4}){3,9}\.[a-fA-F0-9]{2}$/) { 25 | die "value does not look like a valid isis net\n"; 26 | } 27 | return $net; 28 | } 29 | 30 | sub properties { 31 | return { 32 | 'isis-domain' => { 33 | description => "ISIS domain.", 34 | type => 'string' 35 | }, 36 | 'isis-ifaces' => { 37 | description => "ISIS interface.", 38 | type => 'string', format => 'pve-iface-list', 39 | }, 40 | 'isis-net' => { 41 | description => "ISIS network entity title.", 42 | type => 'string', format => 'pve-sdn-isis-net', 43 | }, 44 | }; 45 | } 46 | 47 | sub options { 48 | return { 49 | 'isis-domain' => { optional => 0 }, 50 | 'isis-net' => { optional => 0 }, 51 | 'isis-ifaces' => { optional => 0 }, 52 | 'node' => { optional => 0 }, 53 | 'loopback' => { optional => 1 }, 54 | }; 55 | } 56 | 57 | # Plugin implementation 58 | sub generate_controller_config { 59 | my ($class, $plugin_config, $controller, $id, $uplinks, $config) = @_; 60 | 61 | my $isis_ifaces = $plugin_config->{'isis-ifaces'}; 62 | my $isis_net = $plugin_config->{'isis-net'}; 63 | my $isis_domain = $plugin_config->{'isis-domain'}; 64 | my $local_node = PVE::INotify::nodename(); 65 | 66 | return if !$isis_ifaces || !$isis_net || !$isis_domain; 67 | return if $local_node ne $plugin_config->{node}; 68 | 69 | my @router_config = ( 70 | "net $isis_net", 71 | "redistribute ipv4 connected level-1", 72 | "redistribute ipv6 connected level-1", 73 | "log-adjacency-changes", 74 | ); 75 | 76 | push(@{$config->{frr}->{router}->{"isis $isis_domain"}}, @router_config); 77 | 78 | my @iface_config = ( 79 | "ip router isis $isis_domain" 80 | ); 81 | 82 | my @ifaces = PVE::Tools::split_list($isis_ifaces); 83 | for my $iface (sort @ifaces) { 84 | push(@{$config->{frr_interfaces}->{$iface}}, @iface_config); 85 | } 86 | 87 | return $config; 88 | } 89 | 90 | sub generate_controller_zone_config { 91 | my ($class, $plugin_config, $controller, $controller_cfg, $id, $uplinks, $config) = @_; 92 | 93 | } 94 | 95 | sub on_delete_hook { 96 | my ($class, $controllerid, $zone_cfg) = @_; 97 | 98 | } 99 | 100 | sub on_update_hook { 101 | my ($class, $controllerid, $controller_cfg) = @_; 102 | 103 | # we can only have 1 bgp controller by node 104 | my $local_node = PVE::INotify::nodename(); 105 | my $controllernb = 0; 106 | foreach my $id (keys %{$controller_cfg->{ids}}) { 107 | next if $id eq $controllerid; 108 | my $controller = $controller_cfg->{ids}->{$id}; 109 | next if $controller->{type} ne "isis"; 110 | next if $controller->{node} ne $local_node; 111 | $controllernb++; 112 | die "only 1 bgp or isis controller can be defined" if $controllernb > 1; 113 | } 114 | } 115 | 116 | sub generate_controller_rawconfig { 117 | my ($class, $plugin_config, $config) = @_; 118 | return ""; 119 | } 120 | 121 | sub write_controller_config { 122 | my ($class, $plugin_config, $config) = @_; 123 | return; 124 | } 125 | 126 | sub reload_controller { 127 | my ($class) = @_; 128 | return; 129 | } 130 | 131 | 1; 132 | 133 | 134 | -------------------------------------------------------------------------------- /src/PVE/Network/SDN/Controllers/Makefile: -------------------------------------------------------------------------------- 1 | SOURCES=Plugin.pm FaucetPlugin.pm EvpnPlugin.pm BgpPlugin.pm IsisPlugin.pm 2 | 3 | 4 | PERL5DIR=${DESTDIR}/usr/share/perl5 5 | 6 | .PHONY: install 7 | install: 8 | for i in ${SOURCES}; do install -D -m 0644 $$i ${PERL5DIR}/PVE/Network/SDN/Controllers/$$i; done 9 | -------------------------------------------------------------------------------- /src/PVE/Network/SDN/Dhcp/Makefile: -------------------------------------------------------------------------------- 1 | SOURCES=Plugin.pm Dnsmasq.pm 2 | 3 | 4 | PERL5DIR=${DESTDIR}/usr/share/perl5 5 | 6 | .PHONY: install 7 | install: 8 | for i in ${SOURCES}; do install -D -m 0644 $$i ${PERL5DIR}/PVE/Network/SDN/Dhcp/$$i; done 9 | -------------------------------------------------------------------------------- /src/PVE/Network/SDN/Dhcp/Plugin.pm: -------------------------------------------------------------------------------- 1 | package PVE::Network::SDN::Dhcp::Plugin; 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use PVE::Cluster; 7 | use PVE::JSONSchema qw(get_standard_option); 8 | 9 | use base qw(PVE::SectionConfig); 10 | 11 | my $defaultData = { 12 | propertyList => { 13 | type => { 14 | description => "Plugin type.", 15 | format => 'pve-configid', 16 | type => 'string', 17 | }, 18 | }, 19 | }; 20 | 21 | sub private { 22 | return $defaultData; 23 | } 24 | 25 | sub add_ip_mapping { 26 | my ($class, $dhcpid, $macdb, $mac, $ip4, $ip6) = @_; 27 | die 'implement in sub class'; 28 | } 29 | 30 | sub configure_range { 31 | my ($class, $config, $dhcpid, $vnetid, $subnet_config, $range_config) = @_; 32 | die 'implement in sub class'; 33 | } 34 | 35 | sub configure_subnet { 36 | my ($class, $config, $dhcpid, $vnetid, $subnet_config) = @_; 37 | die 'implement in sub class'; 38 | } 39 | 40 | sub configure_vnet { 41 | my ($class, $config, $dhcpid, $vnetid, $vnet_config) = @_; 42 | die 'implement in sub class'; 43 | } 44 | 45 | sub before_configure { 46 | my ($class, $dhcpid, $zone_config) = @_; 47 | die 'implement in sub class'; 48 | } 49 | 50 | sub after_configure { 51 | my ($class, $dhcpid, $noerr) = @_; 52 | die 'implement in sub class'; 53 | } 54 | 55 | sub before_regenerate { 56 | my ($class, $noerr) = @_; 57 | die 'implement in sub class'; 58 | } 59 | 60 | sub after_regenerate { 61 | my ($class) = @_; 62 | die 'implement in sub class'; 63 | } 64 | 65 | 1; 66 | -------------------------------------------------------------------------------- /src/PVE/Network/SDN/Dns.pm: -------------------------------------------------------------------------------- 1 | package PVE::Network::SDN::Dns; 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use JSON; 7 | 8 | use PVE::Tools qw(extract_param dir_glob_regex run_command); 9 | use PVE::Cluster qw(cfs_read_file cfs_write_file cfs_lock_file); 10 | use PVE::Network; 11 | 12 | use PVE::Network::SDN::Dns::PowerdnsPlugin; 13 | use PVE::Network::SDN::Dns::Plugin; 14 | 15 | PVE::Network::SDN::Dns::PowerdnsPlugin->register(); 16 | PVE::Network::SDN::Dns::Plugin->init(); 17 | 18 | 19 | sub sdn_dns_config { 20 | my ($cfg, $id, $noerr) = @_; 21 | 22 | die "no sdn dns ID specified\n" if !$id; 23 | 24 | my $scfg = $cfg->{ids}->{$id}; 25 | die "sdn '$id' does not exist\n" if (!$noerr && !$scfg); 26 | 27 | return $scfg; 28 | } 29 | 30 | sub config { 31 | my $config = cfs_read_file("sdn/dns.cfg"); 32 | return $config; 33 | } 34 | 35 | sub write_config { 36 | my ($cfg) = @_; 37 | 38 | cfs_write_file("sdn/dns.cfg", $cfg); 39 | } 40 | 41 | sub sdn_dns_ids { 42 | my ($cfg) = @_; 43 | 44 | return keys %{$cfg->{ids}}; 45 | } 46 | 47 | sub complete_sdn_dns { 48 | my ($cmdname, $pname, $cvalue) = @_; 49 | 50 | my $cfg = PVE::Network::SDN::Dns::config(); 51 | 52 | return $cmdname eq 'add' ? [] : [ PVE::Network::SDN::Dns::sdn_dns_ids($cfg) ]; 53 | } 54 | 55 | 1; 56 | 57 | -------------------------------------------------------------------------------- /src/PVE/Network/SDN/Dns/Makefile: -------------------------------------------------------------------------------- 1 | SOURCES=Plugin.pm PowerdnsPlugin.pm 2 | 3 | 4 | PERL5DIR=${DESTDIR}/usr/share/perl5 5 | 6 | .PHONY: install 7 | install: 8 | for i in ${SOURCES}; do install -D -m 0644 $$i ${PERL5DIR}/PVE/Network/SDN/Dns/$$i; done 9 | -------------------------------------------------------------------------------- /src/PVE/Network/SDN/Dns/Plugin.pm: -------------------------------------------------------------------------------- 1 | package PVE::Network::SDN::Dns::Plugin; 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use PVE::Tools qw(run_command); 7 | use PVE::JSONSchema; 8 | use PVE::Cluster; 9 | use HTTP::Request; 10 | use LWP::UserAgent; 11 | 12 | use PVE::JSONSchema qw(get_standard_option); 13 | use base qw(PVE::SectionConfig); 14 | 15 | PVE::Cluster::cfs_register_file('sdn/dns.cfg', 16 | sub { __PACKAGE__->parse_config(@_); }, 17 | sub { __PACKAGE__->write_config(@_); }); 18 | 19 | PVE::JSONSchema::register_standard_option('pve-sdn-dns-id', { 20 | description => "The SDN dns object identifier.", 21 | type => 'string', format => 'pve-sdn-dns-id', 22 | }); 23 | 24 | PVE::JSONSchema::register_format('pve-sdn-dns-id', \&parse_sdn_dns_id); 25 | sub parse_sdn_dns_id { 26 | my ($id, $noerr) = @_; 27 | 28 | if ($id !~ m/^[a-z][a-z0-9]*[a-z0-9]$/i) { 29 | return undef if $noerr; 30 | die "dns ID '$id' contains illegal characters\n"; 31 | } 32 | return $id; 33 | } 34 | 35 | my $defaultData = { 36 | 37 | propertyList => { 38 | type => { 39 | description => "Plugin type.", 40 | type => 'string', format => 'pve-configid', 41 | }, 42 | ttl => { type => 'integer', optional => 1 }, 43 | reversev6mask => { type => 'integer', optional => 1 }, 44 | dns => get_standard_option('pve-sdn-dns-id', 45 | { completion => \&PVE::Network::SDN::Dns::complete_sdn_dns }), 46 | fingerprint => get_standard_option('fingerprint-sha256', { optional => 1 }), 47 | }, 48 | }; 49 | 50 | sub private { 51 | return $defaultData; 52 | } 53 | 54 | sub parse_section_header { 55 | my ($class, $line) = @_; 56 | 57 | if ($line =~ m/^(\S+):\s*(\S+)\s*$/) { 58 | my ($type, $id) = (lc($1), $2); 59 | my $errmsg = undef; # set if you want to skip whole section 60 | eval { PVE::JSONSchema::pve_verify_configid($type); }; 61 | $errmsg = $@ if $@; 62 | my $config = {}; # to return additional attributes 63 | return ($type, $id, $errmsg, $config); 64 | } 65 | return undef; 66 | } 67 | 68 | 69 | sub add_a_record { 70 | my ($class, $plugin_config, $zone, $hostname, $ip, $noerr) = @_; 71 | 72 | die "please implement inside plugin"; 73 | } 74 | 75 | sub add_ptr_record { 76 | my ($class, $plugin_config, $zone, $hostname, $ip, $noerr) = @_; 77 | 78 | die "please implement inside plugin"; 79 | } 80 | 81 | sub del_ptr_record { 82 | my ($class, $plugin_config, $zone, $ip, $noerr) = @_; 83 | 84 | die "please implement inside plugin"; 85 | } 86 | 87 | sub del_a_record { 88 | my ($class, $plugin_config, $zone, $hostname, $ip, $noerr) = @_; 89 | 90 | die "please implement inside plugin"; 91 | } 92 | 93 | sub verify_zone { 94 | my ($class, $plugin_config, $zone, $noerr) = @_; 95 | 96 | die "please implement inside plugin"; 97 | } 98 | 99 | sub get_reversedns_zone { 100 | my ($class, $plugin_config, $subnetid, $subnet, $ip) = @_; 101 | 102 | die "please implement inside plugin"; 103 | } 104 | 105 | sub on_update_hook { 106 | my ($class, $plugin_config) = @_; 107 | } 108 | 109 | 1; 110 | -------------------------------------------------------------------------------- /src/PVE/Network/SDN/Ipams/Makefile: -------------------------------------------------------------------------------- 1 | SOURCES=Plugin.pm PhpIpamPlugin.pm NetboxPlugin.pm PVEPlugin.pm 2 | 3 | 4 | PERL5DIR=${DESTDIR}/usr/share/perl5 5 | 6 | .PHONY: install 7 | install: 8 | for i in ${SOURCES}; do install -D -m 0644 $$i ${PERL5DIR}/PVE/Network/SDN/Ipams/$$i; done 9 | -------------------------------------------------------------------------------- /src/PVE/Network/SDN/Ipams/Plugin.pm: -------------------------------------------------------------------------------- 1 | package PVE::Network::SDN::Ipams::Plugin; 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use PVE::Tools qw(run_command); 7 | use PVE::JSONSchema; 8 | use PVE::Cluster; 9 | use HTTP::Request; 10 | use LWP::UserAgent; 11 | use JSON; 12 | 13 | use PVE::JSONSchema qw(get_standard_option); 14 | use base qw(PVE::SectionConfig); 15 | 16 | PVE::Cluster::cfs_register_file( 17 | 'sdn/ipams.cfg', 18 | sub { __PACKAGE__->parse_config(@_); }, 19 | sub { __PACKAGE__->write_config(@_); }, 20 | ); 21 | 22 | PVE::JSONSchema::register_standard_option('pve-sdn-ipam-id', { 23 | description => "The SDN ipam object identifier.", 24 | type => 'string', format => 'pve-sdn-ipam-id', 25 | }); 26 | 27 | PVE::JSONSchema::register_format('pve-sdn-ipam-id', \&parse_sdn_ipam_id); 28 | sub parse_sdn_ipam_id { 29 | my ($id, $noerr) = @_; 30 | 31 | if ($id !~ m/^[a-z][a-z0-9]*[a-z0-9]$/i) { 32 | return undef if $noerr; 33 | die "ipam ID '$id' contains illegal characters\n"; 34 | } 35 | return $id; 36 | } 37 | 38 | my $defaultData = { 39 | 40 | propertyList => { 41 | type => { 42 | description => "Plugin type.", 43 | type => 'string', format => 'pve-configid', 44 | type => 'string', 45 | }, 46 | ipam => get_standard_option('pve-sdn-ipam-id', { 47 | completion => \&PVE::Network::SDN::Ipams::complete_sdn_ipam, 48 | }), 49 | fingerprint => get_standard_option('fingerprint-sha256', { optional => 1 }), 50 | }, 51 | }; 52 | 53 | sub private { 54 | return $defaultData; 55 | } 56 | 57 | sub parse_section_header { 58 | my ($class, $line) = @_; 59 | 60 | if ($line =~ m/^(\S+):\s*(\S+)\s*$/) { 61 | my ($type, $id) = (lc($1), $2); 62 | my $errmsg = undef; # set if you want to skip whole section 63 | eval { PVE::JSONSchema::pve_verify_configid($type); }; 64 | $errmsg = $@ if $@; 65 | my $config = {}; # to return additional attributes 66 | return ($type, $id, $errmsg, $config); 67 | } 68 | return undef; 69 | } 70 | 71 | 72 | sub add_subnet { 73 | my ($class, $plugin_config, $subnetid, $subnet, $noerr) = @_; 74 | 75 | die "please implement inside plugin"; 76 | } 77 | 78 | sub update_subnet { 79 | my ($class, $plugin_config, $subnetid, $subnet, $old_subnet, $noerr) = @_; 80 | 81 | die "please implement inside plugin"; 82 | } 83 | 84 | sub del_subnet { 85 | my ($class, $plugin_config, $subnetid, $subnet, $noerr) = @_; 86 | 87 | die "please implement inside plugin"; 88 | } 89 | 90 | sub add_ip { 91 | my ($class, $plugin_config, $subnetid, $subnet, $ip, $hostname, $mac, $vmid, $is_gateway, $noerr) = @_; 92 | 93 | die "please implement inside plugin"; 94 | } 95 | 96 | sub update_ip { 97 | my ($class, $plugin_config, $subnetid, $subnet, $ip, $hostname, $mac, $vmid, $is_gateway, $noerr) = @_; 98 | # only update ip attributes (mac,hostname,..). Don't change the ip addresses itself, as some ipam 99 | # don't allow ip address change without del/add 100 | 101 | die "please implement inside plugin"; 102 | } 103 | 104 | sub add_next_freeip { 105 | my ($class, $plugin_config, $subnetid, $subnet, $hostname, $mac, $vmid, $noerr) = @_; 106 | 107 | die "please implement inside plugin"; 108 | } 109 | 110 | 111 | sub add_range_next_freeip { 112 | my ($class, $plugin_config, $subnet, $range, $data, $noerr) = @_; 113 | 114 | die "please implement inside plugin"; 115 | } 116 | 117 | sub del_ip { 118 | my ($class, $plugin_config, $subnetid, $subnet, $ip, $noerr) = @_; 119 | 120 | die "please implement inside plugin"; 121 | } 122 | 123 | sub get_ips_from_mac { 124 | my ($class, $plugin_config, $mac, $zone) = @_; 125 | 126 | die "please implement inside plugin"; 127 | } 128 | 129 | sub on_update_hook { 130 | my ($class, $plugin_config) = @_; 131 | } 132 | 133 | 1; 134 | -------------------------------------------------------------------------------- /src/PVE/Network/SDN/Makefile: -------------------------------------------------------------------------------- 1 | SOURCES=Vnets.pm VnetPlugin.pm Zones.pm Controllers.pm Subnets.pm SubnetPlugin.pm Ipams.pm Dns.pm Dhcp.pm 2 | 3 | 4 | PERL5DIR=${DESTDIR}/usr/share/perl5 5 | 6 | .PHONY: install 7 | install: 8 | for i in ${SOURCES}; do install -D -m 0644 $$i ${PERL5DIR}/PVE/Network/SDN/$$i; done 9 | make -C Controllers install 10 | make -C Zones install 11 | make -C Ipams install 12 | make -C Dns install 13 | make -C Dhcp install 14 | 15 | -------------------------------------------------------------------------------- /src/PVE/Network/SDN/VnetPlugin.pm: -------------------------------------------------------------------------------- 1 | package PVE::Network::SDN::VnetPlugin; 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use PVE::Cluster qw(cfs_read_file cfs_write_file cfs_lock_file); 7 | use PVE::Exception qw(raise raise_param_exc); 8 | use PVE::JSONSchema qw(get_standard_option); 9 | 10 | use PVE::SectionConfig; 11 | use base qw(PVE::SectionConfig); 12 | 13 | PVE::Cluster::cfs_register_file('sdn/vnets.cfg', 14 | sub { __PACKAGE__->parse_config(@_); }, 15 | sub { __PACKAGE__->write_config(@_); }); 16 | 17 | PVE::JSONSchema::register_standard_option('pve-sdn-vnet-id', { 18 | description => "The SDN vnet object identifier.", 19 | type => 'string', format => 'pve-sdn-vnet-id', 20 | }); 21 | 22 | PVE::JSONSchema::register_format('pve-sdn-vnet-id', \&parse_sdn_vnet_id); 23 | sub parse_sdn_vnet_id { 24 | my ($id, $noerr) = @_; 25 | 26 | if ($id !~ m/^[a-z][a-z0-9]*[a-z0-9]$/i) { 27 | return undef if $noerr; 28 | die "vnet ID '$id' contains illegal characters\n"; 29 | } 30 | die "vnet ID '$id' can't be more length than 8 characters\n" if length($id) > 8; 31 | return $id; 32 | } 33 | 34 | my $defaultData = { 35 | 36 | propertyList => { 37 | vnet => get_standard_option('pve-sdn-vnet-id', 38 | { completion => \&PVE::Network::SDN::Vnets::complete_sdn_vnet }), 39 | }, 40 | }; 41 | 42 | sub type { 43 | return 'vnet'; 44 | } 45 | 46 | sub private { 47 | return $defaultData; 48 | } 49 | 50 | sub properties { 51 | return { 52 | zone => { 53 | type => 'string', 54 | description => "zone id", 55 | }, 56 | type => { 57 | description => "Type", 58 | optional => 1, 59 | }, 60 | tag => { 61 | type => 'integer', 62 | description => "vlan or vxlan id", 63 | }, 64 | vlanaware => { 65 | type => 'boolean', 66 | description => 'Allow vm VLANs to pass through this vnet.', 67 | }, 68 | alias => { 69 | type => 'string', 70 | description => "alias name of the vnet", 71 | pattern => qr/[\(\)-_.\w\d\s]{0,256}/i, 72 | maxLength => 256, 73 | optional => 1, 74 | }, 75 | 'isolate-ports' => { 76 | type => 'boolean', 77 | description => "If true, sets the isolated property for all members of this VNet", 78 | } 79 | }; 80 | } 81 | 82 | sub options { 83 | return { 84 | zone => { optional => 0}, 85 | tag => { optional => 1}, 86 | alias => { optional => 1 }, 87 | vlanaware => { optional => 1 }, 88 | 'isolate-ports' => { optional => 1 }, 89 | }; 90 | } 91 | 92 | sub on_delete_hook { 93 | my ($class, $vnetid, $vnet_cfg) = @_; 94 | 95 | #verify if subnets are associated 96 | my $subnets = PVE::Network::SDN::Vnets::get_subnets($vnetid); 97 | raise_param_exc({ vnet => "Can't delete vnet if subnets exists"}) if $subnets; 98 | } 99 | 100 | sub on_update_hook { 101 | my ($class, $vnetid, $vnet_cfg) = @_; 102 | 103 | my $vnet = $vnet_cfg->{ids}->{$vnetid}; 104 | my $tag = $vnet->{tag}; 105 | my $vlanaware = $vnet->{vlanaware}; 106 | 107 | #don't allow vlanaware change if subnets are defined 108 | if($vnet->{vlanaware}) { 109 | my $subnets = PVE::Network::SDN::Vnets::get_subnets($vnetid); 110 | raise_param_exc({ vlanaware => "vlanaware vnet is not compatible with subnets"}) if $subnets; 111 | } 112 | } 113 | 114 | 1; 115 | -------------------------------------------------------------------------------- /src/PVE/Network/SDN/Zones/FaucetPlugin.pm: -------------------------------------------------------------------------------- 1 | package PVE::Network::SDN::Zones::FaucetPlugin; 2 | 3 | use strict; 4 | use warnings; 5 | use PVE::Network::SDN::Zones::VlanPlugin; 6 | 7 | use base('PVE::Network::SDN::Zones::VlanPlugin'); 8 | 9 | sub type { 10 | return 'faucet'; 11 | } 12 | 13 | sub properties { 14 | return { 15 | 'dp-id' => { 16 | type => 'integer', 17 | description => 'Faucet dataplane id', 18 | }, 19 | }; 20 | } 21 | 22 | sub options { 23 | 24 | return { 25 | nodes => { optional => 1}, 26 | 'dp-id' => { optional => 0 }, 27 | # 'uplink-id' => { optional => 0 }, 28 | 'controller' => { optional => 0 }, 29 | dns => { optional => 1 }, 30 | reversedns => { optional => 1 }, 31 | dnszone => { optional => 1 }, 32 | ipam => { optional => 1 }, 33 | }; 34 | } 35 | 36 | # Plugin implementation 37 | sub generate_sdn_config { 38 | my ($class, $plugin_config, $zoneid, $vnetid, $vnet, $uplinks, $controller, $config) = @_; 39 | 40 | my $mtu = $vnet->{mtu}; 41 | my $uplink = $plugin_config->{'uplink-id'}; 42 | my $dpid = $plugin_config->{'dp-id'}; 43 | my $dphex = printf("%x",$dpid); #fixme :should be 16characters hex 44 | 45 | my $iface = $uplinks->{$uplink}->{name}; 46 | $iface = "uplink${uplink}" if !$iface; 47 | 48 | #tagged interface 49 | my @iface_config = (); 50 | push @iface_config, "ovs_type OVSPort"; 51 | push @iface_config, "ovs_bridge $zoneid"; 52 | push @iface_config, "ovs_mtu $mtu" if $mtu; 53 | push(@{$config->{$iface}}, @iface_config) if !$config->{$iface}; 54 | 55 | #vnet bridge 56 | @iface_config = (); 57 | push @iface_config, "ovs_port $iface"; 58 | push @iface_config, "ovs_type OVSBridge"; 59 | push @iface_config, "ovs_mtu $mtu" if $mtu; 60 | 61 | push @iface_config, "ovs_extra set bridge $zoneid other-config:datapath-id=$dphex"; 62 | push @iface_config, "ovs_extra set bridge $zoneid other-config:disable-in-band=true"; 63 | push @iface_config, "ovs_extra set bridge $zoneid fail_mode=secure"; 64 | push @iface_config, "ovs_extra set-controller $vnetid tcp:127.0.0.1:6653"; 65 | 66 | push(@{$config->{$zoneid}}, @iface_config) if !$config->{$zoneid}; 67 | 68 | return $config; 69 | } 70 | 71 | 72 | 1; 73 | 74 | 75 | -------------------------------------------------------------------------------- /src/PVE/Network/SDN/Zones/Makefile: -------------------------------------------------------------------------------- 1 | SOURCES=Plugin.pm VlanPlugin.pm VxlanPlugin.pm FaucetPlugin.pm EvpnPlugin.pm QinQPlugin.pm SimplePlugin.pm 2 | 3 | 4 | PERL5DIR=${DESTDIR}/usr/share/perl5 5 | 6 | .PHONY: install 7 | install: 8 | for i in ${SOURCES}; do install -D -m 0644 $$i ${PERL5DIR}/PVE/Network/SDN/Zones/$$i; done 9 | -------------------------------------------------------------------------------- /src/services/00-dnsmasq-after-networking.conf: -------------------------------------------------------------------------------- 1 | # dnsmasq@.service comes with 2 | # Requires=network.target 3 | # After=network.target 4 | # Only the After entry makes sense as `network.target` is a passive rule and 5 | # `Require`ing it means that dnsmasq is the "provider" of that unit. 6 | # See https://systemd.io/NETWORK_ONLINE 7 | # 8 | # Additionally, we want ifupdown to have completed its setup, to make sure 9 | # the 'interface=' directives can find the required interfaces at startup. 10 | [Unit] 11 | Requires= 12 | After=networking.service 13 | -------------------------------------------------------------------------------- /src/services/Makefile: -------------------------------------------------------------------------------- 1 | SERVICEDIR=$(DESTDIR)/lib/systemd/system 2 | 3 | all: 4 | @true 5 | 6 | .PHONY: install 7 | install: 8 | install -d $(SERVICEDIR) 9 | install -d $(SERVICEDIR)/dnsmasq@.service.d 10 | install -t $(SERVICEDIR)/dnsmasq@.service.d -m 0644 00-dnsmasq-after-networking.conf 11 | 12 | .PHONY: clean 13 | clean: 14 | @true 15 | -------------------------------------------------------------------------------- /src/test/Makefile: -------------------------------------------------------------------------------- 1 | all: test 2 | 3 | test: test_zones test_ipams test_dns test_subnets test_vnets_blackbox 4 | 5 | test_zones: run_test_zones.pl 6 | ./run_test_zones.pl 7 | 8 | test_ipams: run_test_ipams.pl 9 | ./run_test_ipams.pl 10 | 11 | test_dns: run_test_dns.pl 12 | ./run_test_dns.pl 13 | 14 | test_subnets: run_test_subnets.pl 15 | ./run_test_subnets.pl 16 | 17 | test_vnets_blackbox: run_test_vnets_blackbox.pl 18 | ./run_test_vnets_blackbox.pl 19 | 20 | clean: 21 | -------------------------------------------------------------------------------- /src/test/debug/generateconfig.pl: -------------------------------------------------------------------------------- 1 | use strict; 2 | use warnings; 3 | use File::Copy; 4 | use PVE::Cluster qw(cfs_read_file); 5 | 6 | use PVE::Network::SDN; 7 | use PVE::Network::SDN::Zones; 8 | use PVE::Network::SDN::Controllers; 9 | use Data::Dumper; 10 | 11 | PVE::Network::SDN::commit_config(); 12 | my $network_config = PVE::Network::SDN::Zones::generate_etc_network_config(); 13 | 14 | PVE::Network::SDN::Zones::write_etc_network_config($network_config); 15 | print "/etc/network/interfaces.d/sdn\n"; 16 | print $network_config; 17 | print "\n"; 18 | 19 | my $controller_config = PVE::Network::SDN::Controllers::generate_controller_config(); 20 | 21 | if ($controller_config) { 22 | print Dumper($controller_config); 23 | PVE::Network::SDN::Controllers::write_controller_config($controller_config); 24 | } 25 | -------------------------------------------------------------------------------- /src/test/debug/statuscheck.pl: -------------------------------------------------------------------------------- 1 | use strict; 2 | use warnings; 3 | use PVE::Network::SDN; 4 | use Data::Dumper; 5 | 6 | my ($transport_status, $vnet_status) = PVE::Network::SDN::status(); 7 | 8 | print Dumper($vnet_status); 9 | print Dumper($transport_status); 10 | -------------------------------------------------------------------------------- /src/test/dns/powerdns/dns_config: -------------------------------------------------------------------------------- 1 | { 2 | 'ids' => { 3 | 'powerdns' => { 4 | 'url' => 'http://localhost:8881/api/v1/servers/localhost', 5 | 'type' => 'powerdns', 6 | 'key' => '1234', 7 | 'ttl' => '3600' 8 | }, 9 | }, 10 | } 11 | -------------------------------------------------------------------------------- /src/test/dns/powerdns/expected.add_a_multiple_record.ipv4: -------------------------------------------------------------------------------- 1 | bless( { 2 | '_content' => '{"rrsets":[{"changetype":"REPLACE","name":"myhostname.domain.com.","records":[{"content":"127.0.0.1","disabled":false,"name":"myhostname.domain.com.","type":"A"},{"content":"10.0.0.1","disabled":false,"name":"myhostname.domain.com.","type":"A"}],"ttl":"3600","type":"A"}]}', 3 | '_headers' => bless( { 4 | '::std_case' => { 5 | 'x-api-key' => 'X-API-Key' 6 | }, 7 | 'content-type' => 'application/json; charset=UTF-8', 8 | 'x-api-key' => '1234' 9 | }, 'HTTP::Headers' ), 10 | '_max_body_size' => undef, 11 | '_method' => 'PATCH', 12 | '_uri' => bless( do{\(my $o = 'http://localhost:8881/api/v1/servers/localhost/zones/domain.com')}, 'URI::http' ) 13 | }, 'HTTP::Request' ); 14 | 15 | -------------------------------------------------------------------------------- /src/test/dns/powerdns/expected.add_a_multiple_record.ipv6: -------------------------------------------------------------------------------- 1 | bless( { 2 | '_content' => '{"rrsets":[{"changetype":"REPLACE","name":"myhostname.domain.com.","records":[{"content":"2001:4860:4860::8844","disabled":false,"name":"myhostname.domain.com.","type":"AAAA"},{"content":"2001:4860:4860::8888","disabled":false,"name":"myhostname.domain.com.","type":"AAAA"}],"ttl":"3600","type":"AAAA"}]}', 3 | '_headers' => bless( { 4 | '::std_case' => { 5 | 'x-api-key' => 'X-API-Key' 6 | }, 7 | 'content-type' => 'application/json; charset=UTF-8', 8 | 'x-api-key' => '1234' 9 | }, 'HTTP::Headers' ), 10 | '_max_body_size' => undef, 11 | '_method' => 'PATCH', 12 | '_uri' => bless( do{\(my $o = 'http://localhost:8881/api/v1/servers/localhost/zones/domain.com')}, 'URI::http' ) 13 | }, 'HTTP::Request' ); 14 | 15 | -------------------------------------------------------------------------------- /src/test/dns/powerdns/expected.add_a_record.ipv4: -------------------------------------------------------------------------------- 1 | bless( { 2 | '_content' => '{"rrsets":[{"changetype":"REPLACE","name":"myhostname.domain.com.","records":[{"content":"10.0.0.1","disabled":false,"name":"myhostname.domain.com.","type":"A"}],"ttl":"3600","type":"A"}]}', 3 | '_headers' => bless( { 4 | '::std_case' => { 5 | 'x-api-key' => 'X-API-Key' 6 | }, 7 | 'content-type' => 'application/json; charset=UTF-8', 8 | 'x-api-key' => '1234' 9 | }, 'HTTP::Headers' ), 10 | '_max_body_size' => undef, 11 | '_method' => 'PATCH', 12 | '_uri' => bless( do{\(my $o = 'http://localhost:8881/api/v1/servers/localhost/zones/domain.com')}, 'URI::http' ) 13 | }, 'HTTP::Request' ); 14 | -------------------------------------------------------------------------------- /src/test/dns/powerdns/expected.add_a_record.ipv6: -------------------------------------------------------------------------------- 1 | bless( { 2 | '_content' => '{"rrsets":[{"changetype":"REPLACE","name":"myhostname.domain.com.","records":[{"content":"2001:4860:4860::8888","disabled":false,"name":"myhostname.domain.com.","type":"AAAA"}],"ttl":"3600","type":"AAAA"}]}', 3 | '_headers' => bless( { 4 | '::std_case' => { 5 | 'x-api-key' => 'X-API-Key' 6 | }, 7 | 'content-type' => 'application/json; charset=UTF-8', 8 | 'x-api-key' => '1234' 9 | }, 'HTTP::Headers' ), 10 | '_max_body_size' => undef, 11 | '_method' => 'PATCH', 12 | '_uri' => bless( do{\(my $o = 'http://localhost:8881/api/v1/servers/localhost/zones/domain.com')}, 'URI::http' ) 13 | }, 'HTTP::Request' ); 14 | 15 | -------------------------------------------------------------------------------- /src/test/dns/powerdns/expected.add_ptr_record.ipv4: -------------------------------------------------------------------------------- 1 | bless( { 2 | '_content' => '{"rrsets":[{"changetype":"REPLACE","name":"1.0.0.10.in-addr.arpa.","records":[{"content":"myhostname.","disabled":false,"name":"1.0.0.10.in-addr.arpa.","type":"PTR"}],"ttl":"3600","type":"PTR"}]}', 3 | '_headers' => bless( { 4 | '::std_case' => { 5 | 'x-api-key' => 'X-API-Key' 6 | }, 7 | 'content-type' => 'application/json; charset=UTF-8', 8 | 'x-api-key' => '1234' 9 | }, 'HTTP::Headers' ), 10 | '_max_body_size' => undef, 11 | '_method' => 'PATCH', 12 | '_uri' => bless( do{\(my $o = 'http://localhost:8881/api/v1/servers/localhost/zones/domain.com')}, 'URI::http' ) 13 | }, 'HTTP::Request' ); 14 | 15 | -------------------------------------------------------------------------------- /src/test/dns/powerdns/expected.add_ptr_record.ipv6: -------------------------------------------------------------------------------- 1 | bless( { 2 | '_content' => '{"rrsets":[{"changetype":"REPLACE","name":"8.8.8.8.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.6.8.4.0.6.8.4.1.0.0.2.ip6.arpa.","records":[{"content":"myhostname.","disabled":false,"name":"8.8.8.8.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.6.8.4.0.6.8.4.1.0.0.2.ip6.arpa.","type":"PTR"}],"ttl":"3600","type":"PTR"}]}', 3 | '_headers' => bless( { 4 | '::std_case' => { 5 | 'x-api-key' => 'X-API-Key' 6 | }, 7 | 'content-type' => 'application/json; charset=UTF-8', 8 | 'x-api-key' => '1234' 9 | }, 'HTTP::Headers' ), 10 | '_max_body_size' => undef, 11 | '_method' => 'PATCH', 12 | '_uri' => bless( do{\(my $o = 'http://localhost:8881/api/v1/servers/localhost/zones/domain.com')}, 'URI::http' ) 13 | }, 'HTTP::Request' ); 14 | -------------------------------------------------------------------------------- /src/test/dns/powerdns/expected.del_a_multiple_record.ipv4: -------------------------------------------------------------------------------- 1 | bless( { 2 | '_content' => '{"rrsets":[{"changetype":"REPLACE","name":"myhostname.domain.com.","records":[{"content":"127.0.0.1","disabled":false,"name":"myhostname.domain.com.","type":"A"}],"ttl":"3600","type":"A"}]}', 3 | '_headers' => bless( { 4 | '::std_case' => { 5 | 'x-api-key' => 'X-API-Key' 6 | }, 7 | 'content-type' => 'application/json; charset=UTF-8', 8 | 'x-api-key' => '1234' 9 | }, 'HTTP::Headers' ), 10 | '_max_body_size' => undef, 11 | '_method' => 'PATCH', 12 | '_uri' => bless( do{\(my $o = 'http://localhost:8881/api/v1/servers/localhost/zones/domain.com')}, 'URI::http' ) 13 | }, 'HTTP::Request' ); 14 | 15 | -------------------------------------------------------------------------------- /src/test/dns/powerdns/expected.del_a_multiple_record.ipv6: -------------------------------------------------------------------------------- 1 | bless( { 2 | '_content' => '{"rrsets":[{"changetype":"REPLACE","name":"myhostname.domain.com.","records":[{"content":"2001:4860:4860::8844","disabled":false,"name":"myhostname.domain.com.","type":"AAAA"}],"ttl":"3600","type":"AAAA"}]}', 3 | '_headers' => bless( { 4 | '::std_case' => { 5 | 'x-api-key' => 'X-API-Key' 6 | }, 7 | 'content-type' => 'application/json; charset=UTF-8', 8 | 'x-api-key' => '1234' 9 | }, 'HTTP::Headers' ), 10 | '_max_body_size' => undef, 11 | '_method' => 'PATCH', 12 | '_uri' => bless( do{\(my $o = 'http://localhost:8881/api/v1/servers/localhost/zones/domain.com')}, 'URI::http' ) 13 | }, 'HTTP::Request' ); 14 | -------------------------------------------------------------------------------- /src/test/dns/powerdns/expected.del_a_record.ipv4: -------------------------------------------------------------------------------- 1 | bless( { 2 | '_content' => '{"rrsets":[{"changetype":"DELETE","name":"myhostname.domain.com.","records":[],"type":"A"}]}', 3 | '_headers' => bless( { 4 | '::std_case' => { 5 | 'x-api-key' => 'X-API-Key' 6 | }, 7 | 'content-type' => 'application/json; charset=UTF-8', 8 | 'x-api-key' => '1234' 9 | }, 'HTTP::Headers' ), 10 | '_max_body_size' => undef, 11 | '_method' => 'PATCH', 12 | '_uri' => bless( do{\(my $o = 'http://localhost:8881/api/v1/servers/localhost/zones/domain.com')}, 'URI::http' ) 13 | }, 'HTTP::Request' ); 14 | 15 | -------------------------------------------------------------------------------- /src/test/dns/powerdns/expected.del_a_record.ipv6: -------------------------------------------------------------------------------- 1 | bless( { 2 | '_content' => '{"rrsets":[{"changetype":"DELETE","name":"myhostname.domain.com.","records":[],"type":"AAAA"}]}', 3 | '_headers' => bless( { 4 | '::std_case' => { 5 | 'x-api-key' => 'X-API-Key' 6 | }, 7 | 'content-type' => 'application/json; charset=UTF-8', 8 | 'x-api-key' => '1234' 9 | }, 'HTTP::Headers' ), 10 | '_max_body_size' => undef, 11 | '_method' => 'PATCH', 12 | '_uri' => bless( do{\(my $o = 'http://localhost:8881/api/v1/servers/localhost/zones/domain.com')}, 'URI::http' ) 13 | }, 'HTTP::Request' ); 14 | -------------------------------------------------------------------------------- /src/test/dns/powerdns/expected.del_ptr_record.ipv4: -------------------------------------------------------------------------------- 1 | bless( { 2 | '_content' => '{"rrsets":[{"changetype":"DELETE","name":"1.0.0.10.in-addr.arpa.","records":[],"type":"PTR"}]}', 3 | '_headers' => bless( { 4 | '::std_case' => { 5 | 'x-api-key' => 'X-API-Key' 6 | }, 7 | 'content-type' => 'application/json; charset=UTF-8', 8 | 'x-api-key' => '1234' 9 | }, 'HTTP::Headers' ), 10 | '_max_body_size' => undef, 11 | '_method' => 'PATCH', 12 | '_uri' => bless( do{\(my $o = 'http://localhost:8881/api/v1/servers/localhost/zones/domain.com')}, 'URI::http' ) 13 | }, 'HTTP::Request' ); 14 | -------------------------------------------------------------------------------- /src/test/dns/powerdns/expected.del_ptr_record.ipv6: -------------------------------------------------------------------------------- 1 | bless( { 2 | '_content' => '{"rrsets":[{"changetype":"DELETE","name":"8.8.8.8.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.6.8.4.0.6.8.4.1.0.0.2.ip6.arpa.","records":[],"type":"PTR"}]}', 3 | '_headers' => bless( { 4 | '::std_case' => { 5 | 'x-api-key' => 'X-API-Key' 6 | }, 7 | 'content-type' => 'application/json; charset=UTF-8', 8 | 'x-api-key' => '1234' 9 | }, 'HTTP::Headers' ), 10 | '_max_body_size' => undef, 11 | '_method' => 'PATCH', 12 | '_uri' => bless( do{\(my $o = 'http://localhost:8881/api/v1/servers/localhost/zones/domain.com')}, 'URI::http' ) 13 | }, 'HTTP::Request' ); 14 | 15 | -------------------------------------------------------------------------------- /src/test/dns/powerdns/expected.verify_zone: -------------------------------------------------------------------------------- 1 | bless( { 2 | '_content' => '', 3 | '_headers' => bless( { 4 | '::std_case' => { 5 | 'x-api-key' => 'X-API-Key' 6 | }, 7 | 'content-type' => 'application/json; charset=UTF-8', 8 | 'x-api-key' => '1234' 9 | }, 'HTTP::Headers' ), 10 | '_max_body_size' => undef, 11 | '_method' => 'GET', 12 | '_uri' => bless( do{\(my $o = 'http://localhost:8881/api/v1/servers/localhost/zones/domain.com?rrsets=false')}, 'URI::http' ) 13 | }, 'HTTP::Request' ); 14 | -------------------------------------------------------------------------------- /src/test/dns/powerdns/sdn_config: -------------------------------------------------------------------------------- 1 | { 2 | version => 1, 3 | vnets => { 4 | ids => { 5 | myvnet => { type => "vnet", zone => "myzone" }, 6 | }, 7 | }, 8 | 9 | zones => { 10 | ids => { myzone => { ipam => "pve", type =>"simple", dns => "powerdns", reversedns => "powerdns", dnszone => "domain.com" } }, 11 | }, 12 | 13 | subnets => { 14 | ids => { 'myzone-10.0.0.0-24' => { 15 | 'type' => 'subnet', 16 | 'vnet' => 'myvnet', 17 | } 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/test/ipams/netbox/expected.add_ip: -------------------------------------------------------------------------------- 1 | bless( { 2 | '_content' => '{"address":"10.0.0.1/24","description":"gateway","dns_name":"myhostname"}', 3 | '_headers' => bless( { 4 | 'authorization' => 'token 0123456789abcdef0123456789abcdef01234567', 5 | 'content-type' => 'application/json; charset=UTF-8' 6 | }, 'HTTP::Headers' ), 7 | '_max_body_size' => undef, 8 | '_method' => 'POST', 9 | '_uri' => bless( do{\(my $o = 'http://localhost:8000/api/ipam/ip-addresses/')}, 'URI::http' ) 10 | }, 'HTTP::Request' ); 11 | -------------------------------------------------------------------------------- /src/test/ipams/netbox/expected.add_ip_notgateway: -------------------------------------------------------------------------------- 1 | bless( { 2 | '_content' => '{"address":"10.0.0.1/24","description":"mac:da:65:8f:18:9b:6f","dns_name":"myhostname"}', 3 | '_headers' => bless( { 4 | 'authorization' => 'token 0123456789abcdef0123456789abcdef01234567', 5 | 'content-type' => 'application/json; charset=UTF-8' 6 | }, 'HTTP::Headers' ), 7 | '_max_body_size' => undef, 8 | '_method' => 'POST', 9 | '_uri' => bless( do{\(my $o = 'http://localhost:8000/api/ipam/ip-addresses/')}, 'URI::http' ) 10 | }, 'HTTP::Request' ); 11 | -------------------------------------------------------------------------------- /src/test/ipams/netbox/expected.add_next_freeip: -------------------------------------------------------------------------------- 1 | bless( { 2 | '_content' => '{"description":"mac:da:65:8f:18:9b:6f","dns_name":"myhostname"}', 3 | '_headers' => bless( { 4 | 'authorization' => 'token 0123456789abcdef0123456789abcdef01234567', 5 | 'content-type' => 'application/json; charset=UTF-8' 6 | }, 'HTTP::Headers' ), 7 | '_max_body_size' => undef, 8 | '_method' => 'POST', 9 | '_uri' => bless( do{\(my $o = 'http://localhost:8000/api/ipam/prefixes/1/available-ips/')}, 'URI::http' ) 10 | }, 'HTTP::Request' ); 11 | -------------------------------------------------------------------------------- /src/test/ipams/netbox/expected.add_subnet: -------------------------------------------------------------------------------- 1 | bless( { 2 | '_content' => '{"prefix":"10.0.0.0/24"}', 3 | '_headers' => bless( { 4 | 'authorization' => 'token 0123456789abcdef0123456789abcdef01234567', 5 | 'content-type' => 'application/json; charset=UTF-8' 6 | }, 'HTTP::Headers' ), 7 | '_max_body_size' => undef, 8 | '_method' => 'POST', 9 | '_uri' => bless( do{\(my $o = 'http://localhost:8000/api/ipam/prefixes/')}, 'URI::http' ) 10 | }, 'HTTP::Request' ); 11 | -------------------------------------------------------------------------------- /src/test/ipams/netbox/expected.del_ip: -------------------------------------------------------------------------------- 1 | bless( { 2 | '_content' => '', 3 | '_headers' => bless( { 4 | 'authorization' => 'token 0123456789abcdef0123456789abcdef01234567', 5 | 'content-type' => 'application/json; charset=UTF-8' 6 | }, 'HTTP::Headers' ), 7 | '_max_body_size' => undef, 8 | '_method' => 'DELETE', 9 | '_uri' => bless( do{\(my $o = 'http://localhost:8000/api/ipam/ip-addresses/1/')}, 'URI::http' ) 10 | }, 'HTTP::Request' ); 11 | -------------------------------------------------------------------------------- /src/test/ipams/netbox/expected.del_subnet: -------------------------------------------------------------------------------- 1 | bless( { 2 | '_content' => '{"address":"192.168.0.1/24","description":null,"dns_name":"toto"}', 3 | '_headers' => bless( { 4 | 'authorization' => 'token 0123456789abcdef0123456789abcdef01234567', 5 | 'content-type' => 'application/json; charset=UTF-8' 6 | }, 'HTTP::Headers' ), 7 | '_max_body_size' => undef, 8 | '_method' => 'POST', 9 | '_uri' => bless( do{\(my $o = 'http://localhost:8000/api/ipam/ip-addresses/')}, 'URI::http' ) 10 | }, 'HTTP::Request' ); 11 | -------------------------------------------------------------------------------- /src/test/ipams/netbox/expected.update_ip: -------------------------------------------------------------------------------- 1 | bless( { 2 | '_content' => '{"address":"10.0.0.1/24","description":"gateway","dns_name":"myhostname"}', 3 | '_headers' => bless( { 4 | 'authorization' => 'token 0123456789abcdef0123456789abcdef01234567', 5 | 'content-type' => 'application/json; charset=UTF-8' 6 | }, 'HTTP::Headers' ), 7 | '_max_body_size' => undef, 8 | '_method' => 'PATCH', 9 | '_uri' => bless( do{\(my $o = 'http://localhost:8000/api/ipam/ip-addresses/1/')}, 'URI::http' ) 10 | }, 'HTTP::Request' ); 11 | -------------------------------------------------------------------------------- /src/test/ipams/netbox/ipam_config: -------------------------------------------------------------------------------- 1 | { 2 | 'ids' => { 3 | 'phpipam' => { 4 | 'url' => 'https://localhost/api/apiadmin', 5 | 'type' => 'phpipam', 6 | 'section' => 1, 7 | 'token' => 'JPHkPSLB4O_XL-GQz4qtEFmNpx-99Htw' 8 | }, 9 | 'pve' => { 10 | 'type' => 'pve' 11 | }, 12 | 'netbox' => { 13 | 'token' => '0123456789abcdef0123456789abcdef01234567', 14 | 'type' => 'netbox', 15 | 'url' => 'http://localhost:8000/api' 16 | } 17 | }, 18 | } 19 | -------------------------------------------------------------------------------- /src/test/ipams/netbox/sdn_config: -------------------------------------------------------------------------------- 1 | { 2 | version => 1, 3 | vnets => { 4 | ids => { 5 | myvnet => { type => "vnet", zone => "myzone" }, 6 | }, 7 | }, 8 | 9 | zones => { 10 | ids => { myzone => { ipam => "netbox" } }, 11 | }, 12 | 13 | subnets => { 14 | ids => { 'myzone-10.0.0.0-24' => { 15 | 'type' => 'subnet', 16 | 'vnet' => 'myvnet', 17 | } 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/test/ipams/phpipam/expected.add_ip: -------------------------------------------------------------------------------- 1 | bless( { 2 | '_content' => '{"description":"mydescription","hostname":"myhostname","ip":"10.0.0.1","is_gateway":1,"mac":"da:65:8f:18:9b:6f","subnetId":1}', 3 | '_headers' => bless( { 4 | '::std_case' => { 5 | 'token' => 'Token' 6 | }, 7 | 'content-type' => 'application/json; charset=UTF-8', 8 | 'token' => 'JPHkPSLB4O_XL-GQz4qtEFmNpx-99Htw' 9 | }, 'HTTP::Headers' ), 10 | '_max_body_size' => undef, 11 | '_method' => 'POST', 12 | '_uri' => bless( do{\(my $o = 'https://localhost/api/apiadmin/addresses/')}, 'URI::https' ) 13 | }, 'HTTP::Request' ); 14 | -------------------------------------------------------------------------------- /src/test/ipams/phpipam/expected.add_ip_notgateway: -------------------------------------------------------------------------------- 1 | bless( { 2 | '_content' => '{"description":"mydescription","hostname":"myhostname","ip":"10.0.0.1","mac":"da:65:8f:18:9b:6f","subnetId":1}', 3 | '_headers' => bless( { 4 | '::std_case' => { 5 | 'token' => 'Token' 6 | }, 7 | 'content-type' => 'application/json; charset=UTF-8', 8 | 'token' => 'JPHkPSLB4O_XL-GQz4qtEFmNpx-99Htw' 9 | }, 'HTTP::Headers' ), 10 | '_max_body_size' => undef, 11 | '_method' => 'POST', 12 | '_uri' => bless( do{\(my $o = 'https://localhost/api/apiadmin/addresses/')}, 'URI::https' ) 13 | }, 'HTTP::Request' ); 14 | -------------------------------------------------------------------------------- /src/test/ipams/phpipam/expected.add_next_freeip: -------------------------------------------------------------------------------- 1 | bless( { 2 | '_content' => '{"description":"mydescription","hostname":"myhostname","mac":"da:65:8f:18:9b:6f"}', 3 | '_headers' => bless( { 4 | '::std_case' => { 5 | 'token' => 'Token' 6 | }, 7 | 'content-type' => 'application/json; charset=UTF-8', 8 | 'token' => 'JPHkPSLB4O_XL-GQz4qtEFmNpx-99Htw' 9 | }, 'HTTP::Headers' ), 10 | '_max_body_size' => undef, 11 | '_method' => 'POST', 12 | '_uri' => bless( do{\(my $o = 'https://localhost/api/apiadmin/addresses/first_free/1/')}, 'URI::https' ) 13 | }, 'HTTP::Request' ); 14 | -------------------------------------------------------------------------------- /src/test/ipams/phpipam/expected.add_subnet: -------------------------------------------------------------------------------- 1 | bless( { 2 | '_content' => '{"mask":"24","sectionId":1,"subnet":"10.0.0.0"}', 3 | '_headers' => bless( { 4 | '::std_case' => { 5 | 'token' => 'Token' 6 | }, 7 | 'content-type' => 'application/json; charset=UTF-8', 8 | 'token' => 'JPHkPSLB4O_XL-GQz4qtEFmNpx-99Htw' 9 | }, 'HTTP::Headers' ), 10 | '_max_body_size' => undef, 11 | '_method' => 'POST', 12 | '_uri' => bless( do{\(my $o = 'https://localhost/api/apiadmin/subnets/')}, 'URI::https' ) 13 | }, 'HTTP::Request' ); 14 | -------------------------------------------------------------------------------- /src/test/ipams/phpipam/expected.del_ip: -------------------------------------------------------------------------------- 1 | bless( { 2 | '_content' => '', 3 | '_headers' => bless( { 4 | '::std_case' => { 5 | 'token' => 'Token' 6 | }, 7 | 'content-type' => 'application/json; charset=UTF-8', 8 | 'token' => 'JPHkPSLB4O_XL-GQz4qtEFmNpx-99Htw' 9 | }, 'HTTP::Headers' ), 10 | '_max_body_size' => undef, 11 | '_method' => 'DELETE', 12 | '_uri' => bless( do{\(my $o = 'https://localhost/api/apiadmin/addresses/1')}, 'URI::https' ) 13 | }, 'HTTP::Request' ); 14 | -------------------------------------------------------------------------------- /src/test/ipams/phpipam/expected.del_subnet: -------------------------------------------------------------------------------- 1 | bless( { 2 | '_content' => '{"description":null,"hostname":"toto","ip":"192.168.0.1","is_gateway":null,"subnetId":1}', 3 | '_headers' => bless( { 4 | '::std_case' => { 5 | 'token' => 'Token' 6 | }, 7 | 'content-type' => 'application/json; charset=UTF-8', 8 | 'token' => 'JPHkPSLB4O_XL-GQz4qtEFmNpx-99Htw' 9 | }, 'HTTP::Headers' ), 10 | '_max_body_size' => undef, 11 | '_method' => 'POST', 12 | '_uri' => bless( do{\(my $o = 'https://localhost/api/apiadmin/addresses/')}, 'URI::https' ) 13 | }, 'HTTP::Request' ); 14 | -------------------------------------------------------------------------------- /src/test/ipams/phpipam/expected.update_ip: -------------------------------------------------------------------------------- 1 | bless( { 2 | '_content' => '{"description":"mydescription","hostname":"myhostname","is_gateway":1,"mac":"da:65:8f:18:9b:6f"}', 3 | '_headers' => bless( { 4 | '::std_case' => { 5 | 'token' => 'Token' 6 | }, 7 | 'content-type' => 'application/json; charset=UTF-8', 8 | 'token' => 'JPHkPSLB4O_XL-GQz4qtEFmNpx-99Htw' 9 | }, 'HTTP::Headers' ), 10 | '_max_body_size' => undef, 11 | '_method' => 'PATCH', 12 | '_uri' => bless( do{\(my $o = 'https://localhost/api/apiadmin/addresses/1')}, 'URI::https' ) 13 | }, 'HTTP::Request' ); 14 | -------------------------------------------------------------------------------- /src/test/ipams/phpipam/ipam_config: -------------------------------------------------------------------------------- 1 | { 2 | 'ids' => { 3 | 'phpipam' => { 4 | 'url' => 'https://localhost/api/apiadmin', 5 | 'type' => 'phpipam', 6 | 'section' => 1, 7 | 'token' => 'JPHkPSLB4O_XL-GQz4qtEFmNpx-99Htw' 8 | }, 9 | 'pve' => { 10 | 'type' => 'pve' 11 | }, 12 | 'netbox' => { 13 | 'token' => '0123456789abcdef0123456789abcdef01234567', 14 | 'type' => 'netbox', 15 | 'url' => 'http://localhost:8000/api' 16 | } 17 | }, 18 | } 19 | -------------------------------------------------------------------------------- /src/test/ipams/phpipam/sdn_config: -------------------------------------------------------------------------------- 1 | { 2 | version => 1, 3 | vnets => { 4 | ids => { 5 | myvnet => { type => "vnet", zone => "myzone" }, 6 | }, 7 | }, 8 | 9 | zones => { 10 | ids => { myzone => { ipam => "phpipam" } }, 11 | }, 12 | 13 | subnets => { 14 | ids => { 'myzone-10.0.0.0-24' => { 15 | 'type' => 'subnet', 16 | 'vnet' => 'myvnet', 17 | } 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/test/subnets/ipv4/ipam_config: -------------------------------------------------------------------------------- 1 | { 2 | 'ids' => { 3 | 'phpipam' => { 4 | 'url' => 'https://localhost/api/apiadmin', 5 | 'type' => 'phpipam', 6 | 'section' => 1, 7 | 'token' => 'JPHkPSLB4O_XL-GQz4qtEFmNpx-99Htw' 8 | }, 9 | 'pve' => { 10 | 'type' => 'pve' 11 | }, 12 | 'netbox' => { 13 | 'token' => '0123456789abcdef0123456789abcdef01234567', 14 | 'type' => 'netbox', 15 | 'url' => 'http://localhost:8000/api' 16 | } 17 | }, 18 | } 19 | -------------------------------------------------------------------------------- /src/test/subnets/ipv4/sdn_config: -------------------------------------------------------------------------------- 1 | { 2 | version => 1, 3 | vnets => { 4 | ids => { 5 | myvnet => { type => "vnet", zone => "myzone" }, 6 | }, 7 | }, 8 | 9 | zones => { 10 | ids => { myzone => { ipam => "pve", type =>"simple" } }, 11 | }, 12 | 13 | subnets => { 14 | ids => { 'myzone-10.0.0.0-24' => { 15 | 'type' => 'subnet', 16 | 'vnet' => 'myvnet', 17 | } 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/test/subnets/ipv6/ipam_config: -------------------------------------------------------------------------------- 1 | { 2 | 'ids' => { 3 | 'phpipam' => { 4 | 'url' => 'https://localhost/api/apiadmin', 5 | 'type' => 'phpipam', 6 | 'section' => 1, 7 | 'token' => 'JPHkPSLB4O_XL-GQz4qtEFmNpx-99Htw' 8 | }, 9 | 'pve' => { 10 | 'type' => 'pve' 11 | }, 12 | 'netbox' => { 13 | 'token' => '0123456789abcdef0123456789abcdef01234567', 14 | 'type' => 'netbox', 15 | 'url' => 'http://localhost:8000/api' 16 | } 17 | }, 18 | } 19 | -------------------------------------------------------------------------------- /src/test/subnets/ipv6/sdn_config: -------------------------------------------------------------------------------- 1 | { 2 | version => 1, 3 | vnets => { 4 | ids => { 5 | myvnet => { type => "vnet", zone => "myzone" }, 6 | }, 7 | }, 8 | 9 | zones => { 10 | ids => { myzone => { ipam => "pve", type =>"simple" } }, 11 | }, 12 | 13 | subnets => { 14 | ids => { 'myzone-2a0a:1580:2000::-56' => { 15 | 'type' => 'subnet', 16 | 'vnet' => 'myvnet', 17 | } 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/test/subnets/noipam/ipam_config: -------------------------------------------------------------------------------- 1 | { 2 | 'ids' => { 3 | 'phpipam' => { 4 | 'url' => 'https://localhost/api/apiadmin', 5 | 'type' => 'phpipam', 6 | 'section' => 1, 7 | 'token' => 'JPHkPSLB4O_XL-GQz4qtEFmNpx-99Htw' 8 | }, 9 | 'pve' => { 10 | 'type' => 'pve' 11 | }, 12 | 'netbox' => { 13 | 'token' => '0123456789abcdef0123456789abcdef01234567', 14 | 'type' => 'netbox', 15 | 'url' => 'http://localhost:8000/api' 16 | } 17 | }, 18 | } 19 | -------------------------------------------------------------------------------- /src/test/subnets/noipam/sdn_config: -------------------------------------------------------------------------------- 1 | { 2 | version => 1, 3 | vnets => { 4 | ids => { 5 | myvnet => { type => "vnet", zone => "myzone" }, 6 | }, 7 | }, 8 | 9 | zones => { 10 | ids => { myzone => { type =>"simple" } }, 11 | }, 12 | 13 | subnets => { 14 | ids => { 'myzone-10.0.0.0-24' => { 15 | 'type' => 'subnet', 16 | 'vnet' => 'myvnet', 17 | } 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/test/vnets/ipv4/ipam.db: -------------------------------------------------------------------------------- 1 | { 2 | "zones" => { 3 | "myzone" => { 4 | "subnets" => { 5 | "192.168.0.0/30" => { 6 | "ips" =>{ 7 | } 8 | }, 9 | "192.168.1.0/30" => { 10 | "ips" =>{ 11 | } 12 | }, 13 | } 14 | } 15 | } 16 | } 17 | 18 | -------------------------------------------------------------------------------- /src/test/vnets/ipv4/ipam_config: -------------------------------------------------------------------------------- 1 | { 2 | 'ids' => { 3 | 'pve' => { 4 | 'type' => 'pve' 5 | }, 6 | }, 7 | } 8 | -------------------------------------------------------------------------------- /src/test/vnets/ipv4/sdn_config: -------------------------------------------------------------------------------- 1 | { 2 | version => 1, 3 | vnets => { 4 | ids => { 5 | myvnet => { type => "vnet", zone => "myzone" }, 6 | }, 7 | }, 8 | 9 | zones => { 10 | ids => { myzone => { ipam => "pve", type =>"simple" } }, 11 | }, 12 | 13 | subnets => { 14 | ids => { 15 | 'myzone-192.168.0.0-30' => { 16 | 'type' => 'subnet', 17 | 'vnet' => 'myvnet', 18 | }, 19 | 'myzone-192.168.1.0-30' => { 20 | 'type' => 'subnet', 21 | 'vnet' => 'myvnet', 22 | }, 23 | } 24 | 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/test/vnets/ipv4noipam/ipam.db: -------------------------------------------------------------------------------- 1 | { 2 | "zones" => { 3 | "myzone" => { 4 | "subnets" => { 5 | "192.168.0.0/30" => { 6 | "ips" =>{ 7 | } 8 | }, 9 | "192.168.1.0/30" => { 10 | "ips" =>{ 11 | } 12 | }, 13 | } 14 | } 15 | } 16 | } 17 | 18 | -------------------------------------------------------------------------------- /src/test/vnets/ipv4noipam/ipam_config: -------------------------------------------------------------------------------- 1 | { 2 | 'ids' => { 3 | 'pve' => { 4 | 'type' => 'pve' 5 | }, 6 | }, 7 | } 8 | -------------------------------------------------------------------------------- /src/test/vnets/ipv4noipam/sdn_config: -------------------------------------------------------------------------------- 1 | { 2 | version => 1, 3 | vnets => { 4 | ids => { 5 | myvnet => { type => "vnet", zone => "myzone" }, 6 | }, 7 | }, 8 | 9 | zones => { 10 | ids => { myzone => { type =>"simple" } }, 11 | }, 12 | 13 | subnets => { 14 | ids => { 15 | 'myzone-192.168.0.0-30' => { 16 | 'type' => 'subnet', 17 | 'vnet' => 'myvnet', 18 | }, 19 | 'myzone-192.168.1.0-30' => { 20 | 'type' => 'subnet', 21 | 'vnet' => 'myvnet', 22 | }, 23 | } 24 | 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/test/vnets/ipv6/ipam.db: -------------------------------------------------------------------------------- 1 | { 2 | "zones" => { 3 | "myzone" => { 4 | "subnets" => { 5 | "2001:db8:85a3::8a2e:370:7334/127" => { 6 | "ips" =>{ 7 | } 8 | }, 9 | "2001:db8:85a3::8a2e:371:7334/127" => { 10 | "ips" =>{ 11 | } 12 | }, 13 | } 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/test/vnets/ipv6/ipam_config: -------------------------------------------------------------------------------- 1 | { 2 | 'ids' => { 3 | 'pve' => { 4 | 'type' => 'pve' 5 | }, 6 | }, 7 | } 8 | -------------------------------------------------------------------------------- /src/test/vnets/ipv6/sdn_config: -------------------------------------------------------------------------------- 1 | { 2 | version => 1, 3 | vnets => { 4 | ids => { 5 | myvnet => { type => "vnet", zone => "myzone" }, 6 | }, 7 | }, 8 | 9 | zones => { 10 | ids => { myzone => { ipam => "pve", type =>"simple" } }, 11 | }, 12 | 13 | subnets => { 14 | ids => { 15 | 'myzone-2001:db8:85a3::8a2e:370:7334-127' => { 16 | 'type' => 'subnet', 17 | 'vnet' => 'myvnet', 18 | }, 19 | 'myzone-2001:db8:85a3::8a2e:371:7334-127' => { 20 | 'type' => 'subnet', 21 | 'vnet' => 'myvnet', 22 | }, 23 | } 24 | 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/test/zones/evpn/advertise_subnets/expected_controller_config: -------------------------------------------------------------------------------- 1 | frr version 8.5.2 2 | frr defaults datacenter 3 | hostname localhost 4 | log syslog informational 5 | service integrated-vtysh-config 6 | ! 7 | ! 8 | vrf vrf_myzone 9 | vni 1000 10 | exit-vrf 11 | ! 12 | router bgp 65000 13 | bgp router-id 192.168.0.1 14 | no bgp hard-administrative-reset 15 | no bgp default ipv4-unicast 16 | coalesce-time 1000 17 | no bgp graceful-restart notification 18 | neighbor VTEP peer-group 19 | neighbor VTEP remote-as 65000 20 | neighbor VTEP bfd 21 | neighbor 192.168.0.2 peer-group VTEP 22 | neighbor 192.168.0.3 peer-group VTEP 23 | ! 24 | address-family l2vpn evpn 25 | neighbor VTEP activate 26 | neighbor VTEP route-map MAP_VTEP_IN in 27 | neighbor VTEP route-map MAP_VTEP_OUT out 28 | advertise-all-vni 29 | exit-address-family 30 | exit 31 | ! 32 | router bgp 65000 vrf vrf_myzone 33 | bgp router-id 192.168.0.1 34 | no bgp hard-administrative-reset 35 | no bgp graceful-restart notification 36 | ! 37 | address-family ipv4 unicast 38 | redistribute connected 39 | exit-address-family 40 | ! 41 | address-family ipv6 unicast 42 | redistribute connected 43 | exit-address-family 44 | ! 45 | address-family l2vpn evpn 46 | advertise ipv4 unicast 47 | advertise ipv6 unicast 48 | exit-address-family 49 | exit 50 | ! 51 | route-map MAP_VTEP_IN permit 1 52 | exit 53 | ! 54 | route-map MAP_VTEP_OUT permit 1 55 | exit 56 | ! 57 | line vty 58 | ! -------------------------------------------------------------------------------- /src/test/zones/evpn/advertise_subnets/expected_sdn_interfaces: -------------------------------------------------------------------------------- 1 | #version:1 2 | 3 | auto myvnet 4 | iface myvnet 5 | address 10.0.0.1/24 6 | hwaddress A2:1D:CB:1A:C0:8B 7 | bridge_ports vxlan_myvnet 8 | bridge_stp off 9 | bridge_fd 0 10 | mtu 1450 11 | ip-forward on 12 | arp-accept on 13 | vrf vrf_myzone 14 | 15 | auto vrf_myzone 16 | iface vrf_myzone 17 | vrf-table auto 18 | post-up ip route add vrf vrf_myzone unreachable default metric 4278198272 19 | 20 | auto vrfbr_myzone 21 | iface vrfbr_myzone 22 | bridge-ports vrfvx_myzone 23 | bridge_stp off 24 | bridge_fd 0 25 | mtu 1450 26 | vrf vrf_myzone 27 | 28 | auto vrfvx_myzone 29 | iface vrfvx_myzone 30 | vxlan-id 1000 31 | vxlan-local-tunnelip 192.168.0.1 32 | bridge-learning off 33 | bridge-arp-nd-suppress on 34 | mtu 1450 35 | 36 | auto vxlan_myvnet 37 | iface vxlan_myvnet 38 | vxlan-id 100 39 | vxlan-local-tunnelip 192.168.0.1 40 | bridge-learning off 41 | bridge-arp-nd-suppress on 42 | mtu 1450 43 | -------------------------------------------------------------------------------- /src/test/zones/evpn/advertise_subnets/interfaces: -------------------------------------------------------------------------------- 1 | auto vmbr0 2 | iface vmbr0 inet static 3 | address 192.168.0.1/24 4 | gateway 192.168.0.254 5 | bridge-ports eth0 6 | bridge-stp off 7 | bridge-fd 0 8 | -------------------------------------------------------------------------------- /src/test/zones/evpn/advertise_subnets/sdn_config: -------------------------------------------------------------------------------- 1 | { 2 | version => 1, 3 | vnets => { 4 | ids => { 5 | myvnet => { tag => "100", type => "vnet", zone => "myzone" }, 6 | }, 7 | }, 8 | 9 | zones => { 10 | ids => { myzone => { ipam => "pve", type => "evpn", controller => "evpnctl", 'vrf-vxlan' => 1000, 'mac' => 'A2:1D:CB:1A:C0:8B', 'advertise-subnets' => 1 } }, 11 | }, 12 | controllers => { 13 | ids => { evpnctl => { type => "evpn", 'peers' => '192.168.0.1,192.168.0.2,192.168.0.3', asn => "65000" } }, 14 | }, 15 | 16 | subnets => { 17 | ids => { 'myzone-10.0.0.0-24' => { 18 | 'type' => 'subnet', 19 | 'vnet' => 'myvnet', 20 | 'gateway' => '10.0.0.1', 21 | } 22 | } 23 | } 24 | } 25 | 26 | 27 | -------------------------------------------------------------------------------- /src/test/zones/evpn/disable_arp_nd_suppression/expected_controller_config: -------------------------------------------------------------------------------- 1 | frr version 8.5.2 2 | frr defaults datacenter 3 | hostname localhost 4 | log syslog informational 5 | service integrated-vtysh-config 6 | ! 7 | ! 8 | vrf vrf_myzone 9 | vni 1000 10 | exit-vrf 11 | ! 12 | router bgp 65000 13 | bgp router-id 192.168.0.1 14 | no bgp hard-administrative-reset 15 | no bgp default ipv4-unicast 16 | coalesce-time 1000 17 | no bgp graceful-restart notification 18 | neighbor VTEP peer-group 19 | neighbor VTEP remote-as 65000 20 | neighbor VTEP bfd 21 | neighbor 192.168.0.2 peer-group VTEP 22 | neighbor 192.168.0.3 peer-group VTEP 23 | ! 24 | address-family l2vpn evpn 25 | neighbor VTEP activate 26 | neighbor VTEP route-map MAP_VTEP_IN in 27 | neighbor VTEP route-map MAP_VTEP_OUT out 28 | advertise-all-vni 29 | exit-address-family 30 | exit 31 | ! 32 | router bgp 65000 vrf vrf_myzone 33 | bgp router-id 192.168.0.1 34 | no bgp hard-administrative-reset 35 | no bgp graceful-restart notification 36 | exit 37 | ! 38 | route-map MAP_VTEP_IN permit 1 39 | exit 40 | ! 41 | route-map MAP_VTEP_OUT permit 1 42 | exit 43 | ! 44 | line vty 45 | ! -------------------------------------------------------------------------------- /src/test/zones/evpn/disable_arp_nd_suppression/expected_sdn_interfaces: -------------------------------------------------------------------------------- 1 | #version:1 2 | 3 | auto myvnet 4 | iface myvnet 5 | address 10.0.0.1/24 6 | hwaddress A2:1D:CB:1A:C0:8B 7 | bridge_ports vxlan_myvnet 8 | bridge_stp off 9 | bridge_fd 0 10 | mtu 1450 11 | ip-forward on 12 | arp-accept on 13 | vrf vrf_myzone 14 | 15 | auto vrf_myzone 16 | iface vrf_myzone 17 | vrf-table auto 18 | post-up ip route add vrf vrf_myzone unreachable default metric 4278198272 19 | 20 | auto vrfbr_myzone 21 | iface vrfbr_myzone 22 | bridge-ports vrfvx_myzone 23 | bridge_stp off 24 | bridge_fd 0 25 | mtu 1450 26 | vrf vrf_myzone 27 | 28 | auto vrfvx_myzone 29 | iface vrfvx_myzone 30 | vxlan-id 1000 31 | vxlan-local-tunnelip 192.168.0.1 32 | bridge-learning off 33 | mtu 1450 34 | 35 | auto vxlan_myvnet 36 | iface vxlan_myvnet 37 | vxlan-id 100 38 | vxlan-local-tunnelip 192.168.0.1 39 | bridge-learning off 40 | mtu 1450 41 | -------------------------------------------------------------------------------- /src/test/zones/evpn/disable_arp_nd_suppression/interfaces: -------------------------------------------------------------------------------- 1 | auto vmbr0 2 | iface vmbr0 inet static 3 | address 192.168.0.1/24 4 | gateway 192.168.0.254 5 | bridge-ports eth0 6 | bridge-stp off 7 | bridge-fd 0 8 | -------------------------------------------------------------------------------- /src/test/zones/evpn/disable_arp_nd_suppression/sdn_config: -------------------------------------------------------------------------------- 1 | { 2 | version => 1, 3 | vnets => { 4 | ids => { 5 | myvnet => { tag => "100", type => "vnet", zone => "myzone" }, 6 | }, 7 | }, 8 | 9 | zones => { 10 | ids => { myzone => { ipam => "pve", type => "evpn", controller => "evpnctl", 'vrf-vxlan' => 1000, 'mac' => 'A2:1D:CB:1A:C0:8B', 'disable-arp-nd-suppression' => 1 } }, 11 | }, 12 | controllers => { 13 | ids => { evpnctl => { type => "evpn", 'peers' => '192.168.0.1,192.168.0.2,192.168.0.3', asn => "65000" } }, 14 | }, 15 | 16 | subnets => { 17 | ids => { 'myzone-10.0.0.0-24' => { 18 | 'type' => 'subnet', 19 | 'vnet' => 'myvnet', 20 | 'gateway' => '10.0.0.1', 21 | } 22 | } 23 | } 24 | } 25 | 26 | 27 | -------------------------------------------------------------------------------- /src/test/zones/evpn/ebgp/expected_controller_config: -------------------------------------------------------------------------------- 1 | frr version 8.5.2 2 | frr defaults datacenter 3 | hostname localhost 4 | log syslog informational 5 | service integrated-vtysh-config 6 | ! 7 | ! 8 | vrf vrf_myzone 9 | vni 1000 10 | exit-vrf 11 | ! 12 | router bgp 65001 13 | bgp router-id 192.168.0.1 14 | no bgp hard-administrative-reset 15 | no bgp default ipv4-unicast 16 | coalesce-time 1000 17 | no bgp graceful-restart notification 18 | neighbor VTEP peer-group 19 | neighbor VTEP remote-as external 20 | neighbor VTEP bfd 21 | neighbor 192.168.0.2 peer-group VTEP 22 | neighbor 192.168.0.3 peer-group VTEP 23 | neighbor BGP peer-group 24 | neighbor BGP remote-as external 25 | neighbor BGP bfd 26 | neighbor BGP ebgp-multihop 3 27 | neighbor 192.168.0.252 peer-group BGP 28 | neighbor 192.168.0.253 peer-group BGP 29 | ! 30 | address-family ipv4 unicast 31 | neighbor BGP activate 32 | neighbor BGP soft-reconfiguration inbound 33 | exit-address-family 34 | ! 35 | address-family l2vpn evpn 36 | neighbor VTEP activate 37 | neighbor VTEP route-map MAP_VTEP_IN in 38 | neighbor VTEP route-map MAP_VTEP_OUT out 39 | advertise-all-vni 40 | autort as 65000 41 | exit-address-family 42 | exit 43 | ! 44 | router bgp 65001 vrf vrf_myzone 45 | bgp router-id 192.168.0.1 46 | no bgp hard-administrative-reset 47 | no bgp graceful-restart notification 48 | ! 49 | address-family l2vpn evpn 50 | route-target import 65000:1000 51 | route-target export 65000:1000 52 | exit-address-family 53 | exit 54 | ! 55 | route-map MAP_VTEP_IN permit 1 56 | exit 57 | ! 58 | route-map MAP_VTEP_OUT permit 1 59 | exit 60 | ! 61 | line vty 62 | ! -------------------------------------------------------------------------------- /src/test/zones/evpn/ebgp/expected_sdn_interfaces: -------------------------------------------------------------------------------- 1 | #version:1 2 | 3 | auto myvnet 4 | iface myvnet 5 | address 10.0.0.1/24 6 | bridge_ports vxlan_myvnet 7 | bridge_stp off 8 | bridge_fd 0 9 | mtu 1450 10 | ip-forward on 11 | arp-accept on 12 | vrf vrf_myzone 13 | 14 | auto vrf_myzone 15 | iface vrf_myzone 16 | vrf-table auto 17 | post-up ip route add vrf vrf_myzone unreachable default metric 4278198272 18 | 19 | auto vrfbr_myzone 20 | iface vrfbr_myzone 21 | bridge-ports vrfvx_myzone 22 | bridge_stp off 23 | bridge_fd 0 24 | mtu 1450 25 | vrf vrf_myzone 26 | 27 | auto vrfvx_myzone 28 | iface vrfvx_myzone 29 | vxlan-id 1000 30 | vxlan-local-tunnelip 192.168.0.1 31 | bridge-learning off 32 | bridge-arp-nd-suppress on 33 | mtu 1450 34 | 35 | auto vxlan_myvnet 36 | iface vxlan_myvnet 37 | vxlan-id 100 38 | vxlan-local-tunnelip 192.168.0.1 39 | bridge-learning off 40 | bridge-arp-nd-suppress on 41 | mtu 1450 42 | -------------------------------------------------------------------------------- /src/test/zones/evpn/ebgp/interfaces: -------------------------------------------------------------------------------- 1 | auto vmbr0 2 | iface vmbr0 inet static 3 | address 192.168.0.1/24 4 | gateway 192.168.0.254 5 | bridge-ports eth0 6 | bridge-stp off 7 | bridge-fd 0 8 | -------------------------------------------------------------------------------- /src/test/zones/evpn/ebgp/sdn_config: -------------------------------------------------------------------------------- 1 | { 2 | version => 1, 3 | vnets => { 4 | ids => { 5 | myvnet => { 6 | tag => "100", 7 | type => "vnet", 8 | zone => "myzone", 9 | }, 10 | }, 11 | }, 12 | 13 | zones => { 14 | ids => { 15 | myzone => { 16 | ipam => "pve", 17 | type => "evpn", 18 | controller => "evpnctl", 19 | 'vrf-vxlan' => 1000, 20 | }, 21 | }, 22 | }, 23 | controllers => { 24 | ids => { 25 | evpnctl => { 26 | type => "evpn", 27 | 'peers' => '192.168.0.1,192.168.0.2,192.168.0.3', 28 | asn => "65000", 29 | }, 30 | localhost => { 31 | type => "bgp", 32 | 'peers' => '192.168.0.252,192.168.0.253', 33 | ebgp => "1", 34 | 'ebgp-multihop' => '3', 35 | asn => "65001", 36 | node => "localhost", 37 | }, 38 | }, 39 | }, 40 | 41 | subnets => { 42 | ids => { 43 | 'myzone-10.0.0.0-24' => { 44 | 'type' => 'subnet', 45 | 'vnet' => 'myvnet', 46 | 'gateway' => '10.0.0.1', 47 | }, 48 | }, 49 | }, 50 | } 51 | -------------------------------------------------------------------------------- /src/test/zones/evpn/ebgp_loopback/expected_controller_config: -------------------------------------------------------------------------------- 1 | frr version 8.5.2 2 | frr defaults datacenter 3 | hostname localhost 4 | log syslog informational 5 | service integrated-vtysh-config 6 | ! 7 | ! 8 | vrf vrf_myzone 9 | vni 1000 10 | exit-vrf 11 | ! 12 | router bgp 65001 13 | bgp router-id 192.168.0.1 14 | no bgp hard-administrative-reset 15 | no bgp default ipv4-unicast 16 | coalesce-time 1000 17 | no bgp graceful-restart notification 18 | neighbor VTEP peer-group 19 | neighbor VTEP remote-as external 20 | neighbor VTEP bfd 21 | neighbor VTEP ebgp-multihop 10 22 | neighbor VTEP update-source dummy1 23 | neighbor 192.168.0.2 peer-group VTEP 24 | neighbor 192.168.0.3 peer-group VTEP 25 | bgp disable-ebgp-connected-route-check 26 | neighbor BGP peer-group 27 | neighbor BGP remote-as external 28 | neighbor BGP bfd 29 | neighbor 172.16.0.254 peer-group BGP 30 | neighbor 172.17.0.254 peer-group BGP 31 | ! 32 | address-family ipv4 unicast 33 | network 192.168.0.1/32 34 | neighbor BGP activate 35 | neighbor BGP soft-reconfiguration inbound 36 | exit-address-family 37 | ! 38 | address-family l2vpn evpn 39 | neighbor VTEP activate 40 | neighbor VTEP route-map MAP_VTEP_IN in 41 | neighbor VTEP route-map MAP_VTEP_OUT out 42 | advertise-all-vni 43 | autort as 65000 44 | exit-address-family 45 | exit 46 | ! 47 | router bgp 65001 vrf vrf_myzone 48 | bgp router-id 192.168.0.1 49 | no bgp hard-administrative-reset 50 | no bgp graceful-restart notification 51 | ! 52 | address-family l2vpn evpn 53 | route-target import 65000:1000 54 | route-target export 65000:1000 55 | exit-address-family 56 | exit 57 | ! 58 | ip prefix-list loopbacks_ips seq 10 permit 0.0.0.0/0 le 32 59 | ! 60 | route-map MAP_VTEP_IN permit 1 61 | exit 62 | ! 63 | route-map MAP_VTEP_OUT permit 1 64 | exit 65 | ! 66 | route-map correct_src permit 1 67 | match ip address prefix-list loopbacks_ips 68 | set src 192.168.0.1 69 | exit 70 | ! 71 | ip protocol bgp route-map correct_src 72 | ! 73 | line vty 74 | ! -------------------------------------------------------------------------------- /src/test/zones/evpn/ebgp_loopback/expected_sdn_interfaces: -------------------------------------------------------------------------------- 1 | #version:1 2 | 3 | auto myvnet 4 | iface myvnet 5 | address 10.0.0.1/24 6 | bridge_ports vxlan_myvnet 7 | bridge_stp off 8 | bridge_fd 0 9 | mtu 1450 10 | ip-forward on 11 | arp-accept on 12 | vrf vrf_myzone 13 | 14 | auto vrf_myzone 15 | iface vrf_myzone 16 | vrf-table auto 17 | post-up ip route add vrf vrf_myzone unreachable default metric 4278198272 18 | 19 | auto vrfbr_myzone 20 | iface vrfbr_myzone 21 | bridge-ports vrfvx_myzone 22 | bridge_stp off 23 | bridge_fd 0 24 | mtu 1450 25 | vrf vrf_myzone 26 | 27 | auto vrfvx_myzone 28 | iface vrfvx_myzone 29 | vxlan-id 1000 30 | vxlan-local-tunnelip 192.168.0.1 31 | bridge-learning off 32 | bridge-arp-nd-suppress on 33 | mtu 1450 34 | 35 | auto vxlan_myvnet 36 | iface vxlan_myvnet 37 | vxlan-id 100 38 | vxlan-local-tunnelip 192.168.0.1 39 | bridge-learning off 40 | bridge-arp-nd-suppress on 41 | mtu 1450 42 | -------------------------------------------------------------------------------- /src/test/zones/evpn/ebgp_loopback/interfaces: -------------------------------------------------------------------------------- 1 | auto eth0 2 | iface eth0 inet static 3 | address 172.16.0.1/24 4 | 5 | auto eth1 6 | iface eth1 inet static 7 | address 172.17.0.1/24 8 | 9 | auto dummy1 10 | iface dummy1 inet static 11 | address 192.168.0.1/32 12 | link-type dummy 13 | 14 | -------------------------------------------------------------------------------- /src/test/zones/evpn/ebgp_loopback/sdn_config: -------------------------------------------------------------------------------- 1 | { 2 | version => 1, 3 | vnets => { 4 | ids => { 5 | myvnet => { tag => "100", type => "vnet", zone => "myzone" }, 6 | }, 7 | }, 8 | 9 | zones => { 10 | ids => { myzone => { ipam => "pve", type => "evpn", controller => "evpnctl", 'vrf-vxlan' => 1000 } }, 11 | }, 12 | controllers => { 13 | ids => { 14 | evpnctl => { type => "evpn", 'peers' => '192.168.0.1,192.168.0.2,192.168.0.3', asn => "65000" }, 15 | localhost => { type => "bgp", 'peers' => '172.16.0.254,172.17.0.254', ebgp => "1", asn => "65001", loopback => 'dummy1', node => "localhost" }, 16 | }, 17 | }, 18 | 19 | subnets => { 20 | ids => { 'myzone-10.0.0.0-24' => { 21 | 'type' => 'subnet', 22 | 'vnet' => 'myvnet', 23 | 'gateway' => '10.0.0.1', 24 | } 25 | } 26 | } 27 | } 28 | 29 | 30 | -------------------------------------------------------------------------------- /src/test/zones/evpn/exitnode/expected_controller_config: -------------------------------------------------------------------------------- 1 | frr version 8.5.2 2 | frr defaults datacenter 3 | hostname localhost 4 | log syslog informational 5 | service integrated-vtysh-config 6 | ! 7 | ! 8 | vrf vrf_myzone 9 | vni 1000 10 | exit-vrf 11 | ! 12 | router bgp 65000 13 | bgp router-id 192.168.0.1 14 | no bgp hard-administrative-reset 15 | no bgp default ipv4-unicast 16 | coalesce-time 1000 17 | no bgp graceful-restart notification 18 | neighbor VTEP peer-group 19 | neighbor VTEP remote-as 65000 20 | neighbor VTEP bfd 21 | neighbor 192.168.0.2 peer-group VTEP 22 | neighbor 192.168.0.3 peer-group VTEP 23 | ! 24 | address-family ipv4 unicast 25 | import vrf vrf_myzone 26 | exit-address-family 27 | ! 28 | address-family ipv6 unicast 29 | import vrf vrf_myzone 30 | exit-address-family 31 | ! 32 | address-family l2vpn evpn 33 | neighbor VTEP activate 34 | neighbor VTEP route-map MAP_VTEP_IN in 35 | neighbor VTEP route-map MAP_VTEP_OUT out 36 | advertise-all-vni 37 | exit-address-family 38 | exit 39 | ! 40 | router bgp 65000 vrf vrf_myzone 41 | bgp router-id 192.168.0.1 42 | no bgp hard-administrative-reset 43 | no bgp graceful-restart notification 44 | ! 45 | address-family ipv4 unicast 46 | redistribute connected 47 | exit-address-family 48 | ! 49 | address-family ipv6 unicast 50 | redistribute connected 51 | exit-address-family 52 | ! 53 | address-family l2vpn evpn 54 | default-originate ipv4 55 | default-originate ipv6 56 | exit-address-family 57 | exit 58 | ! 59 | ip prefix-list only_default seq 1 permit 0.0.0.0/0 60 | ! 61 | ipv6 prefix-list only_default_v6 seq 1 permit ::/0 62 | ! 63 | route-map MAP_VTEP_IN deny 1 64 | match ip address prefix-list only_default 65 | exit 66 | ! 67 | route-map MAP_VTEP_IN deny 2 68 | match ipv6 address prefix-list only_default_v6 69 | exit 70 | ! 71 | route-map MAP_VTEP_IN permit 3 72 | exit 73 | ! 74 | route-map MAP_VTEP_OUT permit 1 75 | exit 76 | ! 77 | line vty 78 | ! -------------------------------------------------------------------------------- /src/test/zones/evpn/exitnode/expected_sdn_interfaces: -------------------------------------------------------------------------------- 1 | #version:1 2 | 3 | auto myvnet 4 | iface myvnet 5 | address 10.0.0.1/24 6 | bridge_ports vxlan_myvnet 7 | bridge_stp off 8 | bridge_fd 0 9 | mtu 1450 10 | ip-forward on 11 | arp-accept on 12 | vrf vrf_myzone 13 | 14 | auto vrf_myzone 15 | iface vrf_myzone 16 | vrf-table auto 17 | post-up ip route del vrf vrf_myzone unreachable default metric 4278198272 18 | 19 | auto vrfbr_myzone 20 | iface vrfbr_myzone 21 | bridge-ports vrfvx_myzone 22 | bridge_stp off 23 | bridge_fd 0 24 | mtu 1450 25 | vrf vrf_myzone 26 | 27 | auto vrfvx_myzone 28 | iface vrfvx_myzone 29 | vxlan-id 1000 30 | vxlan-local-tunnelip 192.168.0.1 31 | bridge-learning off 32 | bridge-arp-nd-suppress on 33 | mtu 1450 34 | 35 | auto vxlan_myvnet 36 | iface vxlan_myvnet 37 | vxlan-id 100 38 | vxlan-local-tunnelip 192.168.0.1 39 | bridge-learning off 40 | bridge-arp-nd-suppress on 41 | mtu 1450 42 | -------------------------------------------------------------------------------- /src/test/zones/evpn/exitnode/interfaces: -------------------------------------------------------------------------------- 1 | auto vmbr0 2 | iface vmbr0 inet static 3 | address 192.168.0.1/24 4 | gateway 192.168.0.254 5 | bridge-ports eth0 6 | bridge-stp off 7 | bridge-fd 0 8 | -------------------------------------------------------------------------------- /src/test/zones/evpn/exitnode/sdn_config: -------------------------------------------------------------------------------- 1 | { 2 | version => 1, 3 | vnets => { 4 | ids => { 5 | myvnet => { tag => "100", type => "vnet", zone => "myzone" }, 6 | }, 7 | }, 8 | 9 | zones => { 10 | ids => { myzone => { ipam => "pve", type => "evpn", controller => "evpnctl", 'vrf-vxlan' => 1000, exitnodes => { 'localhost' => 1 } } }, 11 | }, 12 | controllers => { 13 | ids => { evpnctl => { type => "evpn", 'peers' => '192.168.0.1,192.168.0.2,192.168.0.3', asn => "65000" } }, 14 | }, 15 | 16 | subnets => { 17 | ids => { 'myzone-10.0.0.0-24' => { 18 | 'type' => 'subnet', 19 | 'vnet' => 'myvnet', 20 | 'gateway' => '10.0.0.1', 21 | } 22 | } 23 | } 24 | } 25 | 26 | 27 | -------------------------------------------------------------------------------- /src/test/zones/evpn/exitnode_local_routing/expected_controller_config: -------------------------------------------------------------------------------- 1 | frr version 8.5.2 2 | frr defaults datacenter 3 | hostname localhost 4 | log syslog informational 5 | service integrated-vtysh-config 6 | ! 7 | ! 8 | vrf vrf_myzone 9 | vni 1000 10 | exit-vrf 11 | ! 12 | router bgp 65000 13 | bgp router-id 192.168.0.1 14 | no bgp hard-administrative-reset 15 | no bgp default ipv4-unicast 16 | coalesce-time 1000 17 | no bgp graceful-restart notification 18 | neighbor VTEP peer-group 19 | neighbor VTEP remote-as 65000 20 | neighbor VTEP bfd 21 | neighbor 192.168.0.2 peer-group VTEP 22 | neighbor 192.168.0.3 peer-group VTEP 23 | ! 24 | address-family l2vpn evpn 25 | neighbor VTEP activate 26 | neighbor VTEP route-map MAP_VTEP_IN in 27 | neighbor VTEP route-map MAP_VTEP_OUT out 28 | advertise-all-vni 29 | exit-address-family 30 | exit 31 | ! 32 | router bgp 65000 vrf vrf_myzone 33 | bgp router-id 192.168.0.1 34 | no bgp hard-administrative-reset 35 | no bgp graceful-restart notification 36 | ! 37 | address-family l2vpn evpn 38 | default-originate ipv4 39 | default-originate ipv6 40 | exit-address-family 41 | exit 42 | ! 43 | ip prefix-list only_default seq 1 permit 0.0.0.0/0 44 | ! 45 | ipv6 prefix-list only_default_v6 seq 1 permit ::/0 46 | ! 47 | route-map MAP_VTEP_IN deny 1 48 | match ip address prefix-list only_default 49 | exit 50 | ! 51 | route-map MAP_VTEP_IN deny 2 52 | match ipv6 address prefix-list only_default_v6 53 | exit 54 | ! 55 | route-map MAP_VTEP_IN permit 3 56 | exit 57 | ! 58 | route-map MAP_VTEP_OUT permit 1 59 | exit 60 | ! 61 | ip route 10.0.0.0/24 10.255.255.2 xvrf_myzone 62 | ! 63 | line vty 64 | ! -------------------------------------------------------------------------------- /src/test/zones/evpn/exitnode_local_routing/expected_sdn_interfaces: -------------------------------------------------------------------------------- 1 | #version:1 2 | 3 | auto myvnet 4 | iface myvnet 5 | address 10.0.0.1/24 6 | bridge_ports vxlan_myvnet 7 | bridge_stp off 8 | bridge_fd 0 9 | mtu 1450 10 | ip-forward on 11 | arp-accept on 12 | vrf vrf_myzone 13 | 14 | auto vrf_myzone 15 | iface vrf_myzone 16 | vrf-table auto 17 | post-up ip route del vrf vrf_myzone unreachable default metric 4278198272 18 | 19 | auto vrfbr_myzone 20 | iface vrfbr_myzone 21 | bridge-ports vrfvx_myzone 22 | bridge_stp off 23 | bridge_fd 0 24 | mtu 1450 25 | vrf vrf_myzone 26 | 27 | auto vrfvx_myzone 28 | iface vrfvx_myzone 29 | vxlan-id 1000 30 | vxlan-local-tunnelip 192.168.0.1 31 | bridge-learning off 32 | bridge-arp-nd-suppress on 33 | mtu 1450 34 | 35 | auto vxlan_myvnet 36 | iface vxlan_myvnet 37 | vxlan-id 100 38 | vxlan-local-tunnelip 192.168.0.1 39 | bridge-learning off 40 | bridge-arp-nd-suppress on 41 | mtu 1450 42 | 43 | auto xvrf_myzone 44 | iface xvrf_myzone 45 | link-type veth 46 | address 10.255.255.1/30 47 | veth-peer-name xvrfp_myzone 48 | mtu 1500 49 | 50 | auto xvrfp_myzone 51 | iface xvrfp_myzone 52 | link-type veth 53 | address 10.255.255.2/30 54 | veth-peer-name xvrf_myzone 55 | vrf vrf_myzone 56 | mtu 1500 57 | -------------------------------------------------------------------------------- /src/test/zones/evpn/exitnode_local_routing/interfaces: -------------------------------------------------------------------------------- 1 | auto vmbr0 2 | iface vmbr0 inet static 3 | address 192.168.0.1/24 4 | gateway 192.168.0.254 5 | bridge-ports eth0 6 | bridge-stp off 7 | bridge-fd 0 8 | -------------------------------------------------------------------------------- /src/test/zones/evpn/exitnode_local_routing/sdn_config: -------------------------------------------------------------------------------- 1 | { 2 | version => 1, 3 | vnets => { 4 | ids => { 5 | myvnet => { tag => "100", type => "vnet", zone => "myzone" }, 6 | }, 7 | }, 8 | 9 | zones => { 10 | ids => { myzone => { ipam => "pve", type => "evpn", controller => "evpnctl", 'vrf-vxlan' => 1000, exitnodes => { 'localhost' => 1 }, 'exitnodes-local-routing' => 1 }, 11 | }, 12 | }, 13 | controllers => { 14 | ids => { evpnctl => { type => "evpn", 'peers' => '192.168.0.1,192.168.0.2,192.168.0.3', asn => "65000" } }, 15 | }, 16 | 17 | subnets => { 18 | ids => { 'myzone-10.0.0.0-24' => { 19 | 'type' => 'subnet', 20 | 'vnet' => 'myvnet', 21 | 'gateway' => '10.0.0.1', 22 | }, 23 | } 24 | } 25 | } 26 | 27 | 28 | -------------------------------------------------------------------------------- /src/test/zones/evpn/exitnode_primary/expected_controller_config: -------------------------------------------------------------------------------- 1 | frr version 8.5.2 2 | frr defaults datacenter 3 | hostname localhost 4 | log syslog informational 5 | service integrated-vtysh-config 6 | ! 7 | ! 8 | vrf vrf_myzone 9 | vni 1000 10 | exit-vrf 11 | ! 12 | router bgp 65000 13 | bgp router-id 192.168.0.1 14 | no bgp hard-administrative-reset 15 | no bgp default ipv4-unicast 16 | coalesce-time 1000 17 | no bgp graceful-restart notification 18 | neighbor VTEP peer-group 19 | neighbor VTEP remote-as 65000 20 | neighbor VTEP bfd 21 | neighbor 192.168.0.2 peer-group VTEP 22 | neighbor 192.168.0.3 peer-group VTEP 23 | ! 24 | address-family ipv4 unicast 25 | import vrf vrf_myzone 26 | exit-address-family 27 | ! 28 | address-family ipv6 unicast 29 | import vrf vrf_myzone 30 | exit-address-family 31 | ! 32 | address-family l2vpn evpn 33 | neighbor VTEP activate 34 | neighbor VTEP route-map MAP_VTEP_IN in 35 | neighbor VTEP route-map MAP_VTEP_OUT out 36 | advertise-all-vni 37 | exit-address-family 38 | exit 39 | ! 40 | router bgp 65000 vrf vrf_myzone 41 | bgp router-id 192.168.0.1 42 | no bgp hard-administrative-reset 43 | no bgp graceful-restart notification 44 | ! 45 | address-family ipv4 unicast 46 | redistribute connected 47 | exit-address-family 48 | ! 49 | address-family ipv6 unicast 50 | redistribute connected 51 | exit-address-family 52 | ! 53 | address-family l2vpn evpn 54 | default-originate ipv4 55 | default-originate ipv6 56 | exit-address-family 57 | exit 58 | ! 59 | ip prefix-list only_default seq 1 permit 0.0.0.0/0 60 | ! 61 | ipv6 prefix-list only_default_v6 seq 1 permit ::/0 62 | ! 63 | route-map MAP_VTEP_IN permit 1 64 | exit 65 | ! 66 | route-map MAP_VTEP_OUT permit 1 67 | match ip address prefix-list only_default 68 | set metric 200 69 | exit 70 | ! 71 | route-map MAP_VTEP_OUT permit 2 72 | match ipv6 address prefix-list only_default_v6 73 | set metric 200 74 | exit 75 | ! 76 | route-map MAP_VTEP_OUT permit 3 77 | exit 78 | ! 79 | line vty 80 | ! -------------------------------------------------------------------------------- /src/test/zones/evpn/exitnode_primary/expected_sdn_interfaces: -------------------------------------------------------------------------------- 1 | #version:1 2 | 3 | auto myvnet 4 | iface myvnet 5 | address 10.0.0.1/24 6 | bridge_ports vxlan_myvnet 7 | bridge_stp off 8 | bridge_fd 0 9 | mtu 1450 10 | ip-forward on 11 | arp-accept on 12 | vrf vrf_myzone 13 | 14 | auto vrf_myzone 15 | iface vrf_myzone 16 | vrf-table auto 17 | post-up ip route del vrf vrf_myzone unreachable default metric 4278198272 18 | 19 | auto vrfbr_myzone 20 | iface vrfbr_myzone 21 | bridge-ports vrfvx_myzone 22 | bridge_stp off 23 | bridge_fd 0 24 | mtu 1450 25 | vrf vrf_myzone 26 | 27 | auto vrfvx_myzone 28 | iface vrfvx_myzone 29 | vxlan-id 1000 30 | vxlan-local-tunnelip 192.168.0.1 31 | bridge-learning off 32 | bridge-arp-nd-suppress on 33 | mtu 1450 34 | 35 | auto vxlan_myvnet 36 | iface vxlan_myvnet 37 | vxlan-id 100 38 | vxlan-local-tunnelip 192.168.0.1 39 | bridge-learning off 40 | bridge-arp-nd-suppress on 41 | mtu 1450 42 | -------------------------------------------------------------------------------- /src/test/zones/evpn/exitnode_primary/interfaces: -------------------------------------------------------------------------------- 1 | auto vmbr0 2 | iface vmbr0 inet static 3 | address 192.168.0.1/24 4 | gateway 192.168.0.254 5 | bridge-ports eth0 6 | bridge-stp off 7 | bridge-fd 0 8 | -------------------------------------------------------------------------------- /src/test/zones/evpn/exitnode_primary/sdn_config: -------------------------------------------------------------------------------- 1 | { 2 | version => 1, 3 | vnets => { 4 | ids => { 5 | myvnet => { tag => "100", type => "vnet", zone => "myzone" }, 6 | }, 7 | }, 8 | 9 | zones => { 10 | ids => { myzone => { ipam => "pve", type => "evpn", controller => "evpnctl", 'vrf-vxlan' => 1000, 'exitnodes-primary' => "othernode", exitnodes => { 'localhost' => 1 } } }, 11 | }, 12 | controllers => { 13 | ids => { evpnctl => { type => "evpn", 'peers' => '192.168.0.1,192.168.0.2,192.168.0.3', asn => "65000" } }, 14 | }, 15 | 16 | subnets => { 17 | ids => { 'myzone-10.0.0.0-24' => { 18 | 'type' => 'subnet', 19 | 'vnet' => 'myvnet', 20 | 'gateway' => '10.0.0.1', 21 | } 22 | } 23 | } 24 | } 25 | 26 | 27 | -------------------------------------------------------------------------------- /src/test/zones/evpn/exitnode_snat/expected_controller_config: -------------------------------------------------------------------------------- 1 | frr version 8.5.2 2 | frr defaults datacenter 3 | hostname localhost 4 | log syslog informational 5 | service integrated-vtysh-config 6 | ! 7 | ! 8 | vrf vrf_myzone 9 | vni 1000 10 | exit-vrf 11 | ! 12 | router bgp 65000 13 | bgp router-id 192.168.0.1 14 | no bgp hard-administrative-reset 15 | no bgp default ipv4-unicast 16 | coalesce-time 1000 17 | no bgp graceful-restart notification 18 | neighbor VTEP peer-group 19 | neighbor VTEP remote-as 65000 20 | neighbor VTEP bfd 21 | neighbor 192.168.0.2 peer-group VTEP 22 | neighbor 192.168.0.3 peer-group VTEP 23 | ! 24 | address-family ipv4 unicast 25 | import vrf vrf_myzone 26 | exit-address-family 27 | ! 28 | address-family ipv6 unicast 29 | import vrf vrf_myzone 30 | exit-address-family 31 | ! 32 | address-family l2vpn evpn 33 | neighbor VTEP activate 34 | neighbor VTEP route-map MAP_VTEP_IN in 35 | neighbor VTEP route-map MAP_VTEP_OUT out 36 | advertise-all-vni 37 | exit-address-family 38 | exit 39 | ! 40 | router bgp 65000 vrf vrf_myzone 41 | bgp router-id 192.168.0.1 42 | no bgp hard-administrative-reset 43 | no bgp graceful-restart notification 44 | ! 45 | address-family ipv4 unicast 46 | redistribute connected 47 | exit-address-family 48 | ! 49 | address-family ipv6 unicast 50 | redistribute connected 51 | exit-address-family 52 | ! 53 | address-family l2vpn evpn 54 | default-originate ipv4 55 | default-originate ipv6 56 | exit-address-family 57 | exit 58 | ! 59 | ip prefix-list only_default seq 1 permit 0.0.0.0/0 60 | ! 61 | ipv6 prefix-list only_default_v6 seq 1 permit ::/0 62 | ! 63 | route-map MAP_VTEP_IN deny 1 64 | match ip address prefix-list only_default 65 | exit 66 | ! 67 | route-map MAP_VTEP_IN deny 2 68 | match ipv6 address prefix-list only_default_v6 69 | exit 70 | ! 71 | route-map MAP_VTEP_IN permit 3 72 | exit 73 | ! 74 | route-map MAP_VTEP_OUT permit 1 75 | exit 76 | ! 77 | line vty 78 | ! -------------------------------------------------------------------------------- /src/test/zones/evpn/exitnode_snat/expected_sdn_interfaces: -------------------------------------------------------------------------------- 1 | #version:1 2 | 3 | auto myvnet 4 | iface myvnet 5 | address 10.0.0.1/24 6 | post-up iptables -t nat -A POSTROUTING -s '10.0.0.0/24' -o vmbr0 -j SNAT --to-source 192.168.0.1 7 | post-down iptables -t nat -D POSTROUTING -s '10.0.0.0/24' -o vmbr0 -j SNAT --to-source 192.168.0.1 8 | post-up iptables -t raw -I PREROUTING -i fwbr+ -j CT --zone 1 9 | post-down iptables -t raw -D PREROUTING -i fwbr+ -j CT --zone 1 10 | bridge_ports vxlan_myvnet 11 | bridge_stp off 12 | bridge_fd 0 13 | mtu 1450 14 | ip-forward on 15 | arp-accept on 16 | vrf vrf_myzone 17 | 18 | auto myvnet2 19 | iface myvnet2 20 | address 2a08:2142:302:3::1/64 21 | post-up ip6tables -t nat -A POSTROUTING -s '2a08:2142:302:3::/64' -o vmbr0 -j SNAT --to-source 192.168.0.1 22 | post-down ip6tables -t nat -D POSTROUTING -s '2a08:2142:302:3::/64' -o vmbr0 -j SNAT --to-source 192.168.0.1 23 | post-up ip6tables -t raw -I PREROUTING -i fwbr+ -j CT --zone 1 24 | post-down ip6tables -t raw -D PREROUTING -i fwbr+ -j CT --zone 1 25 | bridge_ports vxlan_myvnet2 26 | bridge_stp off 27 | bridge_fd 0 28 | mtu 1450 29 | ip6-forward on 30 | arp-accept on 31 | vrf vrf_myzone 32 | 33 | auto vrf_myzone 34 | iface vrf_myzone 35 | vrf-table auto 36 | post-up ip route del vrf vrf_myzone unreachable default metric 4278198272 37 | 38 | auto vrfbr_myzone 39 | iface vrfbr_myzone 40 | bridge-ports vrfvx_myzone 41 | bridge_stp off 42 | bridge_fd 0 43 | mtu 1450 44 | vrf vrf_myzone 45 | 46 | auto vrfvx_myzone 47 | iface vrfvx_myzone 48 | vxlan-id 1000 49 | vxlan-local-tunnelip 192.168.0.1 50 | bridge-learning off 51 | bridge-arp-nd-suppress on 52 | mtu 1450 53 | 54 | auto vxlan_myvnet 55 | iface vxlan_myvnet 56 | vxlan-id 100 57 | vxlan-local-tunnelip 192.168.0.1 58 | bridge-learning off 59 | bridge-arp-nd-suppress on 60 | mtu 1450 61 | 62 | auto vxlan_myvnet2 63 | iface vxlan_myvnet2 64 | vxlan-id 200 65 | vxlan-local-tunnelip 192.168.0.1 66 | bridge-learning off 67 | bridge-arp-nd-suppress on 68 | mtu 1450 69 | -------------------------------------------------------------------------------- /src/test/zones/evpn/exitnode_snat/interfaces: -------------------------------------------------------------------------------- 1 | auto vmbr0 2 | iface vmbr0 inet static 3 | address 192.168.0.1/24 4 | gateway 192.168.0.254 5 | bridge-ports eth0 6 | bridge-stp off 7 | bridge-fd 0 8 | -------------------------------------------------------------------------------- /src/test/zones/evpn/exitnode_snat/sdn_config: -------------------------------------------------------------------------------- 1 | { 2 | version => 1, 3 | vnets => { 4 | ids => { 5 | myvnet => { tag => "100", type => "vnet", zone => "myzone" }, 6 | myvnet2 => { tag => "200", type => "vnet", zone => "myzone" }, 7 | }, 8 | }, 9 | 10 | zones => { 11 | ids => { myzone => { ipam => "pve", type => "evpn", controller => "evpnctl", 'vrf-vxlan' => 1000, exitnodes => { 'localhost' => 1 } } }, 12 | }, 13 | controllers => { 14 | ids => { evpnctl => { type => "evpn", 'peers' => '192.168.0.1,192.168.0.2,192.168.0.3', asn => "65000" } }, 15 | }, 16 | 17 | subnets => { 18 | ids => { 19 | 'myzone-10.0.0.0-24' => { 20 | 'type' => 'subnet', 21 | 'vnet' => 'myvnet', 22 | 'gateway' => '10.0.0.1', 23 | 'snat' => 1 24 | }, 25 | 'myzone-2a08:2142:302:3::-64' => { 26 | 'type' => 'subnet', 27 | 'vnet' => 'myvnet2', 28 | 'gateway' => '2a08:2142:302:3::1', 29 | 'snat' => 1 30 | } 31 | } 32 | } 33 | } 34 | 35 | 36 | -------------------------------------------------------------------------------- /src/test/zones/evpn/exitnodenullroute/expected_controller_config: -------------------------------------------------------------------------------- 1 | frr version 8.5.2 2 | frr defaults datacenter 3 | hostname localhost 4 | log syslog informational 5 | service integrated-vtysh-config 6 | ! 7 | ! 8 | vrf vrf_myzone 9 | vni 1000 10 | ip route 10.0.0.0/24 null0 11 | ip route 172.16.0.0/24 null0 12 | ip route 172.16.1.0/24 null0 13 | ip route 172.16.3.0/24 null0 14 | exit-vrf 15 | ! 16 | vrf vrf_myzone2 17 | vni 1001 18 | ip route 10.0.0.0/24 null0 19 | ip route 192.168.0.1/24 null0 20 | ip route 192.168.10.1/24 null0 21 | ipv6 route 2b0f:1480::/64 null0 22 | ipv6 route 2b0f:1480:4000:6000::/64 null0 23 | ipv6 route 2b0f:1480:4000:8000::/64 null0 24 | exit-vrf 25 | ! 26 | router bgp 65000 27 | bgp router-id 192.168.0.1 28 | no bgp hard-administrative-reset 29 | no bgp default ipv4-unicast 30 | coalesce-time 1000 31 | no bgp graceful-restart notification 32 | neighbor VTEP peer-group 33 | neighbor VTEP remote-as 65000 34 | neighbor VTEP bfd 35 | neighbor 192.168.0.2 peer-group VTEP 36 | neighbor 192.168.0.3 peer-group VTEP 37 | ! 38 | address-family ipv4 unicast 39 | import vrf vrf_myzone 40 | import vrf vrf_myzone2 41 | exit-address-family 42 | ! 43 | address-family ipv6 unicast 44 | import vrf vrf_myzone 45 | import vrf vrf_myzone2 46 | exit-address-family 47 | ! 48 | address-family l2vpn evpn 49 | neighbor VTEP activate 50 | neighbor VTEP route-map MAP_VTEP_IN in 51 | neighbor VTEP route-map MAP_VTEP_OUT out 52 | advertise-all-vni 53 | exit-address-family 54 | exit 55 | ! 56 | router bgp 65000 vrf vrf_myzone 57 | bgp router-id 192.168.0.1 58 | no bgp hard-administrative-reset 59 | no bgp graceful-restart notification 60 | ! 61 | address-family ipv4 unicast 62 | redistribute connected 63 | exit-address-family 64 | ! 65 | address-family ipv6 unicast 66 | redistribute connected 67 | exit-address-family 68 | ! 69 | address-family l2vpn evpn 70 | default-originate ipv4 71 | default-originate ipv6 72 | exit-address-family 73 | exit 74 | ! 75 | router bgp 65000 vrf vrf_myzone2 76 | bgp router-id 192.168.0.1 77 | no bgp hard-administrative-reset 78 | no bgp graceful-restart notification 79 | ! 80 | address-family ipv4 unicast 81 | redistribute connected 82 | exit-address-family 83 | ! 84 | address-family ipv6 unicast 85 | redistribute connected 86 | exit-address-family 87 | ! 88 | address-family l2vpn evpn 89 | default-originate ipv4 90 | default-originate ipv6 91 | exit-address-family 92 | exit 93 | ! 94 | ip prefix-list only_default seq 1 permit 0.0.0.0/0 95 | ! 96 | ipv6 prefix-list only_default_v6 seq 1 permit ::/0 97 | ! 98 | route-map MAP_VTEP_IN deny 1 99 | match ip address prefix-list only_default 100 | exit 101 | ! 102 | route-map MAP_VTEP_IN deny 2 103 | match ipv6 address prefix-list only_default_v6 104 | exit 105 | ! 106 | route-map MAP_VTEP_IN deny 3 107 | match ip address prefix-list only_default 108 | exit 109 | ! 110 | route-map MAP_VTEP_IN deny 4 111 | match ipv6 address prefix-list only_default_v6 112 | exit 113 | ! 114 | route-map MAP_VTEP_IN permit 5 115 | exit 116 | ! 117 | route-map MAP_VTEP_OUT permit 1 118 | exit 119 | ! 120 | line vty 121 | ! -------------------------------------------------------------------------------- /src/test/zones/evpn/exitnodenullroute/expected_sdn_interfaces: -------------------------------------------------------------------------------- 1 | #version:1 2 | 3 | auto myvnet 4 | iface myvnet 5 | address 10.0.0.1/24 6 | address 192.168.0.1/24 7 | address 192.168.10.1/24 8 | address 2b0f:1480:4000:6000::1/64 9 | address 2b0f:1480:4000:8000::1/64 10 | address 2b0f:1480::1/64 11 | bridge_ports vxlan_myvnet 12 | bridge_stp off 13 | bridge_fd 0 14 | mtu 1450 15 | ip-forward on 16 | ip6-forward on 17 | arp-accept on 18 | vrf vrf_myzone 19 | 20 | auto myvnet2 21 | iface myvnet2 22 | address 10.0.0.1/24 23 | address 172.16.0.1/24 24 | address 172.16.3.1/24 25 | bridge_ports vxlan_myvnet2 26 | bridge_stp off 27 | bridge_fd 0 28 | mtu 1450 29 | ip-forward on 30 | arp-accept on 31 | vrf vrf_myzone2 32 | 33 | auto vrf_myzone 34 | iface vrf_myzone 35 | vrf-table auto 36 | post-up ip route del vrf vrf_myzone unreachable default metric 4278198272 37 | 38 | auto vrf_myzone2 39 | iface vrf_myzone2 40 | vrf-table auto 41 | post-up ip route del vrf vrf_myzone2 unreachable default metric 4278198272 42 | 43 | auto vrfbr_myzone 44 | iface vrfbr_myzone 45 | bridge-ports vrfvx_myzone 46 | bridge_stp off 47 | bridge_fd 0 48 | mtu 1450 49 | vrf vrf_myzone 50 | 51 | auto vrfbr_myzone2 52 | iface vrfbr_myzone2 53 | bridge-ports vrfvx_myzone2 54 | bridge_stp off 55 | bridge_fd 0 56 | mtu 1450 57 | vrf vrf_myzone2 58 | 59 | auto vrfvx_myzone 60 | iface vrfvx_myzone 61 | vxlan-id 1000 62 | vxlan-local-tunnelip 192.168.0.1 63 | bridge-learning off 64 | bridge-arp-nd-suppress on 65 | mtu 1450 66 | 67 | auto vrfvx_myzone2 68 | iface vrfvx_myzone2 69 | vxlan-id 1001 70 | vxlan-local-tunnelip 192.168.0.1 71 | bridge-learning off 72 | bridge-arp-nd-suppress on 73 | mtu 1450 74 | 75 | auto vxlan_myvnet 76 | iface vxlan_myvnet 77 | vxlan-id 100 78 | vxlan-local-tunnelip 192.168.0.1 79 | bridge-learning off 80 | bridge-arp-nd-suppress on 81 | mtu 1450 82 | 83 | auto vxlan_myvnet2 84 | iface vxlan_myvnet2 85 | vxlan-id 101 86 | vxlan-local-tunnelip 192.168.0.1 87 | bridge-learning off 88 | bridge-arp-nd-suppress on 89 | mtu 1450 90 | -------------------------------------------------------------------------------- /src/test/zones/evpn/exitnodenullroute/interfaces: -------------------------------------------------------------------------------- 1 | auto vmbr0 2 | iface vmbr0 inet static 3 | address 192.168.0.1/24 4 | gateway 192.168.0.254 5 | bridge-ports eth0 6 | bridge-stp off 7 | bridge-fd 0 8 | -------------------------------------------------------------------------------- /src/test/zones/evpn/exitnodenullroute/sdn_config: -------------------------------------------------------------------------------- 1 | { 2 | version => 1, 3 | vnets => { 4 | ids => { 5 | myvnet => { tag => "100", type => "vnet", zone => "myzone" }, 6 | myvnet2 => { tag => "101", type => "vnet", zone => "myzone2" }, 7 | }, 8 | }, 9 | 10 | zones => { 11 | ids => { 12 | myzone => { ipam => "pve", type => "evpn", controller => "evpnctl", 'vrf-vxlan' => 1000, exitnodes => { 'localhost' => 1 } }, 13 | myzone2 => { ipam => "pve", type => "evpn", controller => "evpnctl", 'vrf-vxlan' => 1001, exitnodes => { 'localhost' => 1 } }, 14 | } 15 | }, 16 | controllers => { 17 | ids => { evpnctl => { type => "evpn", 'peers' => '192.168.0.1,192.168.0.2,192.168.0.3', asn => "65000" } }, 18 | }, 19 | 20 | subnets => { 21 | ids => { 22 | 'myzone-192.168.10.1-24' => { 23 | 'type' => 'subnet', 24 | 'vnet' => 'myvnet', 25 | 'gateway' => '192.168.10.1', 26 | }, 27 | 'myzone-192.168.0.1-24' => { 28 | 'type' => 'subnet', 29 | 'vnet' => 'myvnet', 30 | 'gateway' => '192.168.0.1', 31 | }, 32 | 'myzone-10.0.0.0-24' => { 33 | 'type' => 'subnet', 34 | 'vnet' => 'myvnet', 35 | 'gateway' => '10.0.0.1', 36 | }, 37 | 'myzone2-10.0.0.0-24' => { 38 | 'type' => 'subnet', 39 | 'vnet' => 'myvnet2', 40 | 'gateway' => '10.0.0.1', 41 | }, 42 | 'myzone-2b0f:1480:4000:8000::-64' => { 43 | 'type' => 'subnet', 44 | 'vnet' => 'myvnet', 45 | 'gateway' => '2b0f:1480:4000:8000::1', 46 | }, 47 | 'myzone-2b0f:1480::-64' => { 48 | 'type' => 'subnet', 49 | 'vnet' => 'myvnet', 50 | 'gateway' => '2b0f:1480::1', 51 | }, 52 | 'myzone2-172.16.0.0-24' => { 53 | 'type' => 'subnet', 54 | 'vnet' => 'myvnet2', 55 | 'gateway' => '172.16.0.1', 56 | }, 57 | 'myzone2-172.16.3.0-24' => { 58 | 'type' => 'subnet', 59 | 'vnet' => 'myvnet2', 60 | 'gateway' => '172.16.3.1', 61 | }, 62 | 'myzone-2b0f:1480:4000:6000::-64' => { 63 | 'type' => 'subnet', 64 | 'vnet' => 'myvnet', 65 | 'gateway' => '2b0f:1480:4000:6000::1', 66 | }, 67 | 'myzone2-172.16.1.0-24' => { 68 | 'type' => 'subnet', 69 | 'vnet' => 'myvnet2', 70 | 'gateway' => '172.16.0.1', 71 | }, 72 | } 73 | } 74 | 75 | } 76 | 77 | 78 | -------------------------------------------------------------------------------- /src/test/zones/evpn/ipv4/expected_controller_config: -------------------------------------------------------------------------------- 1 | frr version 8.5.2 2 | frr defaults datacenter 3 | hostname localhost 4 | log syslog informational 5 | service integrated-vtysh-config 6 | ! 7 | ! 8 | vrf vrf_myzone 9 | vni 1000 10 | exit-vrf 11 | ! 12 | router bgp 65000 13 | bgp router-id 192.168.0.1 14 | no bgp hard-administrative-reset 15 | no bgp default ipv4-unicast 16 | coalesce-time 1000 17 | no bgp graceful-restart notification 18 | neighbor VTEP peer-group 19 | neighbor VTEP remote-as 65000 20 | neighbor VTEP bfd 21 | neighbor 192.168.0.2 peer-group VTEP 22 | neighbor 192.168.0.3 peer-group VTEP 23 | ! 24 | address-family l2vpn evpn 25 | neighbor VTEP activate 26 | neighbor VTEP route-map MAP_VTEP_IN in 27 | neighbor VTEP route-map MAP_VTEP_OUT out 28 | advertise-all-vni 29 | exit-address-family 30 | exit 31 | ! 32 | router bgp 65000 vrf vrf_myzone 33 | bgp router-id 192.168.0.1 34 | no bgp hard-administrative-reset 35 | no bgp graceful-restart notification 36 | exit 37 | ! 38 | route-map MAP_VTEP_IN permit 1 39 | exit 40 | ! 41 | route-map MAP_VTEP_OUT permit 1 42 | exit 43 | ! 44 | line vty 45 | ! -------------------------------------------------------------------------------- /src/test/zones/evpn/ipv4/expected_sdn_interfaces: -------------------------------------------------------------------------------- 1 | #version:1 2 | 3 | auto myvnet 4 | iface myvnet 5 | address 10.0.0.1/24 6 | hwaddress A2:1D:CB:1A:C0:8B 7 | bridge_ports vxlan_myvnet 8 | bridge_stp off 9 | bridge_fd 0 10 | mtu 1450 11 | ip-forward on 12 | arp-accept on 13 | vrf vrf_myzone 14 | 15 | auto vrf_myzone 16 | iface vrf_myzone 17 | vrf-table auto 18 | post-up ip route add vrf vrf_myzone unreachable default metric 4278198272 19 | 20 | auto vrfbr_myzone 21 | iface vrfbr_myzone 22 | bridge-ports vrfvx_myzone 23 | bridge_stp off 24 | bridge_fd 0 25 | mtu 1450 26 | vrf vrf_myzone 27 | 28 | auto vrfvx_myzone 29 | iface vrfvx_myzone 30 | vxlan-id 1000 31 | vxlan-local-tunnelip 192.168.0.1 32 | bridge-learning off 33 | bridge-arp-nd-suppress on 34 | mtu 1450 35 | 36 | auto vxlan_myvnet 37 | iface vxlan_myvnet 38 | vxlan-id 100 39 | vxlan-local-tunnelip 192.168.0.1 40 | bridge-learning off 41 | bridge-arp-nd-suppress on 42 | mtu 1450 43 | -------------------------------------------------------------------------------- /src/test/zones/evpn/ipv4/interfaces: -------------------------------------------------------------------------------- 1 | auto vmbr0 2 | iface vmbr0 inet static 3 | address 192.168.0.1/24 4 | gateway 192.168.0.254 5 | bridge-ports eth0 6 | bridge-stp off 7 | bridge-fd 0 8 | -------------------------------------------------------------------------------- /src/test/zones/evpn/ipv4/sdn_config: -------------------------------------------------------------------------------- 1 | { 2 | version => 1, 3 | vnets => { 4 | ids => { 5 | myvnet => { tag => "100", type => "vnet", zone => "myzone" }, 6 | }, 7 | }, 8 | 9 | zones => { 10 | ids => { myzone => { ipam => "pve", type => "evpn", controller => "evpnctl", 'vrf-vxlan' => 1000, 'mac' => 'A2:1D:CB:1A:C0:8B' } }, 11 | }, 12 | controllers => { 13 | ids => { evpnctl => { type => "evpn", 'peers' => '192.168.0.1,192.168.0.2,192.168.0.3', asn => "65000" } }, 14 | }, 15 | 16 | subnets => { 17 | ids => { 'myzone-10.0.0.0-24' => { 18 | 'type' => 'subnet', 19 | 'vnet' => 'myvnet', 20 | 'gateway' => '10.0.0.1', 21 | } 22 | } 23 | } 24 | } 25 | 26 | 27 | -------------------------------------------------------------------------------- /src/test/zones/evpn/ipv4ipv6/expected_controller_config: -------------------------------------------------------------------------------- 1 | frr version 8.5.2 2 | frr defaults datacenter 3 | hostname localhost 4 | log syslog informational 5 | service integrated-vtysh-config 6 | ! 7 | ! 8 | vrf vrf_myzone 9 | vni 1000 10 | exit-vrf 11 | ! 12 | router bgp 65000 13 | bgp router-id 192.168.0.1 14 | no bgp hard-administrative-reset 15 | no bgp default ipv4-unicast 16 | coalesce-time 1000 17 | no bgp graceful-restart notification 18 | neighbor VTEP peer-group 19 | neighbor VTEP remote-as 65000 20 | neighbor VTEP bfd 21 | neighbor 192.168.0.2 peer-group VTEP 22 | neighbor 192.168.0.3 peer-group VTEP 23 | ! 24 | address-family l2vpn evpn 25 | neighbor VTEP activate 26 | neighbor VTEP route-map MAP_VTEP_IN in 27 | neighbor VTEP route-map MAP_VTEP_OUT out 28 | advertise-all-vni 29 | exit-address-family 30 | exit 31 | ! 32 | router bgp 65000 vrf vrf_myzone 33 | bgp router-id 192.168.0.1 34 | no bgp hard-administrative-reset 35 | no bgp graceful-restart notification 36 | exit 37 | ! 38 | route-map MAP_VTEP_IN permit 1 39 | exit 40 | ! 41 | route-map MAP_VTEP_OUT permit 1 42 | exit 43 | ! 44 | line vty 45 | ! -------------------------------------------------------------------------------- /src/test/zones/evpn/ipv4ipv6/expected_sdn_interfaces: -------------------------------------------------------------------------------- 1 | #version:1 2 | 3 | auto myvnet 4 | iface myvnet 5 | address 10.0.0.1/24 6 | address 2a08:2142:302:3::1/64 7 | hwaddress A2:1D:CB:1A:C0:8B 8 | bridge_ports vxlan_myvnet 9 | bridge_stp off 10 | bridge_fd 0 11 | mtu 1450 12 | ip-forward on 13 | ip6-forward on 14 | arp-accept on 15 | vrf vrf_myzone 16 | 17 | auto vrf_myzone 18 | iface vrf_myzone 19 | vrf-table auto 20 | post-up ip route add vrf vrf_myzone unreachable default metric 4278198272 21 | 22 | auto vrfbr_myzone 23 | iface vrfbr_myzone 24 | bridge-ports vrfvx_myzone 25 | bridge_stp off 26 | bridge_fd 0 27 | mtu 1450 28 | vrf vrf_myzone 29 | 30 | auto vrfvx_myzone 31 | iface vrfvx_myzone 32 | vxlan-id 1000 33 | vxlan-local-tunnelip 192.168.0.1 34 | bridge-learning off 35 | bridge-arp-nd-suppress on 36 | mtu 1450 37 | 38 | auto vxlan_myvnet 39 | iface vxlan_myvnet 40 | vxlan-id 100 41 | vxlan-local-tunnelip 192.168.0.1 42 | bridge-learning off 43 | bridge-arp-nd-suppress on 44 | mtu 1450 45 | -------------------------------------------------------------------------------- /src/test/zones/evpn/ipv4ipv6/interfaces: -------------------------------------------------------------------------------- 1 | auto vmbr0 2 | iface vmbr0 inet static 3 | address 192.168.0.1/24 4 | gateway 192.168.0.254 5 | bridge-ports eth0 6 | bridge-stp off 7 | bridge-fd 0 8 | -------------------------------------------------------------------------------- /src/test/zones/evpn/ipv4ipv6/sdn_config: -------------------------------------------------------------------------------- 1 | { 2 | version => 1, 3 | vnets => { 4 | ids => { 5 | myvnet => { tag => "100", type => "vnet", zone => "myzone" }, 6 | }, 7 | }, 8 | 9 | zones => { 10 | ids => { myzone => { ipam => "pve", type => "evpn", controller => "evpnctl", 'vrf-vxlan' => 1000, 'mac' => 'A2:1D:CB:1A:C0:8B' } }, 11 | }, 12 | controllers => { 13 | ids => { evpnctl => { type => "evpn", 'peers' => '192.168.0.1,192.168.0.2,192.168.0.3', asn => "65000" } }, 14 | }, 15 | 16 | subnets => { 17 | ids => { 18 | 'myzone-10.0.0.0-24' => { 19 | 'type' => 'subnet', 20 | 'vnet' => 'myvnet', 21 | 'gateway' => '10.0.0.1', 22 | }, 23 | 'myzone-2a08:2142:302:3::-64' => { 24 | 'type' => 'subnet', 25 | 'vnet' => 'myvnet', 26 | 'gateway' => '2a08:2142:302:3::1', 27 | } 28 | } 29 | } 30 | } 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/test/zones/evpn/ipv4ipv6nogateway/expected_controller_config: -------------------------------------------------------------------------------- 1 | frr version 8.5.2 2 | frr defaults datacenter 3 | hostname localhost 4 | log syslog informational 5 | service integrated-vtysh-config 6 | ! 7 | ! 8 | vrf vrf_myzone 9 | vni 1000 10 | exit-vrf 11 | ! 12 | router bgp 65000 13 | bgp router-id 192.168.0.1 14 | no bgp hard-administrative-reset 15 | no bgp default ipv4-unicast 16 | coalesce-time 1000 17 | no bgp graceful-restart notification 18 | neighbor VTEP peer-group 19 | neighbor VTEP remote-as 65000 20 | neighbor VTEP bfd 21 | neighbor 192.168.0.2 peer-group VTEP 22 | neighbor 192.168.0.3 peer-group VTEP 23 | ! 24 | address-family l2vpn evpn 25 | neighbor VTEP activate 26 | neighbor VTEP route-map MAP_VTEP_IN in 27 | neighbor VTEP route-map MAP_VTEP_OUT out 28 | advertise-all-vni 29 | exit-address-family 30 | exit 31 | ! 32 | router bgp 65000 vrf vrf_myzone 33 | bgp router-id 192.168.0.1 34 | no bgp hard-administrative-reset 35 | no bgp graceful-restart notification 36 | exit 37 | ! 38 | route-map MAP_VTEP_IN permit 1 39 | exit 40 | ! 41 | route-map MAP_VTEP_OUT permit 1 42 | exit 43 | ! 44 | line vty 45 | ! -------------------------------------------------------------------------------- /src/test/zones/evpn/ipv4ipv6nogateway/expected_sdn_interfaces: -------------------------------------------------------------------------------- 1 | #version:1 2 | 3 | auto myvnet 4 | iface myvnet 5 | hwaddress A2:1D:CB:1A:C0:8B 6 | bridge_ports vxlan_myvnet 7 | bridge_stp off 8 | bridge_fd 0 9 | mtu 1450 10 | arp-accept on 11 | vrf vrf_myzone 12 | 13 | auto vrf_myzone 14 | iface vrf_myzone 15 | vrf-table auto 16 | post-up ip route add vrf vrf_myzone unreachable default metric 4278198272 17 | 18 | auto vrfbr_myzone 19 | iface vrfbr_myzone 20 | bridge-ports vrfvx_myzone 21 | bridge_stp off 22 | bridge_fd 0 23 | mtu 1450 24 | vrf vrf_myzone 25 | 26 | auto vrfvx_myzone 27 | iface vrfvx_myzone 28 | vxlan-id 1000 29 | vxlan-local-tunnelip 192.168.0.1 30 | bridge-learning off 31 | bridge-arp-nd-suppress on 32 | mtu 1450 33 | 34 | auto vxlan_myvnet 35 | iface vxlan_myvnet 36 | vxlan-id 100 37 | vxlan-local-tunnelip 192.168.0.1 38 | bridge-learning off 39 | bridge-arp-nd-suppress on 40 | mtu 1450 41 | -------------------------------------------------------------------------------- /src/test/zones/evpn/ipv4ipv6nogateway/interfaces: -------------------------------------------------------------------------------- 1 | auto vmbr0 2 | iface vmbr0 inet static 3 | address 192.168.0.1/24 4 | gateway 192.168.0.254 5 | bridge-ports eth0 6 | bridge-stp off 7 | bridge-fd 0 8 | -------------------------------------------------------------------------------- /src/test/zones/evpn/ipv4ipv6nogateway/sdn_config: -------------------------------------------------------------------------------- 1 | { 2 | version => 1, 3 | vnets => { 4 | ids => { 5 | myvnet => { tag => "100", type => "vnet", zone => "myzone" }, 6 | }, 7 | }, 8 | 9 | zones => { 10 | ids => { myzone => { ipam => "pve", type => "evpn", controller => "evpnctl", 'vrf-vxlan' => 1000, 'mac' => 'A2:1D:CB:1A:C0:8B' } }, 11 | }, 12 | controllers => { 13 | ids => { evpnctl => { type => "evpn", 'peers' => '192.168.0.1,192.168.0.2,192.168.0.3', asn => "65000" } }, 14 | }, 15 | 16 | subnets => { 17 | ids => { 18 | 'myzone-10.0.0.0-24' => { 19 | 'type' => 'subnet', 20 | 'vnet' => 'myvnet', 21 | }, 22 | 'myzone-2a08:2142:302:3::-64' => { 23 | 'type' => 'subnet', 24 | 'vnet' => 'myvnet', 25 | } 26 | } 27 | } 28 | } 29 | 30 | 31 | -------------------------------------------------------------------------------- /src/test/zones/evpn/ipv6/expected_controller_config: -------------------------------------------------------------------------------- 1 | frr version 8.5.2 2 | frr defaults datacenter 3 | hostname localhost 4 | log syslog informational 5 | service integrated-vtysh-config 6 | ! 7 | ! 8 | vrf vrf_myzone 9 | vni 1000 10 | exit-vrf 11 | ! 12 | router bgp 65000 13 | bgp router-id 192.168.0.1 14 | no bgp hard-administrative-reset 15 | no bgp default ipv4-unicast 16 | coalesce-time 1000 17 | no bgp graceful-restart notification 18 | neighbor VTEP peer-group 19 | neighbor VTEP remote-as 65000 20 | neighbor VTEP bfd 21 | neighbor 192.168.0.2 peer-group VTEP 22 | neighbor 192.168.0.3 peer-group VTEP 23 | ! 24 | address-family l2vpn evpn 25 | neighbor VTEP activate 26 | neighbor VTEP route-map MAP_VTEP_IN in 27 | neighbor VTEP route-map MAP_VTEP_OUT out 28 | advertise-all-vni 29 | exit-address-family 30 | exit 31 | ! 32 | router bgp 65000 vrf vrf_myzone 33 | bgp router-id 192.168.0.1 34 | no bgp hard-administrative-reset 35 | no bgp graceful-restart notification 36 | exit 37 | ! 38 | route-map MAP_VTEP_IN permit 1 39 | exit 40 | ! 41 | route-map MAP_VTEP_OUT permit 1 42 | exit 43 | ! 44 | line vty 45 | ! -------------------------------------------------------------------------------- /src/test/zones/evpn/ipv6/expected_sdn_interfaces: -------------------------------------------------------------------------------- 1 | #version:1 2 | 3 | auto myvnet 4 | iface myvnet 5 | address 2a08:2142:302:3::1/64 6 | hwaddress A2:1D:CB:1A:C0:8B 7 | bridge_ports vxlan_myvnet 8 | bridge_stp off 9 | bridge_fd 0 10 | mtu 1450 11 | ip6-forward on 12 | arp-accept on 13 | vrf vrf_myzone 14 | 15 | auto vrf_myzone 16 | iface vrf_myzone 17 | vrf-table auto 18 | post-up ip route add vrf vrf_myzone unreachable default metric 4278198272 19 | 20 | auto vrfbr_myzone 21 | iface vrfbr_myzone 22 | bridge-ports vrfvx_myzone 23 | bridge_stp off 24 | bridge_fd 0 25 | mtu 1450 26 | vrf vrf_myzone 27 | 28 | auto vrfvx_myzone 29 | iface vrfvx_myzone 30 | vxlan-id 1000 31 | vxlan-local-tunnelip 192.168.0.1 32 | bridge-learning off 33 | bridge-arp-nd-suppress on 34 | mtu 1450 35 | 36 | auto vxlan_myvnet 37 | iface vxlan_myvnet 38 | vxlan-id 100 39 | vxlan-local-tunnelip 192.168.0.1 40 | bridge-learning off 41 | bridge-arp-nd-suppress on 42 | mtu 1450 43 | -------------------------------------------------------------------------------- /src/test/zones/evpn/ipv6/interfaces: -------------------------------------------------------------------------------- 1 | auto vmbr0 2 | iface vmbr0 inet static 3 | address 192.168.0.1/24 4 | gateway 192.168.0.254 5 | bridge-ports eth0 6 | bridge-stp off 7 | bridge-fd 0 8 | -------------------------------------------------------------------------------- /src/test/zones/evpn/ipv6/sdn_config: -------------------------------------------------------------------------------- 1 | { 2 | version => 1, 3 | vnets => { 4 | ids => { 5 | myvnet => { tag => "100", type => "vnet", zone => "myzone" }, 6 | }, 7 | }, 8 | 9 | zones => { 10 | ids => { myzone => { ipam => "pve", type => "evpn", controller => "evpnctl", 'vrf-vxlan' => 1000, 'mac' => 'A2:1D:CB:1A:C0:8B' } }, 11 | }, 12 | controllers => { 13 | ids => { evpnctl => { type => "evpn", 'peers' => '192.168.0.1,192.168.0.2,192.168.0.3', asn => "65000" } }, 14 | }, 15 | 16 | subnets => { 17 | ids => { 18 | 'myzone-2a08:2142:302:3::-64' => { 19 | 'type' => 'subnet', 20 | 'vnet' => 'myvnet', 21 | 'gateway' => '2a08:2142:302:3::1', 22 | } 23 | } 24 | } 25 | } 26 | 27 | 28 | -------------------------------------------------------------------------------- /src/test/zones/evpn/ipv6underlay/expected_controller_config: -------------------------------------------------------------------------------- 1 | frr version 8.5.2 2 | frr defaults datacenter 3 | hostname localhost 4 | log syslog informational 5 | service integrated-vtysh-config 6 | ! 7 | ! 8 | vrf vrf_myzone 9 | vni 1000 10 | exit-vrf 11 | ! 12 | router bgp 65000 13 | bgp router-id 17.29.105.96 14 | no bgp hard-administrative-reset 15 | no bgp default ipv4-unicast 16 | coalesce-time 1000 17 | no bgp graceful-restart notification 18 | neighbor VTEP peer-group 19 | neighbor VTEP remote-as 65000 20 | neighbor VTEP bfd 21 | neighbor 2a08:2200:100:1::11 peer-group VTEP 22 | neighbor 2a08:2200:100:1::12 peer-group VTEP 23 | ! 24 | address-family l2vpn evpn 25 | neighbor VTEP activate 26 | neighbor VTEP route-map MAP_VTEP_IN in 27 | neighbor VTEP route-map MAP_VTEP_OUT out 28 | advertise-all-vni 29 | exit-address-family 30 | exit 31 | ! 32 | router bgp 65000 vrf vrf_myzone 33 | bgp router-id 17.29.105.96 34 | no bgp hard-administrative-reset 35 | no bgp graceful-restart notification 36 | exit 37 | ! 38 | route-map MAP_VTEP_IN permit 1 39 | exit 40 | ! 41 | route-map MAP_VTEP_OUT permit 1 42 | exit 43 | ! 44 | line vty 45 | ! -------------------------------------------------------------------------------- /src/test/zones/evpn/ipv6underlay/expected_sdn_interfaces: -------------------------------------------------------------------------------- 1 | #version:1 2 | 3 | auto myvnet 4 | iface myvnet 5 | address 2a08:2142:302:3::1/64 6 | hwaddress A2:1D:CB:1A:C0:8B 7 | bridge_ports vxlan_myvnet 8 | bridge_stp off 9 | bridge_fd 0 10 | mtu 1450 11 | ip6-forward on 12 | arp-accept on 13 | vrf vrf_myzone 14 | 15 | auto vrf_myzone 16 | iface vrf_myzone 17 | vrf-table auto 18 | post-up ip route add vrf vrf_myzone unreachable default metric 4278198272 19 | 20 | auto vrfbr_myzone 21 | iface vrfbr_myzone 22 | bridge-ports vrfvx_myzone 23 | bridge_stp off 24 | bridge_fd 0 25 | mtu 1450 26 | vrf vrf_myzone 27 | 28 | auto vrfvx_myzone 29 | iface vrfvx_myzone 30 | vxlan-id 1000 31 | vxlan-local-tunnelip 2a08:2200:100:1::10 32 | bridge-learning off 33 | bridge-arp-nd-suppress on 34 | mtu 1450 35 | 36 | auto vxlan_myvnet 37 | iface vxlan_myvnet 38 | vxlan-id 100 39 | vxlan-local-tunnelip 2a08:2200:100:1::10 40 | bridge-learning off 41 | bridge-arp-nd-suppress on 42 | mtu 1450 43 | -------------------------------------------------------------------------------- /src/test/zones/evpn/ipv6underlay/interfaces: -------------------------------------------------------------------------------- 1 | auto vmbr0 2 | iface vmbr0 inet static 3 | address 2a08:2200:100:1::10/64 4 | gateway 2a08:2200:100:1::1 5 | bridge-ports eth0 6 | bridge-stp off 7 | bridge-fd 0 8 | -------------------------------------------------------------------------------- /src/test/zones/evpn/ipv6underlay/sdn_config: -------------------------------------------------------------------------------- 1 | { 2 | version => 1, 3 | vnets => { 4 | ids => { 5 | myvnet => { tag => "100", type => "vnet", zone => "myzone" }, 6 | }, 7 | }, 8 | 9 | zones => { 10 | ids => { myzone => { ipam => "pve", type => "evpn", controller => "evpnctl", 'vrf-vxlan' => 1000, 'mac' => 'A2:1D:CB:1A:C0:8B' } }, 11 | }, 12 | controllers => { 13 | ids => { evpnctl => { type => "evpn", 'peers' => '2a08:2200:100:1::10,2a08:2200:100:1::11,2a08:2200:100:1::12', asn => "65000" } }, 14 | }, 15 | 16 | subnets => { 17 | ids => { 18 | 'myzone-2a08:2142:302:3::-64' => { 19 | 'type' => 'subnet', 20 | 'vnet' => 'myvnet', 21 | 'gateway' => '2a08:2142:302:3::1', 22 | } 23 | } 24 | } 25 | } 26 | 27 | 28 | -------------------------------------------------------------------------------- /src/test/zones/evpn/isis/expected_controller_config: -------------------------------------------------------------------------------- 1 | frr version 8.5.2 2 | frr defaults datacenter 3 | hostname localhost 4 | log syslog informational 5 | service integrated-vtysh-config 6 | ! 7 | ! 8 | vrf vrf_myzone 9 | vni 1000 10 | exit-vrf 11 | ! 12 | interface eth0 13 | ip router isis isis1 14 | ! 15 | interface eth1 16 | ip router isis isis1 17 | ! 18 | router bgp 65000 19 | bgp router-id 192.168.0.1 20 | no bgp hard-administrative-reset 21 | no bgp default ipv4-unicast 22 | coalesce-time 1000 23 | no bgp graceful-restart notification 24 | neighbor VTEP peer-group 25 | neighbor VTEP remote-as 65000 26 | neighbor VTEP bfd 27 | neighbor 192.168.0.2 peer-group VTEP 28 | neighbor 192.168.0.3 peer-group VTEP 29 | ! 30 | address-family l2vpn evpn 31 | neighbor VTEP activate 32 | neighbor VTEP route-map MAP_VTEP_IN in 33 | neighbor VTEP route-map MAP_VTEP_OUT out 34 | advertise-all-vni 35 | exit-address-family 36 | exit 37 | ! 38 | router bgp 65000 vrf vrf_myzone 39 | bgp router-id 192.168.0.1 40 | no bgp hard-administrative-reset 41 | no bgp graceful-restart notification 42 | exit 43 | ! 44 | router isis isis1 45 | net 47.0023.0000.0000.0000.0000.0000.0000.1900.0004.00 46 | redistribute ipv4 connected level-1 47 | redistribute ipv6 connected level-1 48 | log-adjacency-changes 49 | exit 50 | ! 51 | route-map MAP_VTEP_IN permit 1 52 | exit 53 | ! 54 | route-map MAP_VTEP_OUT permit 1 55 | exit 56 | ! 57 | line vty 58 | ! -------------------------------------------------------------------------------- /src/test/zones/evpn/isis/expected_sdn_interfaces: -------------------------------------------------------------------------------- 1 | #version:1 2 | 3 | auto myvnet 4 | iface myvnet 5 | address 10.0.0.1/24 6 | bridge_ports vxlan_myvnet 7 | bridge_stp off 8 | bridge_fd 0 9 | mtu 1450 10 | ip-forward on 11 | arp-accept on 12 | vrf vrf_myzone 13 | 14 | auto vrf_myzone 15 | iface vrf_myzone 16 | vrf-table auto 17 | post-up ip route add vrf vrf_myzone unreachable default metric 4278198272 18 | 19 | auto vrfbr_myzone 20 | iface vrfbr_myzone 21 | bridge-ports vrfvx_myzone 22 | bridge_stp off 23 | bridge_fd 0 24 | mtu 1450 25 | vrf vrf_myzone 26 | 27 | auto vrfvx_myzone 28 | iface vrfvx_myzone 29 | vxlan-id 1000 30 | vxlan-local-tunnelip 192.168.0.1 31 | bridge-learning off 32 | bridge-arp-nd-suppress on 33 | mtu 1450 34 | 35 | auto vxlan_myvnet 36 | iface vxlan_myvnet 37 | vxlan-id 100 38 | vxlan-local-tunnelip 192.168.0.1 39 | bridge-learning off 40 | bridge-arp-nd-suppress on 41 | mtu 1450 42 | -------------------------------------------------------------------------------- /src/test/zones/evpn/isis/interfaces: -------------------------------------------------------------------------------- 1 | auto vmbr0 2 | iface vmbr0 inet static 3 | address 192.168.0.1/24 4 | gateway 192.168.0.254 5 | bridge-ports eth0 6 | bridge-stp off 7 | bridge-fd 0 -------------------------------------------------------------------------------- /src/test/zones/evpn/isis/sdn_config: -------------------------------------------------------------------------------- 1 | { 2 | version => 1, 3 | vnets => { 4 | ids => { 5 | myvnet => { 6 | tag => "100", 7 | type => "vnet", 8 | zone => "myzone", 9 | }, 10 | }, 11 | }, 12 | 13 | zones => { 14 | ids => { 15 | myzone => { 16 | ipam => "pve", 17 | type => "evpn", 18 | controller => "evpnctl", 19 | 'vrf-vxlan' => 1000, 20 | }, 21 | }, 22 | }, 23 | controllers => { 24 | ids => { 25 | evpnctl => { 26 | type => "evpn", 27 | 'peers' => '192.168.0.1,192.168.0.2,192.168.0.3', 28 | asn => "65000", 29 | }, 30 | localhost => { 31 | type => "isis", 32 | 'isis-domain' => 'isis1', 33 | 'isis-ifaces' => 'eth1,eth0', 34 | 'isis-net' => "47.0023.0000.0000.0000.0000.0000.0000.1900.0004.00", 35 | node => "localhost", 36 | }, 37 | }, 38 | }, 39 | 40 | subnets => { 41 | ids => { 42 | 'myzone-10.0.0.0-24' => { 43 | 'type' => 'subnet', 44 | 'vnet' => 'myvnet', 45 | 'gateway' => '10.0.0.1', 46 | }, 47 | }, 48 | }, 49 | } 50 | -------------------------------------------------------------------------------- /src/test/zones/evpn/isis_loopback/expected_controller_config: -------------------------------------------------------------------------------- 1 | frr version 8.5.2 2 | frr defaults datacenter 3 | hostname localhost 4 | log syslog informational 5 | service integrated-vtysh-config 6 | ! 7 | ! 8 | vrf vrf_myzone 9 | vni 1000 10 | exit-vrf 11 | ! 12 | interface eth0 13 | ip router isis isis1 14 | ! 15 | interface eth1 16 | ip router isis isis1 17 | ! 18 | router bgp 65000 19 | bgp router-id 10.0.0.1 20 | no bgp hard-administrative-reset 21 | no bgp default ipv4-unicast 22 | coalesce-time 1000 23 | no bgp graceful-restart notification 24 | neighbor VTEP peer-group 25 | neighbor VTEP remote-as 65000 26 | neighbor VTEP bfd 27 | neighbor VTEP update-source dummy1 28 | neighbor 10.0.0.2 peer-group VTEP 29 | neighbor 10.0.0.3 peer-group VTEP 30 | ! 31 | address-family l2vpn evpn 32 | neighbor VTEP activate 33 | neighbor VTEP route-map MAP_VTEP_IN in 34 | neighbor VTEP route-map MAP_VTEP_OUT out 35 | advertise-all-vni 36 | exit-address-family 37 | exit 38 | ! 39 | router bgp 65000 vrf vrf_myzone 40 | bgp router-id 10.0.0.1 41 | no bgp hard-administrative-reset 42 | no bgp graceful-restart notification 43 | exit 44 | ! 45 | router isis isis1 46 | net 47.0023.0000.0000.0000.0000.0000.0000.1900.0004.00 47 | redistribute ipv4 connected level-1 48 | redistribute ipv6 connected level-1 49 | log-adjacency-changes 50 | exit 51 | ! 52 | route-map MAP_VTEP_IN permit 1 53 | exit 54 | ! 55 | route-map MAP_VTEP_OUT permit 1 56 | exit 57 | ! 58 | line vty 59 | ! -------------------------------------------------------------------------------- /src/test/zones/evpn/isis_loopback/expected_sdn_interfaces: -------------------------------------------------------------------------------- 1 | #version:1 2 | 3 | auto myvnet 4 | iface myvnet 5 | address 10.0.0.1/24 6 | bridge_ports vxlan_myvnet 7 | bridge_stp off 8 | bridge_fd 0 9 | mtu 1450 10 | ip-forward on 11 | arp-accept on 12 | vrf vrf_myzone 13 | 14 | auto vrf_myzone 15 | iface vrf_myzone 16 | vrf-table auto 17 | post-up ip route add vrf vrf_myzone unreachable default metric 4278198272 18 | 19 | auto vrfbr_myzone 20 | iface vrfbr_myzone 21 | bridge-ports vrfvx_myzone 22 | bridge_stp off 23 | bridge_fd 0 24 | mtu 1450 25 | vrf vrf_myzone 26 | 27 | auto vrfvx_myzone 28 | iface vrfvx_myzone 29 | vxlan-id 1000 30 | vxlan-local-tunnelip 10.0.0.1 31 | bridge-learning off 32 | bridge-arp-nd-suppress on 33 | mtu 1450 34 | 35 | auto vxlan_myvnet 36 | iface vxlan_myvnet 37 | vxlan-id 100 38 | vxlan-local-tunnelip 10.0.0.1 39 | bridge-learning off 40 | bridge-arp-nd-suppress on 41 | mtu 1450 42 | -------------------------------------------------------------------------------- /src/test/zones/evpn/isis_loopback/interfaces: -------------------------------------------------------------------------------- 1 | auto vmbr0 2 | iface vmbr0 inet static 3 | address 192.168.0.1/24 4 | gateway 192.168.0.254 5 | bridge-ports eth0 6 | bridge-stp off 7 | bridge-fd 0 8 | 9 | auto dummy1 10 | iface dummy1 inet static 11 | address 10.0.0.1/32 12 | link-type dummy -------------------------------------------------------------------------------- /src/test/zones/evpn/isis_loopback/sdn_config: -------------------------------------------------------------------------------- 1 | { 2 | version => 1, 3 | vnets => { 4 | ids => { 5 | myvnet => { 6 | tag => "100", 7 | type => "vnet", 8 | zone => "myzone", 9 | }, 10 | }, 11 | }, 12 | 13 | zones => { 14 | ids => { 15 | myzone => { 16 | ipam => "pve", 17 | type => "evpn", 18 | controller => "evpnctl", 19 | 'vrf-vxlan' => 1000, 20 | }, 21 | }, 22 | }, 23 | controllers => { 24 | ids => { 25 | evpnctl => { 26 | type => "evpn", 27 | 'peers' => '10.0.0.1,10.0.0.2,10.0.0.3', 28 | asn => "65000", 29 | }, 30 | localhost => { 31 | type => "isis", 32 | 'isis-domain' => 'isis1', 33 | 'isis-ifaces' => 'eth1,eth0', 34 | 'isis-net' => "47.0023.0000.0000.0000.0000.0000.0000.1900.0004.00", 35 | loopback => 'dummy1', 36 | node => "localhost", 37 | }, 38 | }, 39 | }, 40 | 41 | subnets => { 42 | ids => { 43 | 'myzone-10.0.0.0-24' => { 44 | 'type' => 'subnet', 45 | 'vnet' => 'myvnet', 46 | 'gateway' => '10.0.0.1', 47 | }, 48 | }, 49 | }, 50 | } 51 | -------------------------------------------------------------------------------- /src/test/zones/evpn/multipath_relax/expected_controller_config: -------------------------------------------------------------------------------- 1 | frr version 8.5.2 2 | frr defaults datacenter 3 | hostname localhost 4 | log syslog informational 5 | service integrated-vtysh-config 6 | ! 7 | ! 8 | vrf vrf_myzone 9 | vni 1000 10 | exit-vrf 11 | ! 12 | router bgp 65000 13 | bgp router-id 192.168.0.1 14 | no bgp hard-administrative-reset 15 | no bgp default ipv4-unicast 16 | coalesce-time 1000 17 | no bgp graceful-restart notification 18 | neighbor VTEP peer-group 19 | neighbor VTEP remote-as 65000 20 | neighbor VTEP bfd 21 | neighbor 192.168.0.2 peer-group VTEP 22 | neighbor 192.168.0.3 peer-group VTEP 23 | bgp bestpath as-path multipath-relax 24 | neighbor BGP peer-group 25 | neighbor BGP remote-as 65000 26 | neighbor BGP bfd 27 | neighbor 192.168.0.1 peer-group BGP 28 | neighbor 192.168.0.2 peer-group BGP 29 | neighbor 192.168.0.3 peer-group BGP 30 | ! 31 | address-family ipv4 unicast 32 | neighbor BGP activate 33 | neighbor BGP soft-reconfiguration inbound 34 | exit-address-family 35 | ! 36 | address-family l2vpn evpn 37 | neighbor VTEP activate 38 | neighbor VTEP route-map MAP_VTEP_IN in 39 | neighbor VTEP route-map MAP_VTEP_OUT out 40 | advertise-all-vni 41 | exit-address-family 42 | exit 43 | ! 44 | router bgp 65000 vrf vrf_myzone 45 | bgp router-id 192.168.0.1 46 | no bgp hard-administrative-reset 47 | no bgp graceful-restart notification 48 | exit 49 | ! 50 | route-map MAP_VTEP_IN permit 1 51 | exit 52 | ! 53 | route-map MAP_VTEP_OUT permit 1 54 | exit 55 | ! 56 | line vty 57 | ! -------------------------------------------------------------------------------- /src/test/zones/evpn/multipath_relax/expected_sdn_interfaces: -------------------------------------------------------------------------------- 1 | #version:1 2 | 3 | auto myvnet 4 | iface myvnet 5 | address 10.0.0.1/24 6 | bridge_ports vxlan_myvnet 7 | bridge_stp off 8 | bridge_fd 0 9 | mtu 1450 10 | ip-forward on 11 | arp-accept on 12 | vrf vrf_myzone 13 | 14 | auto vrf_myzone 15 | iface vrf_myzone 16 | vrf-table auto 17 | post-up ip route add vrf vrf_myzone unreachable default metric 4278198272 18 | 19 | auto vrfbr_myzone 20 | iface vrfbr_myzone 21 | bridge-ports vrfvx_myzone 22 | bridge_stp off 23 | bridge_fd 0 24 | mtu 1450 25 | vrf vrf_myzone 26 | 27 | auto vrfvx_myzone 28 | iface vrfvx_myzone 29 | vxlan-id 1000 30 | vxlan-local-tunnelip 192.168.0.1 31 | bridge-learning off 32 | bridge-arp-nd-suppress on 33 | mtu 1450 34 | 35 | auto vxlan_myvnet 36 | iface vxlan_myvnet 37 | vxlan-id 100 38 | vxlan-local-tunnelip 192.168.0.1 39 | bridge-learning off 40 | bridge-arp-nd-suppress on 41 | mtu 1450 42 | -------------------------------------------------------------------------------- /src/test/zones/evpn/multipath_relax/interfaces: -------------------------------------------------------------------------------- 1 | auto vmbr0 2 | iface vmbr0 inet static 3 | address 192.168.0.1/24 4 | gateway 192.168.0.254 5 | bridge-ports eth0 6 | bridge-stp off 7 | bridge-fd 0 8 | -------------------------------------------------------------------------------- /src/test/zones/evpn/multipath_relax/sdn_config: -------------------------------------------------------------------------------- 1 | { 2 | version => 1, 3 | vnets => { 4 | ids => { 5 | myvnet => { 6 | tag => "100", 7 | type => "vnet", 8 | zone => "myzone", 9 | }, 10 | }, 11 | }, 12 | 13 | zones => { 14 | ids => { 15 | myzone => { 16 | ipam => "pve", 17 | type => "evpn", 18 | controller => "evpnctl", 19 | 'vrf-vxlan' => 1000, 20 | }, 21 | }, 22 | }, 23 | controllers => { 24 | ids => { 25 | evpnctl => { 26 | type => "evpn", 27 | 'peers' => '192.168.0.1,192.168.0.2,192.168.0.3', 28 | asn => "65000", 29 | }, 30 | localhost => { 31 | type => "bgp", 32 | 'peers' => '192.168.0.1,192.168.0.2,192.168.0.3', 33 | 'bgp-multipath-as-path-relax' => "1", 34 | asn => "65000", 35 | node => "localhost", 36 | }, 37 | }, 38 | }, 39 | 40 | subnets => { 41 | ids => { 42 | 'myzone-10.0.0.0-24' => { 43 | 'type' => 'subnet', 44 | 'vnet' => 'myvnet', 45 | 'gateway' => '10.0.0.1', 46 | }, 47 | }, 48 | }, 49 | } 50 | -------------------------------------------------------------------------------- /src/test/zones/evpn/multiplezones/expected_controller_config: -------------------------------------------------------------------------------- 1 | frr version 8.5.2 2 | frr defaults datacenter 3 | hostname localhost 4 | log syslog informational 5 | service integrated-vtysh-config 6 | ! 7 | ! 8 | vrf vrf_myzone 9 | vni 1000 10 | exit-vrf 11 | ! 12 | vrf vrf_myzone2 13 | vni 1001 14 | exit-vrf 15 | ! 16 | router bgp 65000 17 | bgp router-id 192.168.0.1 18 | no bgp hard-administrative-reset 19 | no bgp default ipv4-unicast 20 | coalesce-time 1000 21 | no bgp graceful-restart notification 22 | neighbor VTEP peer-group 23 | neighbor VTEP remote-as 65000 24 | neighbor VTEP bfd 25 | neighbor 192.168.0.2 peer-group VTEP 26 | neighbor 192.168.0.3 peer-group VTEP 27 | ! 28 | address-family l2vpn evpn 29 | neighbor VTEP activate 30 | neighbor VTEP route-map MAP_VTEP_IN in 31 | neighbor VTEP route-map MAP_VTEP_OUT out 32 | advertise-all-vni 33 | exit-address-family 34 | exit 35 | ! 36 | router bgp 65000 vrf vrf_myzone 37 | bgp router-id 192.168.0.1 38 | no bgp hard-administrative-reset 39 | no bgp graceful-restart notification 40 | exit 41 | ! 42 | router bgp 65000 vrf vrf_myzone2 43 | bgp router-id 192.168.0.1 44 | no bgp hard-administrative-reset 45 | no bgp graceful-restart notification 46 | exit 47 | ! 48 | route-map MAP_VTEP_IN permit 1 49 | exit 50 | ! 51 | route-map MAP_VTEP_OUT permit 1 52 | exit 53 | ! 54 | line vty 55 | ! -------------------------------------------------------------------------------- /src/test/zones/evpn/multiplezones/expected_sdn_interfaces: -------------------------------------------------------------------------------- 1 | #version:1 2 | 3 | auto myvnet 4 | iface myvnet 5 | address 10.0.0.1/24 6 | bridge_ports vxlan_myvnet 7 | bridge_stp off 8 | bridge_fd 0 9 | mtu 1450 10 | ip-forward on 11 | arp-accept on 12 | vrf vrf_myzone 13 | 14 | auto myvnet2 15 | iface myvnet2 16 | address 172.16.0.1/24 17 | bridge_ports vxlan_myvnet2 18 | bridge_stp off 19 | bridge_fd 0 20 | mtu 1450 21 | ip-forward on 22 | arp-accept on 23 | vrf vrf_myzone2 24 | 25 | auto vrf_myzone 26 | iface vrf_myzone 27 | vrf-table auto 28 | post-up ip route add vrf vrf_myzone unreachable default metric 4278198272 29 | 30 | auto vrf_myzone2 31 | iface vrf_myzone2 32 | vrf-table auto 33 | post-up ip route add vrf vrf_myzone2 unreachable default metric 4278198272 34 | 35 | auto vrfbr_myzone 36 | iface vrfbr_myzone 37 | bridge-ports vrfvx_myzone 38 | bridge_stp off 39 | bridge_fd 0 40 | mtu 1450 41 | vrf vrf_myzone 42 | 43 | auto vrfbr_myzone2 44 | iface vrfbr_myzone2 45 | bridge-ports vrfvx_myzone2 46 | bridge_stp off 47 | bridge_fd 0 48 | mtu 1450 49 | vrf vrf_myzone2 50 | 51 | auto vrfvx_myzone 52 | iface vrfvx_myzone 53 | vxlan-id 1000 54 | vxlan-local-tunnelip 192.168.0.1 55 | bridge-learning off 56 | bridge-arp-nd-suppress on 57 | mtu 1450 58 | 59 | auto vrfvx_myzone2 60 | iface vrfvx_myzone2 61 | vxlan-id 1001 62 | vxlan-local-tunnelip 192.168.0.1 63 | bridge-learning off 64 | bridge-arp-nd-suppress on 65 | mtu 1450 66 | 67 | auto vxlan_myvnet 68 | iface vxlan_myvnet 69 | vxlan-id 100 70 | vxlan-local-tunnelip 192.168.0.1 71 | bridge-learning off 72 | bridge-arp-nd-suppress on 73 | mtu 1450 74 | 75 | auto vxlan_myvnet2 76 | iface vxlan_myvnet2 77 | vxlan-id 101 78 | vxlan-local-tunnelip 192.168.0.1 79 | bridge-learning off 80 | bridge-arp-nd-suppress on 81 | mtu 1450 82 | -------------------------------------------------------------------------------- /src/test/zones/evpn/multiplezones/interfaces: -------------------------------------------------------------------------------- 1 | auto vmbr0 2 | iface vmbr0 inet static 3 | address 192.168.0.1/24 4 | gateway 192.168.0.254 5 | bridge-ports eth0 6 | bridge-stp off 7 | bridge-fd 0 8 | -------------------------------------------------------------------------------- /src/test/zones/evpn/multiplezones/sdn_config: -------------------------------------------------------------------------------- 1 | { 2 | version => 1, 3 | vnets => { 4 | ids => { 5 | myvnet => { tag => "100", type => "vnet", zone => "myzone" }, 6 | myvnet2 => { tag => "101", type => "vnet", zone => "myzone2" }, 7 | }, 8 | }, 9 | 10 | zones => { 11 | ids => { 12 | myzone => { ipam => "pve", type => "evpn", controller => "evpnctl", 'vrf-vxlan' => 1000 }, 13 | myzone2 => { ipam => "pve", type => "evpn", controller => "evpnctl", 'vrf-vxlan' => 1001 }, 14 | } 15 | }, 16 | controllers => { 17 | ids => { evpnctl => { type => "evpn", 'peers' => '192.168.0.1,192.168.0.2,192.168.0.3', asn => "65000" } }, 18 | }, 19 | 20 | subnets => { 21 | ids => { 22 | 'myzone-10.0.0.0-24' => { 23 | 'type' => 'subnet', 24 | 'vnet' => 'myvnet', 25 | 'gateway' => '10.0.0.1', 26 | }, 27 | 'myzone2-172.16.0.0-24' => { 28 | 'type' => 'subnet', 29 | 'vnet' => 'myvnet2', 30 | 'gateway' => '172.16.0.1', 31 | }, 32 | } 33 | } 34 | 35 | } 36 | 37 | 38 | -------------------------------------------------------------------------------- /src/test/zones/evpn/rt_import/expected_controller_config: -------------------------------------------------------------------------------- 1 | frr version 8.5.2 2 | frr defaults datacenter 3 | hostname localhost 4 | log syslog informational 5 | service integrated-vtysh-config 6 | ! 7 | ! 8 | vrf vrf_myzone 9 | vni 1000 10 | exit-vrf 11 | ! 12 | router bgp 65000 13 | bgp router-id 192.168.0.1 14 | no bgp hard-administrative-reset 15 | no bgp default ipv4-unicast 16 | coalesce-time 1000 17 | no bgp graceful-restart notification 18 | neighbor VTEP peer-group 19 | neighbor VTEP remote-as 65000 20 | neighbor VTEP bfd 21 | neighbor 192.168.0.2 peer-group VTEP 22 | neighbor 192.168.0.3 peer-group VTEP 23 | ! 24 | address-family l2vpn evpn 25 | neighbor VTEP activate 26 | neighbor VTEP route-map MAP_VTEP_IN in 27 | neighbor VTEP route-map MAP_VTEP_OUT out 28 | advertise-all-vni 29 | exit-address-family 30 | exit 31 | ! 32 | router bgp 65000 vrf vrf_myzone 33 | bgp router-id 192.168.0.1 34 | no bgp hard-administrative-reset 35 | no bgp graceful-restart notification 36 | ! 37 | address-family l2vpn evpn 38 | route-target import 65001:1000 39 | route-target import 65002:1000 40 | route-target import 65003:1000 41 | exit-address-family 42 | exit 43 | ! 44 | route-map MAP_VTEP_IN permit 1 45 | exit 46 | ! 47 | route-map MAP_VTEP_OUT permit 1 48 | exit 49 | ! 50 | line vty 51 | ! -------------------------------------------------------------------------------- /src/test/zones/evpn/rt_import/expected_sdn_interfaces: -------------------------------------------------------------------------------- 1 | #version:1 2 | 3 | auto myvnet 4 | iface myvnet 5 | address 10.0.0.1/24 6 | hwaddress A2:1D:CB:1A:C0:8B 7 | bridge_ports vxlan_myvnet 8 | bridge_stp off 9 | bridge_fd 0 10 | mtu 1450 11 | ip-forward on 12 | arp-accept on 13 | vrf vrf_myzone 14 | 15 | auto vrf_myzone 16 | iface vrf_myzone 17 | vrf-table auto 18 | post-up ip route add vrf vrf_myzone unreachable default metric 4278198272 19 | 20 | auto vrfbr_myzone 21 | iface vrfbr_myzone 22 | bridge-ports vrfvx_myzone 23 | bridge_stp off 24 | bridge_fd 0 25 | mtu 1450 26 | vrf vrf_myzone 27 | 28 | auto vrfvx_myzone 29 | iface vrfvx_myzone 30 | vxlan-id 1000 31 | vxlan-local-tunnelip 192.168.0.1 32 | bridge-learning off 33 | bridge-arp-nd-suppress on 34 | mtu 1450 35 | 36 | auto vxlan_myvnet 37 | iface vxlan_myvnet 38 | vxlan-id 100 39 | vxlan-local-tunnelip 192.168.0.1 40 | bridge-learning off 41 | bridge-arp-nd-suppress on 42 | mtu 1450 43 | -------------------------------------------------------------------------------- /src/test/zones/evpn/rt_import/interfaces: -------------------------------------------------------------------------------- 1 | auto vmbr0 2 | iface vmbr0 inet static 3 | address 192.168.0.1/24 4 | gateway 192.168.0.254 5 | bridge-ports eth0 6 | bridge-stp off 7 | bridge-fd 0 8 | -------------------------------------------------------------------------------- /src/test/zones/evpn/rt_import/sdn_config: -------------------------------------------------------------------------------- 1 | { 2 | version => 1, 3 | vnets => { 4 | ids => { 5 | myvnet => { tag => "100", type => "vnet", zone => "myzone" }, 6 | }, 7 | }, 8 | 9 | zones => { 10 | ids => { myzone => { ipam => "pve", type => "evpn", controller => "evpnctl", 'vrf-vxlan' => 1000, 'mac' => 'A2:1D:CB:1A:C0:8B', 'rt-import' => '65001:1000,65002:1000,65003:1000' } }, 11 | }, 12 | controllers => { 13 | ids => { evpnctl => { type => "evpn", 'peers' => '192.168.0.1,192.168.0.2,192.168.0.3', asn => "65000" } }, 14 | }, 15 | 16 | subnets => { 17 | ids => { 'myzone-10.0.0.0-24' => { 18 | 'type' => 'subnet', 19 | 'vnet' => 'myvnet', 20 | 'gateway' => '10.0.0.1', 21 | } 22 | } 23 | } 24 | } 25 | 26 | 27 | -------------------------------------------------------------------------------- /src/test/zones/evpn/vxlanport/expected_controller_config: -------------------------------------------------------------------------------- 1 | frr version 8.5.2 2 | frr defaults datacenter 3 | hostname localhost 4 | log syslog informational 5 | service integrated-vtysh-config 6 | ! 7 | ! 8 | vrf vrf_myzone 9 | vni 1000 10 | exit-vrf 11 | ! 12 | router bgp 65000 13 | bgp router-id 192.168.0.1 14 | no bgp hard-administrative-reset 15 | no bgp default ipv4-unicast 16 | coalesce-time 1000 17 | no bgp graceful-restart notification 18 | neighbor VTEP peer-group 19 | neighbor VTEP remote-as 65000 20 | neighbor VTEP bfd 21 | neighbor 192.168.0.2 peer-group VTEP 22 | neighbor 192.168.0.3 peer-group VTEP 23 | ! 24 | address-family l2vpn evpn 25 | neighbor VTEP activate 26 | neighbor VTEP route-map MAP_VTEP_IN in 27 | neighbor VTEP route-map MAP_VTEP_OUT out 28 | advertise-all-vni 29 | exit-address-family 30 | exit 31 | ! 32 | router bgp 65000 vrf vrf_myzone 33 | bgp router-id 192.168.0.1 34 | no bgp hard-administrative-reset 35 | no bgp graceful-restart notification 36 | exit 37 | ! 38 | route-map MAP_VTEP_IN permit 1 39 | exit 40 | ! 41 | route-map MAP_VTEP_OUT permit 1 42 | exit 43 | ! 44 | line vty 45 | ! -------------------------------------------------------------------------------- /src/test/zones/evpn/vxlanport/expected_sdn_interfaces: -------------------------------------------------------------------------------- 1 | #version:1 2 | 3 | auto myvnet 4 | iface myvnet 5 | address 10.0.0.1/24 6 | hwaddress A2:1D:CB:1A:C0:8B 7 | bridge_ports vxlan_myvnet 8 | bridge_stp off 9 | bridge_fd 0 10 | mtu 1450 11 | ip-forward on 12 | arp-accept on 13 | vrf vrf_myzone 14 | 15 | auto vrf_myzone 16 | iface vrf_myzone 17 | vrf-table auto 18 | post-up ip route add vrf vrf_myzone unreachable default metric 4278198272 19 | 20 | auto vrfbr_myzone 21 | iface vrfbr_myzone 22 | bridge-ports vrfvx_myzone 23 | bridge_stp off 24 | bridge_fd 0 25 | mtu 1450 26 | vrf vrf_myzone 27 | 28 | auto vrfvx_myzone 29 | iface vrfvx_myzone 30 | vxlan-id 1000 31 | vxlan-local-tunnelip 192.168.0.1 32 | vxlan-port 6000 33 | bridge-learning off 34 | bridge-arp-nd-suppress on 35 | mtu 1450 36 | 37 | auto vxlan_myvnet 38 | iface vxlan_myvnet 39 | vxlan-id 100 40 | vxlan-local-tunnelip 192.168.0.1 41 | vxlan-port 6000 42 | bridge-learning off 43 | bridge-arp-nd-suppress on 44 | mtu 1450 45 | -------------------------------------------------------------------------------- /src/test/zones/evpn/vxlanport/interfaces: -------------------------------------------------------------------------------- 1 | auto vmbr0 2 | iface vmbr0 inet static 3 | address 192.168.0.1/24 4 | gateway 192.168.0.254 5 | bridge-ports eth0 6 | bridge-stp off 7 | bridge-fd 0 8 | -------------------------------------------------------------------------------- /src/test/zones/evpn/vxlanport/sdn_config: -------------------------------------------------------------------------------- 1 | { 2 | version => 1, 3 | vnets => { 4 | ids => { 5 | myvnet => { tag => "100", type => "vnet", zone => "myzone" }, 6 | }, 7 | }, 8 | 9 | zones => { 10 | ids => { myzone => { ipam => "pve", type => "evpn", controller => "evpnctl", 'vxlan-port' => 6000, 'vrf-vxlan' => 1000, 'mac' => 'A2:1D:CB:1A:C0:8B' } }, 11 | }, 12 | controllers => { 13 | ids => { evpnctl => { type => "evpn", 'peers' => '192.168.0.1,192.168.0.2,192.168.0.3', asn => "65000" } }, 14 | }, 15 | 16 | subnets => { 17 | ids => { 'myzone-10.0.0.0-24' => { 18 | 'type' => 'subnet', 19 | 'vnet' => 'myvnet', 20 | 'gateway' => '10.0.0.1', 21 | } 22 | } 23 | } 24 | } 25 | 26 | 27 | -------------------------------------------------------------------------------- /src/test/zones/qinq/bridge/expected_sdn_interfaces: -------------------------------------------------------------------------------- 1 | #version:1 2 | 3 | auto ln_myzone 4 | iface ln_myzone 5 | link-type veth 6 | veth-peer-name pr_myzone 7 | 8 | auto ln_myzone2 9 | iface ln_myzone2 10 | link-type veth 11 | veth-peer-name pr_myzone2 12 | 13 | auto myvnet 14 | iface myvnet 15 | bridge_ports z_myzone.100 16 | bridge_stp off 17 | bridge_fd 0 18 | 19 | auto myvnet2 20 | iface myvnet2 21 | bridge_ports z_myzone.101 22 | bridge_stp off 23 | bridge_fd 0 24 | 25 | auto myvnet3 26 | iface myvnet3 27 | bridge_ports z_myzone2.100 28 | bridge_stp off 29 | bridge_fd 0 30 | 31 | auto pr_myzone 32 | iface pr_myzone 33 | link-type veth 34 | veth-peer-name ln_myzone 35 | 36 | auto pr_myzone2 37 | iface pr_myzone2 38 | link-type veth 39 | veth-peer-name ln_myzone2 40 | 41 | auto sv_myzone 42 | iface sv_myzone 43 | vlan-raw-device eth0 44 | vlan-id 10 45 | 46 | auto sv_myzone2 47 | iface sv_myzone2 48 | vlan-raw-device eth0 49 | vlan-id 20 50 | 51 | auto z_myzone 52 | iface z_myzone 53 | bridge-stp off 54 | bridge-ports sv_myzone ln_myzone 55 | bridge-fd 0 56 | bridge-vlan-aware yes 57 | bridge-vids 2-4094 58 | 59 | auto z_myzone2 60 | iface z_myzone2 61 | bridge-stp off 62 | bridge-ports sv_myzone2 ln_myzone2 63 | bridge-fd 0 64 | bridge-vlan-aware yes 65 | bridge-vids 2-4094 66 | -------------------------------------------------------------------------------- /src/test/zones/qinq/bridge/interfaces: -------------------------------------------------------------------------------- 1 | auto vmbr0 2 | iface vmbr0 inet manual 3 | bridge-ports eth0 4 | bridge-stp off 5 | bridge-fd 0 6 | -------------------------------------------------------------------------------- /src/test/zones/qinq/bridge/sdn_config: -------------------------------------------------------------------------------- 1 | { 2 | version => 1, 3 | vnets => { 4 | ids => { 5 | myvnet => { tag => 100, type => "vnet", zone => "myzone" }, 6 | myvnet2 => { tag => 101, type => "vnet", zone => "myzone" }, 7 | myvnet3 => { tag => 100, type => "vnet", zone => "myzone2" }, 8 | }, 9 | }, 10 | zones => { 11 | ids => { 12 | myzone => { bridge => "vmbr0", tag => 10, ipam => "pve", type => "qinq" }, 13 | myzone2 => { bridge => "vmbr0", tag => 20, ipam => "pve", type => "qinq" }, 14 | }, 15 | }, 16 | } 17 | -------------------------------------------------------------------------------- /src/test/zones/qinq/bridge_notagvnet/expected_sdn_interfaces: -------------------------------------------------------------------------------- 1 | #version:1 2 | 3 | auto ln_myzone 4 | iface ln_myzone 5 | link-type veth 6 | veth-peer-name pr_myzone 7 | 8 | auto myvnet 9 | iface myvnet 10 | bridge_ports z_myzone.100 11 | bridge_stp off 12 | bridge_fd 0 13 | 14 | auto myvnet2 15 | iface myvnet2 16 | bridge_ports pr_myzone 17 | bridge_stp off 18 | bridge_fd 0 19 | 20 | auto pr_myzone 21 | iface pr_myzone 22 | link-type veth 23 | veth-peer-name ln_myzone 24 | 25 | auto sv_myzone 26 | iface sv_myzone 27 | vlan-raw-device eth0 28 | vlan-id 10 29 | 30 | auto z_myzone 31 | iface z_myzone 32 | bridge-stp off 33 | bridge-ports sv_myzone ln_myzone 34 | bridge-fd 0 35 | bridge-vlan-aware yes 36 | bridge-vids 2-4094 37 | -------------------------------------------------------------------------------- /src/test/zones/qinq/bridge_notagvnet/interfaces: -------------------------------------------------------------------------------- 1 | auto vmbr0 2 | iface vmbr0 inet manual 3 | bridge-ports eth0 4 | bridge-stp off 5 | bridge-fd 0 6 | -------------------------------------------------------------------------------- /src/test/zones/qinq/bridge_notagvnet/sdn_config: -------------------------------------------------------------------------------- 1 | { 2 | version => 1, 3 | vnets => { 4 | ids => { 5 | myvnet => { 6 | tag => 100, 7 | type => "vnet", 8 | zone => "myzone" 9 | }, 10 | myvnet2 => { 11 | type => "vnet", 12 | zone => "myzone" 13 | }, 14 | }, 15 | }, 16 | zones => { 17 | ids => { 18 | myzone => { 19 | bridge => "vmbr0", 20 | tag => 10, 21 | ipam => "pve", 22 | type => "qinq", 23 | }, 24 | }, 25 | }, 26 | } 27 | -------------------------------------------------------------------------------- /src/test/zones/qinq/bridge_vlanaware/expected_sdn_interfaces: -------------------------------------------------------------------------------- 1 | #version:1 2 | 3 | auto ln_myzone 4 | iface ln_myzone 5 | link-type veth 6 | veth-peer-name pr_myzone 7 | 8 | auto ln_myzone2 9 | iface ln_myzone2 10 | link-type veth 11 | veth-peer-name pr_myzone2 12 | 13 | auto myvnet 14 | iface myvnet 15 | bridge_ports z_myzone.100 16 | bridge_stp off 17 | bridge_fd 0 18 | 19 | auto myvnet2 20 | iface myvnet2 21 | bridge_ports z_myzone.101 22 | bridge_stp off 23 | bridge_fd 0 24 | 25 | auto myvnet3 26 | iface myvnet3 27 | bridge_ports z_myzone2.100 28 | bridge_stp off 29 | bridge_fd 0 30 | 31 | auto pr_myzone 32 | iface pr_myzone 33 | link-type veth 34 | veth-peer-name ln_myzone 35 | 36 | auto pr_myzone2 37 | iface pr_myzone2 38 | link-type veth 39 | veth-peer-name ln_myzone2 40 | 41 | auto z_myzone 42 | iface z_myzone 43 | bridge-stp off 44 | bridge-ports vmbr0.10 ln_myzone 45 | bridge-fd 0 46 | bridge-vlan-aware yes 47 | bridge-vids 2-4094 48 | 49 | auto z_myzone2 50 | iface z_myzone2 51 | bridge-stp off 52 | bridge-ports vmbr0.20 ln_myzone2 53 | bridge-fd 0 54 | bridge-vlan-aware yes 55 | bridge-vids 2-4094 56 | -------------------------------------------------------------------------------- /src/test/zones/qinq/bridge_vlanaware/interfaces: -------------------------------------------------------------------------------- 1 | auto vmbr0 2 | iface vmbr0 inet manual 3 | bridge-ports eth0 4 | bridge-stp off 5 | bridge-fd 0 6 | bridge-vids 2-4094 7 | bridge-vlan-aware 1 8 | -------------------------------------------------------------------------------- /src/test/zones/qinq/bridge_vlanaware/sdn_config: -------------------------------------------------------------------------------- 1 | { 2 | version => 1, 3 | vnets => { 4 | ids => { 5 | myvnet => { tag => 100, type => "vnet", zone => "myzone" }, 6 | myvnet2 => { tag => 101, type => "vnet", zone => "myzone" }, 7 | myvnet3 => { tag => 100, type => "vnet", zone => "myzone2" }, 8 | }, 9 | }, 10 | zones => { 11 | ids => { 12 | myzone => { bridge => "vmbr0", tag => 10, ipam => "pve", type => "qinq" }, 13 | myzone2 => { bridge => "vmbr0", tag => 20, ipam => "pve", type => "qinq" }, 14 | }, 15 | }, 16 | } 17 | -------------------------------------------------------------------------------- /src/test/zones/qinq/bridge_vlanaware_notagvnet/expected_sdn_interfaces: -------------------------------------------------------------------------------- 1 | #version:1 2 | 3 | auto ln_myzone 4 | iface ln_myzone 5 | link-type veth 6 | veth-peer-name pr_myzone 7 | 8 | auto myvnet 9 | iface myvnet 10 | bridge_ports pr_myzone 11 | bridge_stp off 12 | bridge_fd 0 13 | bridge-vlan-aware yes 14 | bridge-vids 2-4094 15 | 16 | auto pr_myzone 17 | iface pr_myzone 18 | link-type veth 19 | veth-peer-name ln_myzone 20 | 21 | auto z_myzone 22 | iface z_myzone 23 | bridge-stp off 24 | bridge-ports vmbr0.10 ln_myzone 25 | bridge-fd 0 26 | bridge-vlan-aware yes 27 | bridge-vids 2-4094 28 | -------------------------------------------------------------------------------- /src/test/zones/qinq/bridge_vlanaware_notagvnet/interfaces: -------------------------------------------------------------------------------- 1 | auto vmbr0 2 | iface vmbr0 inet manual 3 | bridge-ports eth0 4 | bridge-stp off 5 | bridge-fd 0 6 | bridge-vids 2-4094 7 | bridge-vlan-aware 1 8 | -------------------------------------------------------------------------------- /src/test/zones/qinq/bridge_vlanaware_notagvnet/sdn_config: -------------------------------------------------------------------------------- 1 | { 2 | version => 1, 3 | vnets => { 4 | ids => { 5 | myvnet => { type => "vnet", vlanaware => "1", zone => "myzone" }, 6 | }, 7 | }, 8 | zones => { 9 | ids => { myzone => { bridge => "vmbr0", tag => 10, ipam => "pve", type => "qinq" } }, 10 | }, 11 | } 12 | -------------------------------------------------------------------------------- /src/test/zones/qinq/bridge_vlanaware_vlanawarevnet/expected_sdn_interfaces: -------------------------------------------------------------------------------- 1 | #version:1 2 | 3 | auto ln_myzone 4 | iface ln_myzone 5 | link-type veth 6 | veth-peer-name pr_myzone 7 | 8 | auto myvnet 9 | iface myvnet 10 | bridge_ports z_myzone.100 11 | bridge_stp off 12 | bridge_fd 0 13 | bridge-vlan-aware yes 14 | bridge-vids 2-4094 15 | 16 | auto pr_myzone 17 | iface pr_myzone 18 | link-type veth 19 | veth-peer-name ln_myzone 20 | 21 | auto z_myzone 22 | iface z_myzone 23 | bridge-stp off 24 | bridge-ports vmbr0.10 ln_myzone 25 | bridge-fd 0 26 | bridge-vlan-aware yes 27 | bridge-vids 2-4094 28 | -------------------------------------------------------------------------------- /src/test/zones/qinq/bridge_vlanaware_vlanawarevnet/interfaces: -------------------------------------------------------------------------------- 1 | auto vmbr0 2 | iface vmbr0 inet manual 3 | bridge-ports eth0 4 | bridge-stp off 5 | bridge-fd 0 6 | bridge-vids 2-4094 7 | bridge-vlan-aware 1 8 | -------------------------------------------------------------------------------- /src/test/zones/qinq/bridge_vlanaware_vlanawarevnet/sdn_config: -------------------------------------------------------------------------------- 1 | { 2 | version => 1, 3 | vnets => { 4 | ids => { 5 | myvnet => { tag => 100, type => "vnet", vlanaware => "1", zone => "myzone" }, 6 | }, 7 | }, 8 | zones => { 9 | ids => { myzone => { bridge => "vmbr0", tag => 10, ipam => "pve", type => "qinq" } }, 10 | }, 11 | } 12 | -------------------------------------------------------------------------------- /src/test/zones/qinq/bridge_vlanaware_vlanprotocol/expected_sdn_interfaces: -------------------------------------------------------------------------------- 1 | #version:1 2 | 3 | auto ln_myzone 4 | iface ln_myzone 5 | link-type veth 6 | veth-peer-name pr_myzone 7 | 8 | auto myvnet 9 | iface myvnet 10 | bridge_ports z_myzone.100 11 | bridge_stp off 12 | bridge_fd 0 13 | 14 | auto pr_myzone 15 | iface pr_myzone 16 | link-type veth 17 | veth-peer-name ln_myzone 18 | 19 | auto vmbr0 20 | iface vmbr0 21 | bridge-vlan-protocol 802.1ad 22 | 23 | auto vmbr0.10 24 | iface vmbr0.10 25 | vlan-protocol 802.1ad 26 | 27 | auto z_myzone 28 | iface z_myzone 29 | bridge-stp off 30 | bridge-ports vmbr0.10 ln_myzone 31 | bridge-fd 0 32 | bridge-vlan-aware yes 33 | bridge-vids 2-4094 34 | -------------------------------------------------------------------------------- /src/test/zones/qinq/bridge_vlanaware_vlanprotocol/interfaces: -------------------------------------------------------------------------------- 1 | auto vmbr0 2 | iface vmbr0 inet manual 3 | bridge-ports eth0 4 | bridge-stp off 5 | bridge-fd 0 6 | bridge-vids 2-4094 7 | bridge-vlan-aware 1 8 | -------------------------------------------------------------------------------- /src/test/zones/qinq/bridge_vlanaware_vlanprotocol/sdn_config: -------------------------------------------------------------------------------- 1 | { 2 | version => 1, 3 | vnets => { 4 | ids => { 5 | myvnet => { tag => 100, type => "vnet", zone => "myzone" }, 6 | }, 7 | }, 8 | zones => { 9 | ids => { myzone => { bridge => "vmbr0", tag => 10, 'vlan-protocol' => '802.1ad', ipam => "pve", type => "qinq" } }, 10 | }, 11 | } 12 | -------------------------------------------------------------------------------- /src/test/zones/qinq/bridge_vlanawarevnet/expected_sdn_interfaces: -------------------------------------------------------------------------------- 1 | #version:1 2 | 3 | auto ln_myzone 4 | iface ln_myzone 5 | link-type veth 6 | veth-peer-name pr_myzone 7 | 8 | auto myvnet 9 | iface myvnet 10 | bridge_ports z_myzone.100 11 | bridge_stp off 12 | bridge_fd 0 13 | bridge-vlan-aware yes 14 | bridge-vids 2-4094 15 | 16 | auto pr_myzone 17 | iface pr_myzone 18 | link-type veth 19 | veth-peer-name ln_myzone 20 | 21 | auto sv_myzone 22 | iface sv_myzone 23 | vlan-raw-device eth0 24 | vlan-id 10 25 | 26 | auto z_myzone 27 | iface z_myzone 28 | bridge-stp off 29 | bridge-ports sv_myzone ln_myzone 30 | bridge-fd 0 31 | bridge-vlan-aware yes 32 | bridge-vids 2-4094 33 | -------------------------------------------------------------------------------- /src/test/zones/qinq/bridge_vlanawarevnet/interfaces: -------------------------------------------------------------------------------- 1 | auto vmbr0 2 | iface vmbr0 inet manual 3 | bridge-ports eth0 4 | bridge-stp off 5 | bridge-fd 0 6 | -------------------------------------------------------------------------------- /src/test/zones/qinq/bridge_vlanawarevnet/sdn_config: -------------------------------------------------------------------------------- 1 | { 2 | version => 1, 3 | vnets => { 4 | ids => { 5 | myvnet => { tag => 100, type => "vnet", vlanaware => "1", zone => "myzone" }, 6 | }, 7 | }, 8 | zones => { 9 | ids => { myzone => { bridge => "vmbr0", tag => 10, ipam => "pve", type => "qinq" } }, 10 | }, 11 | } 12 | -------------------------------------------------------------------------------- /src/test/zones/qinq/bridge_vlanprotocol/expected_sdn_interfaces: -------------------------------------------------------------------------------- 1 | #version:1 2 | 3 | auto ln_myzone 4 | iface ln_myzone 5 | link-type veth 6 | veth-peer-name pr_myzone 7 | 8 | auto myvnet 9 | iface myvnet 10 | bridge_ports z_myzone.100 11 | bridge_stp off 12 | bridge_fd 0 13 | 14 | auto pr_myzone 15 | iface pr_myzone 16 | link-type veth 17 | veth-peer-name ln_myzone 18 | 19 | auto sv_myzone 20 | iface sv_myzone 21 | vlan-raw-device eth0 22 | vlan-id 10 23 | vlan-protocol 802.1ad 24 | 25 | auto z_myzone 26 | iface z_myzone 27 | bridge-stp off 28 | bridge-ports sv_myzone ln_myzone 29 | bridge-fd 0 30 | bridge-vlan-aware yes 31 | bridge-vids 2-4094 32 | -------------------------------------------------------------------------------- /src/test/zones/qinq/bridge_vlanprotocol/interfaces: -------------------------------------------------------------------------------- 1 | auto vmbr0 2 | iface vmbr0 inet manual 3 | bridge-ports eth0 4 | bridge-stp off 5 | bridge-fd 0 6 | -------------------------------------------------------------------------------- /src/test/zones/qinq/bridge_vlanprotocol/sdn_config: -------------------------------------------------------------------------------- 1 | { 2 | version => 1, 3 | vnets => { 4 | ids => { 5 | myvnet => { tag => 100, type => "vnet", zone => "myzone" }, 6 | }, 7 | }, 8 | zones => { 9 | ids => { myzone => { bridge => "vmbr0", tag => 10, 'vlan-protocol' => '802.1ad', ipam => "pve", type => "qinq" } }, 10 | }, 11 | } 12 | -------------------------------------------------------------------------------- /src/test/zones/qinq/ovs/expected_sdn_interfaces: -------------------------------------------------------------------------------- 1 | #version:1 2 | 3 | auto ln_myzone 4 | iface ln_myzone 5 | link-type veth 6 | veth-peer-name pr_myzone 7 | 8 | auto ln_myzone2 9 | iface ln_myzone2 10 | link-type veth 11 | veth-peer-name pr_myzone2 12 | 13 | auto myvnet 14 | iface myvnet 15 | bridge_ports z_myzone.100 16 | bridge_stp off 17 | bridge_fd 0 18 | 19 | auto myvnet2 20 | iface myvnet2 21 | bridge_ports z_myzone.101 22 | bridge_stp off 23 | bridge_fd 0 24 | 25 | auto myvnet3 26 | iface myvnet3 27 | bridge_ports z_myzone2.100 28 | bridge_stp off 29 | bridge_fd 0 30 | 31 | auto pr_myzone 32 | iface pr_myzone 33 | link-type veth 34 | veth-peer-name ln_myzone 35 | 36 | auto pr_myzone2 37 | iface pr_myzone2 38 | link-type veth 39 | veth-peer-name ln_myzone2 40 | 41 | auto sv_myzone 42 | iface sv_myzone 43 | ovs_type OVSIntPort 44 | ovs_bridge vmbr0 45 | ovs_options vlan_mode=dot1q-tunnel tag=10 other_config:qinq-ethtype=802.1q 46 | 47 | auto sv_myzone2 48 | iface sv_myzone2 49 | ovs_type OVSIntPort 50 | ovs_bridge vmbr0 51 | ovs_options vlan_mode=dot1q-tunnel tag=20 other_config:qinq-ethtype=802.1q 52 | 53 | auto vmbr0 54 | iface vmbr0 55 | ovs_ports sv_myzone sv_myzone2 56 | 57 | auto z_myzone 58 | iface z_myzone 59 | bridge-stp off 60 | bridge-ports sv_myzone ln_myzone 61 | bridge-fd 0 62 | bridge-vlan-aware yes 63 | bridge-vids 2-4094 64 | 65 | auto z_myzone2 66 | iface z_myzone2 67 | bridge-stp off 68 | bridge-ports sv_myzone2 ln_myzone2 69 | bridge-fd 0 70 | bridge-vlan-aware yes 71 | bridge-vids 2-4094 72 | -------------------------------------------------------------------------------- /src/test/zones/qinq/ovs/interfaces: -------------------------------------------------------------------------------- 1 | auto eth0 2 | iface eth0 inet manual 3 | ovs_type OVSPort 4 | ovs_bridge vmbr0 5 | 6 | auto vmbr0 7 | iface vmbr0 inet manual 8 | ovs_type OVSBridge 9 | ovs_ports eth0 10 | -------------------------------------------------------------------------------- /src/test/zones/qinq/ovs/sdn_config: -------------------------------------------------------------------------------- 1 | { 2 | version => 1, 3 | vnets => { 4 | ids => { 5 | myvnet => { tag => 100, type => "vnet", zone => "myzone" }, 6 | myvnet2 => { tag => 101, type => "vnet", zone => "myzone" }, 7 | myvnet3 => { tag => 100, type => "vnet", zone => "myzone2" }, 8 | }, 9 | }, 10 | zones => { 11 | ids => { 12 | myzone => { bridge => "vmbr0", tag => 10, ipam => "pve", type => "qinq" }, 13 | myzone2 => { bridge => "vmbr0", tag => 20, ipam => "pve", type => "qinq" }, 14 | }, 15 | }, 16 | } 17 | -------------------------------------------------------------------------------- /src/test/zones/qinq/ovs_notagvnet/expected_sdn_interfaces: -------------------------------------------------------------------------------- 1 | #version:1 2 | 3 | auto ln_myzone 4 | iface ln_myzone 5 | link-type veth 6 | veth-peer-name pr_myzone 7 | 8 | auto myvnet 9 | iface myvnet 10 | bridge_ports pr_myzone 11 | bridge_stp off 12 | bridge_fd 0 13 | bridge-vlan-aware yes 14 | bridge-vids 2-4094 15 | 16 | auto pr_myzone 17 | iface pr_myzone 18 | link-type veth 19 | veth-peer-name ln_myzone 20 | 21 | auto sv_myzone 22 | iface sv_myzone 23 | ovs_type OVSIntPort 24 | ovs_bridge vmbr0 25 | ovs_options vlan_mode=dot1q-tunnel tag=10 other_config:qinq-ethtype=802.1q 26 | 27 | auto vmbr0 28 | iface vmbr0 29 | ovs_ports sv_myzone 30 | 31 | auto z_myzone 32 | iface z_myzone 33 | bridge-stp off 34 | bridge-ports sv_myzone ln_myzone 35 | bridge-fd 0 36 | bridge-vlan-aware yes 37 | bridge-vids 2-4094 38 | -------------------------------------------------------------------------------- /src/test/zones/qinq/ovs_notagvnet/interfaces: -------------------------------------------------------------------------------- 1 | auto eth0 2 | iface eth0 inet manual 3 | ovs_type OVSPort 4 | ovs_bridge vmbr0 5 | 6 | auto vmbr0 7 | iface vmbr0 inet manual 8 | ovs_type OVSBridge 9 | ovs_ports eth0 10 | -------------------------------------------------------------------------------- /src/test/zones/qinq/ovs_notagvnet/sdn_config: -------------------------------------------------------------------------------- 1 | { 2 | version => 1, 3 | vnets => { 4 | ids => { 5 | myvnet => { type => "vnet", vlanaware => "1", zone => "myzone" }, 6 | }, 7 | }, 8 | zones => { 9 | ids => { myzone => { bridge => "vmbr0", tag => 10, ipam => "pve", type => "qinq" } }, 10 | }, 11 | } 12 | -------------------------------------------------------------------------------- /src/test/zones/qinq/ovs_vlanawarevnet/expected_sdn_interfaces: -------------------------------------------------------------------------------- 1 | #version:1 2 | 3 | auto ln_myzone 4 | iface ln_myzone 5 | link-type veth 6 | veth-peer-name pr_myzone 7 | 8 | auto myvnet 9 | iface myvnet 10 | bridge_ports z_myzone.100 11 | bridge_stp off 12 | bridge_fd 0 13 | bridge-vlan-aware yes 14 | bridge-vids 2-4094 15 | 16 | auto pr_myzone 17 | iface pr_myzone 18 | link-type veth 19 | veth-peer-name ln_myzone 20 | 21 | auto sv_myzone 22 | iface sv_myzone 23 | ovs_type OVSIntPort 24 | ovs_bridge vmbr0 25 | ovs_options vlan_mode=dot1q-tunnel tag=10 other_config:qinq-ethtype=802.1q 26 | 27 | auto vmbr0 28 | iface vmbr0 29 | ovs_ports sv_myzone 30 | 31 | auto z_myzone 32 | iface z_myzone 33 | bridge-stp off 34 | bridge-ports sv_myzone ln_myzone 35 | bridge-fd 0 36 | bridge-vlan-aware yes 37 | bridge-vids 2-4094 38 | -------------------------------------------------------------------------------- /src/test/zones/qinq/ovs_vlanawarevnet/interfaces: -------------------------------------------------------------------------------- 1 | auto eth0 2 | iface eth0 inet manual 3 | ovs_type OVSPort 4 | ovs_bridge vmbr0 5 | 6 | auto vmbr0 7 | iface vmbr0 inet manual 8 | ovs_type OVSBridge 9 | ovs_ports eth0 10 | -------------------------------------------------------------------------------- /src/test/zones/qinq/ovs_vlanawarevnet/sdn_config: -------------------------------------------------------------------------------- 1 | { 2 | version => 1, 3 | vnets => { 4 | ids => { 5 | myvnet => { tag => 100, type => "vnet", vlanaware => "1", zone => "myzone" }, 6 | }, 7 | }, 8 | zones => { 9 | ids => { myzone => { bridge => "vmbr0", tag => 10, ipam => "pve", type => "qinq" } }, 10 | }, 11 | } 12 | -------------------------------------------------------------------------------- /src/test/zones/qinq/ovs_vlanprotocol/expected_sdn_interfaces: -------------------------------------------------------------------------------- 1 | #version:1 2 | 3 | auto ln_myzone 4 | iface ln_myzone 5 | link-type veth 6 | veth-peer-name pr_myzone 7 | 8 | auto myvnet 9 | iface myvnet 10 | bridge_ports z_myzone.100 11 | bridge_stp off 12 | bridge_fd 0 13 | 14 | auto pr_myzone 15 | iface pr_myzone 16 | link-type veth 17 | veth-peer-name ln_myzone 18 | 19 | auto sv_myzone 20 | iface sv_myzone 21 | ovs_type OVSIntPort 22 | ovs_bridge vmbr0 23 | ovs_options vlan_mode=dot1q-tunnel tag=10 other_config:qinq-ethtype=802.1ad 24 | 25 | auto vmbr0 26 | iface vmbr0 27 | ovs_ports sv_myzone 28 | 29 | auto z_myzone 30 | iface z_myzone 31 | bridge-stp off 32 | bridge-ports sv_myzone ln_myzone 33 | bridge-fd 0 34 | bridge-vlan-aware yes 35 | bridge-vids 2-4094 36 | -------------------------------------------------------------------------------- /src/test/zones/qinq/ovs_vlanprotocol/interfaces: -------------------------------------------------------------------------------- 1 | auto eth0 2 | iface eth0 inet manual 3 | ovs_type OVSPort 4 | ovs_bridge vmbr0 5 | 6 | auto vmbr0 7 | iface vmbr0 inet manual 8 | ovs_type OVSBridge 9 | ovs_ports eth0 10 | -------------------------------------------------------------------------------- /src/test/zones/qinq/ovs_vlanprotocol/sdn_config: -------------------------------------------------------------------------------- 1 | { 2 | version => 1, 3 | vnets => { 4 | ids => { 5 | myvnet => { tag => 100, type => "vnet", zone => "myzone" }, 6 | }, 7 | }, 8 | zones => { 9 | ids => { myzone => { bridge => "vmbr0", tag => 10, 'vlan-protocol' => '802.1ad', ipam => "pve", type => "qinq" } }, 10 | }, 11 | } 12 | -------------------------------------------------------------------------------- /src/test/zones/simple/basic/expected_sdn_interfaces: -------------------------------------------------------------------------------- 1 | #version:1 2 | 3 | auto myvnet 4 | iface myvnet 5 | bridge_ports none 6 | bridge_stp off 7 | bridge_fd 0 8 | -------------------------------------------------------------------------------- /src/test/zones/simple/basic/interfaces: -------------------------------------------------------------------------------- 1 | auto vmbr0 2 | iface vmbr0 inet manual 3 | bridge-ports eth0 4 | bridge-stp off 5 | bridge-fd 0 6 | -------------------------------------------------------------------------------- /src/test/zones/simple/basic/sdn_config: -------------------------------------------------------------------------------- 1 | { 2 | version => 1, 3 | vnets => { 4 | ids => { 5 | myvnet => { type => "vnet", zone => "myzone" }, 6 | }, 7 | }, 8 | zones => { 9 | ids => { myzone => { ipam => "pve", type => "simple" } }, 10 | }, 11 | } 12 | -------------------------------------------------------------------------------- /src/test/zones/simple/hetzner/expected_sdn_interfaces: -------------------------------------------------------------------------------- 1 | #version:1 2 | 3 | auto myvnet 4 | iface myvnet 5 | address 144.76.100.65/29 6 | bridge_ports none 7 | bridge_stp off 8 | bridge_fd 0 9 | ip-forward on 10 | 11 | auto myvnet2 12 | iface myvnet2 13 | address 144.76.0.1/32 14 | up ip route add 144.76.200.65/32 dev myvnet2 15 | up ip route add 144.76.200.66/32 dev myvnet2 16 | bridge_ports none 17 | bridge_stp off 18 | bridge_fd 0 19 | ip-forward on 20 | -------------------------------------------------------------------------------- /src/test/zones/simple/hetzner/interfaces: -------------------------------------------------------------------------------- 1 | auto eth0 2 | iface eth0 inet static 3 | address 144.76.0.1 4 | netmask 255.255.255.255 5 | pointopoint 172.31.1.1 6 | gateway 172.31.1.1 -------------------------------------------------------------------------------- /src/test/zones/simple/hetzner/sdn_config: -------------------------------------------------------------------------------- 1 | { 2 | version => 1, 3 | vnets => { 4 | ids => { 5 | myvnet => { type => "vnet", zone => "myzone" }, 6 | myvnet2 => { type => "vnet", zone => "myzone" }, 7 | }, 8 | }, 9 | zones => { 10 | ids => { myzone => { ipam => "pve", type => "simple" } }, 11 | }, 12 | 13 | subnets => { 14 | ids => { 15 | 'myzone-144.76.100.64-29' => { 16 | 'type' => 'subnet', 17 | 'vnet' => 'myvnet', 18 | 'gateway' => '144.76.100.65', 19 | }, 20 | 'myzone-144.76.200.65-32' => { 21 | 'type' => 'subnet', 22 | 'vnet' => 'myvnet2', 23 | 'gateway' => '144.76.0.1', 24 | }, 25 | 'myzone-144.76.200.66-32' => { 26 | 'type' => 'subnet', 27 | 'vnet' => 'myvnet2', 28 | 'gateway' => '144.76.0.1', 29 | }, 30 | } 31 | } 32 | } 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/test/zones/simple/ipv4/expected_sdn_interfaces: -------------------------------------------------------------------------------- 1 | #version:1 2 | 3 | auto myvnet 4 | iface myvnet 5 | address 192.168.0.1/24 6 | bridge_ports none 7 | bridge_stp off 8 | bridge_fd 0 9 | ip-forward on 10 | -------------------------------------------------------------------------------- /src/test/zones/simple/ipv4/interfaces: -------------------------------------------------------------------------------- 1 | auto vmbr0 2 | iface vmbr0 inet manual 3 | bridge-ports eth0 4 | bridge-stp off 5 | bridge-fd 0 6 | -------------------------------------------------------------------------------- /src/test/zones/simple/ipv4/sdn_config: -------------------------------------------------------------------------------- 1 | { 2 | version => 1, 3 | vnets => { 4 | ids => { 5 | myvnet => { type => "vnet", zone => "myzone" }, 6 | }, 7 | }, 8 | zones => { 9 | ids => { myzone => { ipam => "pve", type => "simple" } }, 10 | }, 11 | 12 | subnets => { 13 | ids => { 'myzone-192.168.0.0-24' => { 14 | 'type' => 'subnet', 15 | 'vnet' => 'myvnet', 16 | 'gateway' => '192.168.0.1', 17 | } 18 | } 19 | } 20 | } 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/test/zones/simple/ipv4snat/expected_sdn_interfaces: -------------------------------------------------------------------------------- 1 | #version:1 2 | 3 | auto myvnet 4 | iface myvnet 5 | address 10.0.0.1/24 6 | post-up iptables -t nat -A POSTROUTING -s '10.0.0.0/24' -o vmbr0 -j SNAT --to-source 192.168.0.1 7 | post-down iptables -t nat -D POSTROUTING -s '10.0.0.0/24' -o vmbr0 -j SNAT --to-source 192.168.0.1 8 | post-up iptables -t raw -I PREROUTING -i fwbr+ -j CT --zone 1 9 | post-down iptables -t raw -D PREROUTING -i fwbr+ -j CT --zone 1 10 | bridge_ports none 11 | bridge_stp off 12 | bridge_fd 0 13 | ip-forward on 14 | -------------------------------------------------------------------------------- /src/test/zones/simple/ipv4snat/interfaces: -------------------------------------------------------------------------------- 1 | auto vmbr0 2 | iface vmbr0 inet static 3 | address 192.168.0.1/24 4 | gateway 192.168.0.254 5 | bridge-ports eth0 6 | bridge-stp off 7 | bridge-fd 0 8 | -------------------------------------------------------------------------------- /src/test/zones/simple/ipv4snat/sdn_config: -------------------------------------------------------------------------------- 1 | { 2 | version => 1, 3 | vnets => { 4 | ids => { 5 | myvnet => { type => "vnet", zone => "myzone" }, 6 | }, 7 | }, 8 | zones => { 9 | ids => { myzone => { ipam => "pve", type => "simple" } }, 10 | }, 11 | 12 | subnets => { 13 | ids => { 'myzone-10.0.0.0-24' => { 14 | 'type' => 'subnet', 15 | 'vnet' => 'myvnet', 16 | 'gateway' => '10.0.0.1', 17 | 'snat' => 1 18 | } 19 | } 20 | } 21 | } 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/test/zones/simple/ipv4v6/expected_sdn_interfaces: -------------------------------------------------------------------------------- 1 | #version:1 2 | 3 | auto myvnet 4 | iface myvnet 5 | address 192.168.0.1/24 6 | address 2a08:2142:302:3::1/64 7 | bridge_ports none 8 | bridge_stp off 9 | bridge_fd 0 10 | ip-forward on 11 | ip6-forward on 12 | -------------------------------------------------------------------------------- /src/test/zones/simple/ipv4v6/interfaces: -------------------------------------------------------------------------------- 1 | auto vmbr0 2 | iface vmbr0 inet manual 3 | bridge-ports eth0 4 | bridge-stp off 5 | bridge-fd 0 6 | -------------------------------------------------------------------------------- /src/test/zones/simple/ipv4v6/sdn_config: -------------------------------------------------------------------------------- 1 | { 2 | version => 1, 3 | vnets => { 4 | ids => { 5 | myvnet => { type => "vnet", zone => "myzone" }, 6 | }, 7 | }, 8 | zones => { 9 | ids => { myzone => { ipam => "pve", type => "simple" } }, 10 | }, 11 | subnets => { 12 | ids => { 13 | 'myzone-192.168.0.0-24' => { 14 | 'type' => 'subnet', 15 | 'vnet' => 'myvnet', 16 | 'gateway' => '192.168.0.1', 17 | }, 18 | 'myzone-2a08:2142:302:3::-64' => { 19 | 'type' => 'subnet', 20 | 'vnet' => 'myvnet', 21 | 'gateway' => '2a08:2142:302:3::1', 22 | } 23 | } 24 | } 25 | } 26 | 27 | 28 | -------------------------------------------------------------------------------- /src/test/zones/simple/ipv4v6nogateway/expected_sdn_interfaces: -------------------------------------------------------------------------------- 1 | #version:1 2 | 3 | auto myvnet 4 | iface myvnet 5 | bridge_ports none 6 | bridge_stp off 7 | bridge_fd 0 8 | -------------------------------------------------------------------------------- /src/test/zones/simple/ipv4v6nogateway/interfaces: -------------------------------------------------------------------------------- 1 | auto vmbr0 2 | iface vmbr0 inet manual 3 | bridge-ports eth0 4 | bridge-stp off 5 | bridge-fd 0 6 | -------------------------------------------------------------------------------- /src/test/zones/simple/ipv4v6nogateway/sdn_config: -------------------------------------------------------------------------------- 1 | { 2 | version => 1, 3 | vnets => { 4 | ids => { 5 | myvnet => { type => "vnet", zone => "myzone" }, 6 | }, 7 | }, 8 | zones => { 9 | ids => { myzone => { ipam => "pve", type => "simple" } }, 10 | }, 11 | subnets => { 12 | ids => { 13 | 'myzone-192.168.0.0-24' => { 14 | 'type' => 'subnet', 15 | 'vnet' => 'myvnet', 16 | }, 17 | 'myzone-2a08:2142:302:3::-64' => { 18 | 'type' => 'subnet', 19 | 'vnet' => 'myvnet', 20 | } 21 | } 22 | } 23 | } 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/test/zones/simple/ipv6snat/expected_sdn_interfaces: -------------------------------------------------------------------------------- 1 | #version:1 2 | 3 | auto myvnet 4 | iface myvnet 5 | address 2a08:2142:302:3::1/64 6 | post-up ip6tables -t nat -A POSTROUTING -s '2a08:2142:302:3::/64' -o vmbr0 -j SNAT --to-source 192.168.0.1 7 | post-down ip6tables -t nat -D POSTROUTING -s '2a08:2142:302:3::/64' -o vmbr0 -j SNAT --to-source 192.168.0.1 8 | post-up ip6tables -t raw -I PREROUTING -i fwbr+ -j CT --zone 1 9 | post-down ip6tables -t raw -D PREROUTING -i fwbr+ -j CT --zone 1 10 | bridge_ports none 11 | bridge_stp off 12 | bridge_fd 0 13 | ip6-forward on 14 | -------------------------------------------------------------------------------- /src/test/zones/simple/ipv6snat/interfaces: -------------------------------------------------------------------------------- 1 | auto vmbr0 2 | iface vmbr0 inet static 3 | address 192.168.0.1/24 4 | gateway 192.168.0.254 5 | bridge-ports eth0 6 | bridge-stp off 7 | bridge-fd 0 8 | -------------------------------------------------------------------------------- /src/test/zones/simple/ipv6snat/sdn_config: -------------------------------------------------------------------------------- 1 | { 2 | version => 1, 3 | vnets => { 4 | ids => { 5 | myvnet => { type => "vnet", zone => "myzone" }, 6 | }, 7 | }, 8 | zones => { 9 | ids => { myzone => { ipam => "pve", type => "simple" } }, 10 | }, 11 | 12 | subnets => { 13 | ids => { 14 | 'myzone-2a08:2142:302:3::-64' => { 15 | 'type' => 'subnet', 16 | 'vnet' => 'myvnet', 17 | 'gateway' => '2a08:2142:302:3::1', 18 | 'snat' => 1 19 | } 20 | } 21 | } 22 | } 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/test/zones/vlan/bridge/expected_sdn_interfaces: -------------------------------------------------------------------------------- 1 | #version:1 2 | 3 | auto ln_myvnet 4 | iface ln_myvnet 5 | link-type veth 6 | veth-peer-name pr_myvnet 7 | mtu 9200 8 | 9 | auto myvnet 10 | iface myvnet 11 | bridge_ports ln_myvnet 12 | bridge_stp off 13 | bridge_fd 0 14 | mtu 9200 15 | 16 | auto pr_myvnet 17 | iface pr_myvnet 18 | link-type veth 19 | veth-peer-name ln_myvnet 20 | mtu 9200 21 | 22 | auto vmbr0v100 23 | iface vmbr0v100 24 | bridge_ports eth0.100 pr_myvnet 25 | bridge_stp off 26 | bridge_fd 0 27 | mtu 9200 28 | -------------------------------------------------------------------------------- /src/test/zones/vlan/bridge/interfaces: -------------------------------------------------------------------------------- 1 | auto vmbr0 2 | iface vmbr0 inet manual 3 | bridge-ports eth0 4 | bridge-stp off 5 | bridge-fd 0 6 | -------------------------------------------------------------------------------- /src/test/zones/vlan/bridge/sdn_config: -------------------------------------------------------------------------------- 1 | { 2 | version => 1, 3 | vnets => { 4 | ids => { 5 | myvnet => { tag => 100, type => "vnet", zone => "myzone" }, 6 | }, 7 | }, 8 | zones => { 9 | ids => { myzone => { bridge => "vmbr0", ipam => "pve", type => "vlan", mtu => "9200" } }, 10 | }, 11 | } 12 | -------------------------------------------------------------------------------- /src/test/zones/vlan/bridge_vlanaware/expected_sdn_interfaces: -------------------------------------------------------------------------------- 1 | #version:1 2 | 3 | auto myvnet 4 | iface myvnet 5 | bridge_ports vmbr0.100 6 | bridge_stp off 7 | bridge_fd 0 8 | -------------------------------------------------------------------------------- /src/test/zones/vlan/bridge_vlanaware/interfaces: -------------------------------------------------------------------------------- 1 | auto vmbr0 2 | iface vmbr0 inet manual 3 | bridge-ports eth0 4 | bridge-stp off 5 | bridge-fd 0 6 | bridge-vids 2-4094 7 | bridge-vlan-aware 1 8 | -------------------------------------------------------------------------------- /src/test/zones/vlan/bridge_vlanaware/sdn_config: -------------------------------------------------------------------------------- 1 | { 2 | version => 1, 3 | vnets => { 4 | ids => { 5 | myvnet => { tag => 100, type => "vnet", zone => "myzone" }, 6 | }, 7 | }, 8 | zones => { 9 | ids => { myzone => { bridge => "vmbr0", ipam => "pve", type => "vlan" } }, 10 | }, 11 | } 12 | -------------------------------------------------------------------------------- /src/test/zones/vlan/bridge_vlanaware_vlanawarevnet/expected_sdn_interfaces: -------------------------------------------------------------------------------- 1 | #version:1 2 | 3 | auto myvnet 4 | iface myvnet 5 | bridge_ports vmbr0.100 6 | bridge_stp off 7 | bridge_fd 0 8 | bridge-vlan-aware yes 9 | bridge-vids 2-4094 10 | -------------------------------------------------------------------------------- /src/test/zones/vlan/bridge_vlanaware_vlanawarevnet/interfaces: -------------------------------------------------------------------------------- 1 | auto vmbr0 2 | iface vmbr0 inet manual 3 | bridge-ports eth0 4 | bridge-stp off 5 | bridge-fd 0 6 | bridge-vlan-aware yes 7 | bridge-vids 2-4096 8 | -------------------------------------------------------------------------------- /src/test/zones/vlan/bridge_vlanaware_vlanawarevnet/sdn_config: -------------------------------------------------------------------------------- 1 | { 2 | version => 1, 3 | vnets => { 4 | ids => { 5 | myvnet => { tag => "100", type => "vnet", vlanaware => 1, zone => "myzone" }, 6 | }, 7 | }, 8 | zones => { 9 | ids => { myzone => { bridge => "vmbr0", ipam => "pve", type => "vlan" } }, 10 | }, 11 | } 12 | -------------------------------------------------------------------------------- /src/test/zones/vlan/ovs/expected_sdn_interfaces: -------------------------------------------------------------------------------- 1 | #version:1 2 | 3 | auto ln_myvnet 4 | iface ln_myvnet 5 | ovs_type OVSIntPort 6 | ovs_bridge vmbr0 7 | ovs_options tag=100 8 | 9 | auto myvnet 10 | iface myvnet 11 | bridge_ports ln_myvnet 12 | bridge_stp off 13 | bridge_fd 0 14 | 15 | auto vmbr0 16 | iface vmbr0 17 | ovs_ports ln_myvnet 18 | -------------------------------------------------------------------------------- /src/test/zones/vlan/ovs/interfaces: -------------------------------------------------------------------------------- 1 | auto eth0 2 | iface eth0 inet manual 3 | ovs_type OVSPort 4 | ovs_bridge vmbr0 5 | 6 | auto vmbr0 7 | iface vmbr0 inet manual 8 | ovs_type OVSBridge 9 | ovs_ports eth0 10 | -------------------------------------------------------------------------------- /src/test/zones/vlan/ovs/sdn_config: -------------------------------------------------------------------------------- 1 | { 2 | version => 1, 3 | vnets => { 4 | ids => { 5 | myvnet => { tag => 100, type => "vnet", zone => "myzone" }, 6 | }, 7 | }, 8 | zones => { 9 | ids => { myzone => { bridge => "vmbr0", ipam => "pve", type => "vlan" } }, 10 | }, 11 | } 12 | -------------------------------------------------------------------------------- /src/test/zones/vlan/ovs_vlanware_vnet/expected_sdn_interfaces: -------------------------------------------------------------------------------- 1 | #version:1 2 | 3 | auto ln_myvnet 4 | iface ln_myvnet 5 | ovs_type OVSIntPort 6 | ovs_bridge vmbr0 7 | ovs_options vlan_mode=dot1q-tunnel other_config:qinq-ethtype=802.1q tag=100 8 | 9 | auto myvnet 10 | iface myvnet 11 | bridge_ports ln_myvnet 12 | bridge_stp off 13 | bridge_fd 0 14 | bridge-vlan-aware yes 15 | bridge-vids 2-4094 16 | 17 | auto vmbr0 18 | iface vmbr0 19 | ovs_ports ln_myvnet 20 | -------------------------------------------------------------------------------- /src/test/zones/vlan/ovs_vlanware_vnet/interfaces: -------------------------------------------------------------------------------- 1 | auto eth0 2 | iface eth0 inet manual 3 | ovs_type OVSPort 4 | ovs_bridge vmbr0 5 | 6 | auto vmbr0 7 | iface vmbr0 inet manual 8 | ovs_type OVSBridge 9 | ovs_ports eth0 10 | -------------------------------------------------------------------------------- /src/test/zones/vlan/ovs_vlanware_vnet/sdn_config: -------------------------------------------------------------------------------- 1 | { 2 | version => 1, 3 | vnets => { 4 | ids => { 5 | myvnet => { tag => 100, type => "vnet", vlanaware => "1", zone => "myzone" }, 6 | }, 7 | }, 8 | zones => { 9 | ids => { myzone => { bridge => "vmbr0", ipam => "pve", type => "vlan" } }, 10 | }, 11 | } 12 | -------------------------------------------------------------------------------- /src/test/zones/vxlan/basic/expected_sdn_interfaces: -------------------------------------------------------------------------------- 1 | #version:1 2 | 3 | auto myvnet 4 | iface myvnet 5 | bridge_ports vxlan_myvnet 6 | bridge_stp off 7 | bridge_fd 0 8 | mtu 1450 9 | 10 | auto vxlan_myvnet 11 | iface vxlan_myvnet 12 | vxlan-id 100 13 | vxlan_remoteip 192.168.0.2 14 | vxlan_remoteip 192.168.0.3 15 | mtu 1450 16 | -------------------------------------------------------------------------------- /src/test/zones/vxlan/basic/interfaces: -------------------------------------------------------------------------------- 1 | auto vmbr0 2 | iface vmbr0 inet static 3 | address 192.168.0.1/24 4 | gateway 192.168.0.254 5 | bridge-ports eth0 6 | bridge-stp off 7 | bridge-fd 0 8 | -------------------------------------------------------------------------------- /src/test/zones/vxlan/basic/sdn_config: -------------------------------------------------------------------------------- 1 | { 2 | version => 1, 3 | vnets => { 4 | ids => { 5 | myvnet => { tag => 100, type => "vnet", zone => "myzone" }, 6 | }, 7 | }, 8 | zones => { 9 | ids => { myzone => { ipam => "pve", type => "vxlan", peers => "192.168.0.1,192.168.0.2,192.168.0.3" } }, 10 | }, 11 | } 12 | -------------------------------------------------------------------------------- /src/test/zones/vxlan/vlanawarevnet/expected_sdn_interfaces: -------------------------------------------------------------------------------- 1 | #version:1 2 | 3 | auto myvnet 4 | iface myvnet 5 | bridge_ports vxlan_myvnet 6 | bridge_stp off 7 | bridge_fd 0 8 | bridge-vlan-aware yes 9 | bridge-vids 2-4094 10 | mtu 1450 11 | 12 | auto vxlan_myvnet 13 | iface vxlan_myvnet 14 | vxlan-id 100 15 | vxlan_remoteip 192.168.0.2 16 | vxlan_remoteip 192.168.0.3 17 | mtu 1450 18 | -------------------------------------------------------------------------------- /src/test/zones/vxlan/vlanawarevnet/interfaces: -------------------------------------------------------------------------------- 1 | auto vmbr0 2 | iface vmbr0 inet static 3 | address 192.168.0.1/24 4 | gateway 192.168.0.254 5 | bridge-ports eth0 6 | bridge-stp off 7 | bridge-fd 0 8 | -------------------------------------------------------------------------------- /src/test/zones/vxlan/vlanawarevnet/sdn_config: -------------------------------------------------------------------------------- 1 | { 2 | version => 1, 3 | vnets => { 4 | ids => { 5 | myvnet => { tag => 100, type => "vnet", vlanaware => "1", zone => "myzone" }, 6 | }, 7 | }, 8 | zones => { 9 | ids => { myzone => { ipam => "pve", type => "vxlan", peers => "192.168.0.1,192.168.0.2,192.168.0.3" } }, 10 | }, 11 | } 12 | -------------------------------------------------------------------------------- /src/test/zones/vxlan/vxlanport/expected_sdn_interfaces: -------------------------------------------------------------------------------- 1 | #version:1 2 | 3 | auto myvnet 4 | iface myvnet 5 | bridge_ports vxlan_myvnet 6 | bridge_stp off 7 | bridge_fd 0 8 | mtu 1450 9 | 10 | auto vxlan_myvnet 11 | iface vxlan_myvnet 12 | vxlan-id 100 13 | vxlan_remoteip 192.168.0.2 14 | vxlan_remoteip 192.168.0.3 15 | vxlan-port 6000 16 | mtu 1450 17 | -------------------------------------------------------------------------------- /src/test/zones/vxlan/vxlanport/interfaces: -------------------------------------------------------------------------------- 1 | auto vmbr0 2 | iface vmbr0 inet static 3 | address 192.168.0.1/24 4 | gateway 192.168.0.254 5 | bridge-ports eth0 6 | bridge-stp off 7 | bridge-fd 0 8 | -------------------------------------------------------------------------------- /src/test/zones/vxlan/vxlanport/sdn_config: -------------------------------------------------------------------------------- 1 | { 2 | version => 1, 3 | vnets => { 4 | ids => { 5 | myvnet => { tag => 100, type => "vnet", zone => "myzone" }, 6 | }, 7 | }, 8 | zones => { 9 | ids => { myzone => { ipam => "pve", type => "vxlan", 'vxlan-port' => 6000, peers => "192.168.0.1,192.168.0.2,192.168.0.3" } }, 10 | }, 11 | } 12 | --------------------------------------------------------------------------------