use strict;
use warnings;
-use Data::Dumper;
use JSON;
use PVE::Tools qw(extract_param dir_glob_regex run_command);
use strict;
use warnings;
-use Data::Dumper;
use JSON;
use PVE::Tools qw(extract_param dir_glob_regex run_command);
type => 'string',
description => "Frr router name",
},
- 'mac' => {
- type => 'string',
- description => "Anycast logical router mac address",
- optional => 1, format => 'mac-addr'
- },
+ 'mac' => {
+ type => 'string',
+ description => "Anycast logical router mac address",
+ optional => 1, format => 'mac-addr'
+ },
'exitnodes' => get_standard_option('pve-node-list'),
};
}
sub options {
-
return {
- nodes => { optional => 1},
- 'vrf-vxlan' => { optional => 0 },
- controller => { optional => 0 },
+ nodes => { optional => 1},
+ 'vrf-vxlan' => { optional => 0 },
+ controller => { optional => 0 },
exitnodes => { optional => 1 },
mtu => { optional => 1 },
mac => { optional => 1 },
sub options {
return {
- nodes => { optional => 1},
+ nodes => { optional => 1},
'dp-id' => { optional => 0 },
# 'uplink-id' => { optional => 0 },
- 'controller' => { optional => 0 },
- dns => { optional => 1 },
- reversedns => { optional => 1 },
+ 'controller' => { optional => 0 },
+ dns => { optional => 1 },
+ reversedns => { optional => 1 },
dnszone => { optional => 1 },
ipam => { optional => 0 },
};
use PVE::Cluster;
use PVE::Network;
-use Data::Dumper;
use PVE::JSONSchema qw(get_standard_option);
use base qw(PVE::SectionConfig);
-PVE::Cluster::cfs_register_file('sdn/zones.cfg',
- sub { __PACKAGE__->parse_config(@_); },
- sub { __PACKAGE__->write_config(@_); });
+PVE::Cluster::cfs_register_file(
+ 'sdn/zones.cfg',
+ sub { __PACKAGE__->parse_config(@_); },
+ sub { __PACKAGE__->write_config(@_); },
+);
PVE::JSONSchema::register_standard_option('pve-sdn-zone-id', {
description => "The SDN zone object identifier.",
type => 'string', format => 'pve-configid',
type => 'string',
},
- nodes => get_standard_option('pve-node-list', { optional => 1 }),
- zone => get_standard_option('pve-sdn-zone-id',
- { completion => \&PVE::Network::SDN::Zones::complete_sdn_zone }),
- ipam => {
- type => 'string',
- description => "use a specific ipam",
- },
+ nodes => get_standard_option('pve-node-list', { optional => 1 }),
+ zone => get_standard_option('pve-sdn-zone-id', {
+ completion => \&PVE::Network::SDN::Zones::complete_sdn_zone,
+ }),
+ ipam => {
+ type => 'string',
+ description => "use a specific ipam",
+ },
},
};
sub options {
return {
- nodes => { optional => 1},
+ nodes => { optional => 1},
'bridge' => { optional => 0 },
mtu => { optional => 1 },
dns => { optional => 1 },
reversedns => { optional => 1 },
dnszone => { optional => 1 },
- ipam => { optional => 0 },
+ ipam => { optional => 0 },
};
}
}
sub options {
-
return {
- nodes => { optional => 1},
- peers => { optional => 0 },
+ nodes => { optional => 1},
+ peers => { optional => 0 },
mtu => { optional => 1 },
dns => { optional => 1 },
reversedns => { optional => 1 },
my @iface_config = ();
push @iface_config, "vxlan-id $tag";
- foreach my $address (@peers) {
+ for my $address (@peers) {
next if $address eq $ifaceip;
push @iface_config, "vxlan_remoteip $address";
}
push @iface_config, "bridge_ports $vxlan_iface";
push @iface_config, "bridge_stp off";
push @iface_config, "bridge_fd 0";
- if($vnet->{vlanaware}) {
- push @iface_config, "bridge-vlan-aware yes";
- push @iface_config, "bridge-vids 2-4094";
+ if ($vnet->{vlanaware}) {
+ push @iface_config, "bridge-vlan-aware yes";
+ push @iface_config, "bridge-vids 2-4094";
}
push @iface_config, "mtu $mtu" if $mtu;
push @iface_config, "alias $alias" if $alias;
raise_param_exc({ tag => "vxlan tag max value is 16777216"}) if $tag > 16777216;
# verify that tag is not already defined globally (vxlan-id are unique)
- foreach my $id (keys %{$vnet_cfg->{ids}}) {
+ for my $id (sort keys %{$vnet_cfg->{ids}}) {
next if $id eq $vnetid;
my $othervnet = $vnet_cfg->{ids}->{$id};
my $other_tag = $othervnet->{tag};