mirror of
git://git.proxmox.com/git/pve-common.git
synced 2025-01-18 14:03:34 +03:00
Inotify : write network config : use modern syntax for options
-replace options with '_' with '-' -use 'bond-slaves' instead 'slaves'
This commit is contained in:
parent
1b1fb9f70c
commit
1accc6da65
@ -1078,19 +1078,19 @@ sub __interface_to_string {
|
|||||||
|
|
||||||
$d->{bridge_ports} =~ s/[;,\s]+/ /g;
|
$d->{bridge_ports} =~ s/[;,\s]+/ /g;
|
||||||
my $ports = $d->{bridge_ports} || 'none';
|
my $ports = $d->{bridge_ports} || 'none';
|
||||||
$raw .= "\tbridge_ports $ports\n";
|
$raw .= "\tbridge-ports $ports\n";
|
||||||
$done->{bridge_ports} = 1;
|
$done->{bridge_ports} = 1;
|
||||||
|
|
||||||
my $v = defined($d->{bridge_stp}) ? $d->{bridge_stp} : 'off';
|
my $v = defined($d->{bridge_stp}) ? $d->{bridge_stp} : 'off';
|
||||||
$raw .= "\tbridge_stp $v\n";
|
$raw .= "\tbridge-stp $v\n";
|
||||||
$done->{bridge_stp} = 1;
|
$done->{bridge_stp} = 1;
|
||||||
|
|
||||||
$v = defined($d->{bridge_fd}) ? $d->{bridge_fd} : 0;
|
$v = defined($d->{bridge_fd}) ? $d->{bridge_fd} : 0;
|
||||||
$raw .= "\tbridge_fd $v\n";
|
$raw .= "\tbridge-fd $v\n";
|
||||||
$done->{bridge_fd} = 1;
|
$done->{bridge_fd} = 1;
|
||||||
|
|
||||||
if( defined($d->{bridge_vlan_aware})) {
|
if( defined($d->{bridge_vlan_aware})) {
|
||||||
$raw .= "\tbridge_vlan_aware yes\n";
|
$raw .= "\tbridge-vlan-aware yes\n";
|
||||||
}
|
}
|
||||||
$done->{bridge_vlan_aware} = 1;
|
$done->{bridge_vlan_aware} = 1;
|
||||||
|
|
||||||
@ -1098,20 +1098,20 @@ sub __interface_to_string {
|
|||||||
|
|
||||||
$d->{slaves} =~ s/[;,\s]+/ /g;
|
$d->{slaves} =~ s/[;,\s]+/ /g;
|
||||||
my $slaves = $d->{slaves} || 'none';
|
my $slaves = $d->{slaves} || 'none';
|
||||||
$raw .= "\tslaves $slaves\n";
|
$raw .= "\tbond-slaves $slaves\n";
|
||||||
$done->{slaves} = 1;
|
$done->{slaves} = 1;
|
||||||
|
|
||||||
my $v = defined ($d->{'bond_miimon'}) ? $d->{'bond_miimon'} : 100;
|
my $v = defined ($d->{'bond_miimon'}) ? $d->{'bond_miimon'} : 100;
|
||||||
$raw .= "\tbond_miimon $v\n";
|
$raw .= "\tbond-miimon $v\n";
|
||||||
$done->{'bond_miimon'} = 1;
|
$done->{'bond_miimon'} = 1;
|
||||||
|
|
||||||
$v = defined ($d->{'bond_mode'}) ? $d->{'bond_mode'} : 'balance-rr';
|
$v = defined ($d->{'bond_mode'}) ? $d->{'bond_mode'} : 'balance-rr';
|
||||||
$raw .= "\tbond_mode $v\n";
|
$raw .= "\tbond-mode $v\n";
|
||||||
$done->{'bond_mode'} = 1;
|
$done->{'bond_mode'} = 1;
|
||||||
|
|
||||||
if ($d->{'bond_mode'} && $d->{'bond_xmit_hash_policy'} &&
|
if ($d->{'bond_mode'} && $d->{'bond_xmit_hash_policy'} &&
|
||||||
($d->{'bond_mode'} eq 'balance-xor' || $d->{'bond_mode'} eq '802.3ad')) {
|
($d->{'bond_mode'} eq 'balance-xor' || $d->{'bond_mode'} eq '802.3ad')) {
|
||||||
$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;
|
||||||
|
|
||||||
|
@ -12,9 +12,9 @@ new_iface('vmbr0', 'bridge', [{ family => 'inet' }], autostart => 1, bridge_port
|
|||||||
expect load('base') . <<"EOF";
|
expect load('base') . <<"EOF";
|
||||||
auto vmbr0
|
auto vmbr0
|
||||||
iface vmbr0 inet manual
|
iface vmbr0 inet manual
|
||||||
bridge_ports eth0
|
bridge-ports eth0
|
||||||
bridge_stp off
|
bridge-stp off
|
||||||
bridge_fd 0
|
bridge-fd 0
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
@ -31,9 +31,9 @@ iface vmbr0 inet static
|
|||||||
address $ip
|
address $ip
|
||||||
netmask $nm
|
netmask $nm
|
||||||
gateway $gw
|
gateway $gw
|
||||||
bridge_ports eth0
|
bridge-ports eth0
|
||||||
bridge_stp off
|
bridge-stp off
|
||||||
bridge_fd 0
|
bridge-fd 0
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
save('with-ipv4', w());
|
save('with-ipv4', w());
|
||||||
@ -66,9 +66,9 @@ iface vmbr0 inet6 static
|
|||||||
address $ip6
|
address $ip6
|
||||||
netmask $nm6
|
netmask $nm6
|
||||||
gateway $gw6
|
gateway $gw6
|
||||||
bridge_ports eth0
|
bridge-ports eth0
|
||||||
bridge_stp off
|
bridge-stp off
|
||||||
bridge_fd 0
|
bridge-fd 0
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
@ -35,9 +35,9 @@ iface vmbr0 inet static
|
|||||||
address 10.0.0.2
|
address 10.0.0.2
|
||||||
netmask 255.255.255.0
|
netmask 255.255.255.0
|
||||||
gateway 10.0.0.1
|
gateway 10.0.0.1
|
||||||
bridge_ports eth0
|
bridge-ports eth0
|
||||||
bridge_stp off
|
bridge-stp off
|
||||||
bridge_fd 0
|
bridge-fd 0
|
||||||
|
|
||||||
CHECK
|
CHECK
|
||||||
|
|
||||||
@ -78,9 +78,9 @@ iface vmbr0 inet static
|
|||||||
address 10.0.0.2
|
address 10.0.0.2
|
||||||
netmask 255.255.255.0
|
netmask 255.255.255.0
|
||||||
gateway 10.0.0.1
|
gateway 10.0.0.1
|
||||||
bridge_ports eth0
|
bridge-ports eth0
|
||||||
bridge_stp off
|
bridge-stp off
|
||||||
bridge_fd 0
|
bridge-fd 0
|
||||||
|
|
||||||
CHECK
|
CHECK
|
||||||
|
|
||||||
|
@ -19,49 +19,49 @@ iface eth6 inet manual
|
|||||||
iface eth7 inet manual
|
iface eth7 inet manual
|
||||||
|
|
||||||
iface bond0 inet manual
|
iface bond0 inet manual
|
||||||
slaves eth0 eth1
|
bond-slaves eth0 eth1
|
||||||
bond_miimon 100
|
bond-miimon 100
|
||||||
bond_mode balance-alb
|
bond-mode balance-alb
|
||||||
|
|
||||||
auto bond1
|
auto bond1
|
||||||
iface bond1 inet static
|
iface bond1 inet static
|
||||||
address 10.10.10.$ip
|
address 10.10.10.$ip
|
||||||
netmask 255.255.255.0
|
netmask 255.255.255.0
|
||||||
slaves eth2 eth3
|
bond-slaves eth2 eth3
|
||||||
bond_miimon 100
|
bond-miimon 100
|
||||||
bond_mode balance-alb
|
bond-mode balance-alb
|
||||||
# pre-up ifconfig bond1 mtu 9000
|
# pre-up ifconfig bond1 mtu 9000
|
||||||
|
|
||||||
auto bond2
|
auto bond2
|
||||||
iface bond2 inet manual
|
iface bond2 inet manual
|
||||||
slaves eth4 eth5
|
bond-slaves eth4 eth5
|
||||||
bond_miimon 100
|
bond-miimon 100
|
||||||
bond_mode balance-alb
|
bond-mode balance-alb
|
||||||
# Private networking
|
# Private networking
|
||||||
|
|
||||||
iface vlan3 inet static
|
iface vlan3 inet static
|
||||||
address 0.0.0.0
|
address 0.0.0.0
|
||||||
netmask 0.0.0.0
|
netmask 0.0.0.0
|
||||||
vlan_raw_device bond2
|
vlan-raw-device bond2
|
||||||
|
|
||||||
iface vlan4 inet static
|
iface vlan4 inet static
|
||||||
address 0.0.0.0
|
address 0.0.0.0
|
||||||
netmask 0.0.0.0
|
netmask 0.0.0.0
|
||||||
vlan_raw_device bond2
|
vlan-raw-device bond2
|
||||||
|
|
||||||
iface vlan5 inet static
|
iface vlan5 inet static
|
||||||
address 0.0.0.0
|
address 0.0.0.0
|
||||||
netmask 0.0.0.0
|
netmask 0.0.0.0
|
||||||
vlan_raw_device bond2
|
vlan-raw-device bond2
|
||||||
|
|
||||||
auto vmbr0
|
auto vmbr0
|
||||||
iface vmbr0 inet static
|
iface vmbr0 inet static
|
||||||
address 192.168.100.13
|
address 192.168.100.13
|
||||||
netmask 255.255.255.0
|
netmask 255.255.255.0
|
||||||
gateway 192.168.100.1
|
gateway 192.168.100.1
|
||||||
bridge_ports bond0
|
bridge-ports bond0
|
||||||
bridge_stp off
|
bridge-stp off
|
||||||
bridge_fd 0
|
bridge-fd 0
|
||||||
|
|
||||||
auto vlan6
|
auto vlan6
|
||||||
iface vlan6 inet static
|
iface vlan6 inet static
|
||||||
@ -73,23 +73,23 @@ iface vlan6 inet static
|
|||||||
|
|
||||||
auto vmbr3
|
auto vmbr3
|
||||||
iface vmbr3 inet manual
|
iface vmbr3 inet manual
|
||||||
bridge_ports vlan3
|
bridge-ports vlan3
|
||||||
bridge_stp off
|
bridge-stp off
|
||||||
bridge_fd 0
|
bridge-fd 0
|
||||||
pre-up ifup vlan3
|
pre-up ifup vlan3
|
||||||
|
|
||||||
auto vmbr4
|
auto vmbr4
|
||||||
iface vmbr4 inet manual
|
iface vmbr4 inet manual
|
||||||
bridge_ports vlan4
|
bridge-ports vlan4
|
||||||
bridge_stp off
|
bridge-stp off
|
||||||
bridge_fd 0
|
bridge-fd 0
|
||||||
pre-up ifup vlan4
|
pre-up ifup vlan4
|
||||||
|
|
||||||
auto vmbr5
|
auto vmbr5
|
||||||
iface vmbr5 inet manual
|
iface vmbr5 inet manual
|
||||||
bridge_ports vlan5
|
bridge-ports vlan5
|
||||||
bridge_stp off
|
bridge-stp off
|
||||||
bridge_fd 0
|
bridge-fd 0
|
||||||
pre-up ifup vlan5
|
pre-up ifup vlan5
|
||||||
|
|
||||||
IFACES
|
IFACES
|
||||||
|
@ -41,9 +41,9 @@ iface vmbr0 inet static
|
|||||||
address 10.0.0.2
|
address 10.0.0.2
|
||||||
netmask 255.255.255.0
|
netmask 255.255.255.0
|
||||||
gateway 10.0.0.1
|
gateway 10.0.0.1
|
||||||
bridge_ports eth0
|
bridge-ports eth0
|
||||||
bridge_stp off
|
bridge-stp off
|
||||||
bridge_fd 0
|
bridge-fd 0
|
||||||
|
|
||||||
CHECK
|
CHECK
|
||||||
|
|
||||||
@ -82,9 +82,9 @@ iface vmbr0 inet static
|
|||||||
address 10.0.0.2
|
address 10.0.0.2
|
||||||
netmask 255.255.255.0
|
netmask 255.255.255.0
|
||||||
gateway 10.0.0.1
|
gateway 10.0.0.1
|
||||||
bridge_ports eth0
|
bridge-ports eth0
|
||||||
bridge_stp off
|
bridge-stp off
|
||||||
bridge_fd 0
|
bridge-fd 0
|
||||||
|
|
||||||
CHECK
|
CHECK
|
||||||
expect $final;
|
expect $final;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user