mirror of
git://git.proxmox.com/git/pve-common.git
synced 2024-12-22 21:33:47 +03:00
Inotify: add support for 802.1ad stacked vlans
This commit is contained in:
parent
ee83493613
commit
8f5d56bfc9
@ -954,6 +954,7 @@ sub __read_etc_network_interfaces {
|
|||||||
'bridge-multicast-flood' => 1,
|
'bridge-multicast-flood' => 1,
|
||||||
'bond_miimon' => 1,
|
'bond_miimon' => 1,
|
||||||
'bond_xmit_hash_policy' => 1,
|
'bond_xmit_hash_policy' => 1,
|
||||||
|
'vlan-protocol' => 1,
|
||||||
'vxlan-id' => 1,
|
'vxlan-id' => 1,
|
||||||
'vxlan-svcnodeip' => 1,
|
'vxlan-svcnodeip' => 1,
|
||||||
'vxlan-physdev' => 1,
|
'vxlan-physdev' => 1,
|
||||||
@ -1201,6 +1202,10 @@ sub __interface_to_string {
|
|||||||
$raw .= "\tbond-xmit-hash-policy $d->{'bond_xmit_hash_policy'}\n";
|
$raw .= "\tbond-xmit-hash-policy $d->{'bond_xmit_hash_policy'}\n";
|
||||||
}
|
}
|
||||||
$done->{'bond_xmit_hash_policy'} = 1;
|
$done->{'bond_xmit_hash_policy'} = 1;
|
||||||
|
} elsif ($d->{type} eq 'vlan') {
|
||||||
|
die "$iface: wrong vlan-protocol $d->{'vlan-protocol'}\n"
|
||||||
|
if $d->{'vlan-protocol'} && $d->{'vlan-protocol'} ne '802.1ad' && $d->{'vlan-protocol'} ne '802.1q';
|
||||||
|
|
||||||
} elsif ($d->{type} eq 'vxlan') {
|
} elsif ($d->{type} eq 'vxlan') {
|
||||||
|
|
||||||
foreach my $k (qw(vxlan-id vxlan-svcnodeip vxlan-physdev vxlan-local-tunnelip)) {
|
foreach my $k (qw(vxlan-id vxlan-svcnodeip vxlan-physdev vxlan-local-tunnelip)) {
|
||||||
@ -1441,11 +1446,13 @@ sub __write_etc_network_interfaces {
|
|||||||
|
|
||||||
if ($n->{type} eq 'bridge' && !$n->{bridge_vlan_aware}) {
|
if ($n->{type} eq 'bridge' && !$n->{bridge_vlan_aware}) {
|
||||||
die "vlan '$iface' - bridge vlan aware is not enabled on parent '$p'\n";
|
die "vlan '$iface' - bridge vlan aware is not enabled on parent '$p'\n";
|
||||||
} elsif ($n->{type} ne 'eth' && $n->{type} ne 'bridge' && $n->{type} ne 'bond') {
|
} elsif ($n->{type} ne 'eth' && $n->{type} ne 'bridge' && $n->{type} ne 'bond' && $n->{type} ne 'vlan') {
|
||||||
die "vlan '$iface' - wrong interface type on parent '$p' " .
|
die "vlan '$iface' - wrong interface type on parent '$p' " .
|
||||||
"('$n->{type}' != 'eth|bond|bridge' )\n";
|
"('$n->{type}' != 'eth|bond|bridge|vlan' )\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
&$check_mtu($ifaces, $p, $iface);
|
&$check_mtu($ifaces, $p, $iface);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -301,6 +301,15 @@ $config->{ifaces}->{'vmbr1.100'} = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
$config->{ifaces}->{'bond0.100'} = {
|
$config->{ifaces}->{'bond0.100'} = {
|
||||||
|
type => 'vlan',
|
||||||
|
mtu => 1300,
|
||||||
|
method => 'manual',
|
||||||
|
families => ['inet'],
|
||||||
|
'vlan-protocol' => '802.1ad',
|
||||||
|
autostart => 1
|
||||||
|
};
|
||||||
|
|
||||||
|
$config->{ifaces}->{'bond0.100.10'} = {
|
||||||
type => 'vlan',
|
type => 'vlan',
|
||||||
mtu => 1300,
|
mtu => 1300,
|
||||||
method => 'manual',
|
method => 'manual',
|
||||||
@ -336,6 +345,11 @@ $bond0_part
|
|||||||
auto bond0.100
|
auto bond0.100
|
||||||
iface bond0.100 inet manual
|
iface bond0.100 inet manual
|
||||||
mtu 1300
|
mtu 1300
|
||||||
|
vlan-protocol 802.1ad
|
||||||
|
|
||||||
|
auto bond0.100.10
|
||||||
|
iface bond0.100.10 inet manual
|
||||||
|
mtu 1300
|
||||||
|
|
||||||
$vmbr0_part
|
$vmbr0_part
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user