return $v;
};
+my $check_mtu = sub {
+ my ($ifaces, $parent, $child) = @_;
+
+ die "check mtu : missing parent interface\n" if !$parent;
+ die "check mtu : missing child interface\n" if !$child;
+
+ my $pmtu = $ifaces->{$parent}->{mtu} ? $ifaces->{$parent}->{mtu} : 1500;
+ my $cmtu = $ifaces->{$child}->{mtu} ? $ifaces->{$child}->{mtu} : 1500;
+
+ die "interface '$parent' - mtu $pmtu is bigger than '$child' - mtu $cmtu\n"
+ if $pmtu gt $cmtu;
+
+};
+
# config => {
# ifaces => {
# $ifname => {
$id = $options_alternatives->{$id} if $options_alternatives->{$id};
my $simple_options = {
+ 'mtu' => 1,
'ovs_type' => 1,
'ovs_options' => 1,
'ovs_bridge' => 1,
} else {
die "interface '$p' is not defined as OVS port/bond\n";
}
+
+ &$check_mtu($ifaces, $iface, $p);
}
}
}
if !$n;
die "OVS bond '$iface' - wrong interface type on slave '$p' " .
"('$n->{type}' != 'eth')\n" if $n->{type} ne 'eth';
+ &$check_mtu($ifaces, $iface, $p);
}
}
}
if !$n;
die "bond '$iface' - wrong interface type on slave '$p' " .
"('$n->{type}' != 'eth')\n" if $n->{type} ne 'eth';
+ &$check_mtu($ifaces, $iface, $p);
}
}
}
if (defined($d->{'vxlan-svcnodeip'}) != defined($d->{'vxlan-physdev'})) {
die "iface $iface : vxlan-svcnodeip and vxlan-physdev must be define together\n";
}
+ #fixme : check if vxlan mtu is lower than 50bytes than physical interface where tunnel is going out
}
# check vlan
die "vlan '$iface' - wrong interface type on parent '$p' " .
"('$n->{type}' != 'eth|bond|bridge' )\n";
}
+ &$check_mtu($ifaces, $iface, $p);
}
}
my $n = $ifaces->{$p};
die "bridge '$iface' - unable to find bridge port '$p'\n"
if !$n;
+ &$check_mtu($ifaces, $iface, $p);
$bridgeports->{$p} = $iface;
}
$bridges->{$iface} = $d;
$config->{ifaces}->{bond0} = {
type => 'bond',
+ mtu => 1400,
slaves => 'eth2 eth3',
bond_mode => '802.3ad',
bond_xmit_hash_policy => 'layer3+4',
};
$config->{ifaces}->{vmbr1} = {
+ mtu => 1400,
type => 'bridge',
method => 'manual',
families => ['inet'],
$config->{ifaces}->{'vmbr1.100'} = {
type => 'vlan',
+ mtu => 1300,
method => 'manual',
families => ['inet'],
autostart => 1
$config->{ifaces}->{'bond0.100'} = {
type => 'vlan',
+ mtu => 1300,
method => 'manual',
families => ['inet'],
autostart => 1
$config->{ifaces}->{'eth1.100'} = {
type => 'vlan',
+ mtu => 1400,
method => 'manual',
families => ['inet'],
autostart => 1
auto eth1.100
iface eth1.100 inet manual
+ mtu 1400
auto bond0
iface bond0 inet manual
bond-miimon 100
bond-mode 802.3ad
bond-xmit-hash-policy layer3+4
+ mtu 1400
auto bond0.100
iface bond0.100 inet manual
+ mtu 1300
auto vmbr0
iface vmbr0 inet static
bridge-fd 0
bridge-vlan-aware yes
bridge-vids 2-4094
+ mtu 1400
auto vmbr2
iface vmbr2 inet manual
auto vmbr1.100
iface vmbr1.100 inet manual
+ mtu 1300
auto vxlan1
iface vxlan1 inet manual