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