Normally with bonding you have 2 (or more) links that can handle the same traffic (i.e. have access to the same VLANs). This way you can eliminate any SPOF in your network and you don't have your users to connect to another IP in case a link fails. For example two switches with both 1 link to the server. The link to switch 1 is primary and the link to switch 2 is secondary (active-backup mode). If switch 1, the cable between switch 1 and server, or the NIC in the server connected to switch 1 fails, the second link will be enabled automatically. In this case you don't set IP's on the interface (eth0/eth1), but on the bond interface or on a bridge that's connected to a bond interface. Let's say your server IP's are 192.168.100.100 and 192.168.101.100, your server is able to connect to the network with these IP's on both eth0 and eth1. Example config for this:
Code:
iface eth0 inet manual
bond_master bond0
bond_primary eth0
bond_mode active-backup
iface eth1 inet manual
bond_master bond0
bond_primary eth0
bond_mode active-backup
auto bond0
iface bond0 inet manual
slaves eth0 eth1
bond_primary eth0
bond_mode active-backup
bond_miimon 100
bond_updelay 60000
auto bond0.100
iface bond0.100 inet manual
vlan-raw-device bond0
auto bond0.101
iface bond0.101 inet manual
vlan-raw-device bond0
auto vmbr0100
iface vmbr0100 inet static
address 192.168.100.100
netmask 255.255.255.0
network 192.168.100.0
broadcast 192.168.100.255
gateway 192.168.100.1
bridge_ports bond0.100
bridge_stp off
bridge_fd 0
auto vmbr0101
iface vmbr0101 inet static
address 192.168.101.100
netmask 255.255.255.0
network 192.168.101.0
broadcast 192.168.101.255
bridge_ports bond0.101
bridge_stp off
bridge_fd 0
This config requires you have 2 VLANs (in this example VLAN 100 for 192.168.100.0/24 and VLAN 101 for 192.168.101.0/24) that both are tagged on both links. If then one link (or switch, or NIC) will fail, both IP's (192.168.100.100 and 192.168.101.100) will still be reachable/working on the local network. As long as the gateway on 192.168.100.1 stay online/reachable, internet traffic will also work over both links. If your switches are the gateway, you can make the gateway redundant with technics like VRRP.
Let's say you also have 192.168.102.0/24 (not directly connected to the PVE node) that needs to be reached over 192.168.101.0/24 and the gateway/router that know how to handle this traffic is on 192.168.101.1, you can simply add a route on the bridge, for example:
Code:
auto vmbr0101
iface vmbr0101 inet static
address 192.168.101.100
netmask 255.255.255.0
network 192.168.101.0
broadcast 192.168.101.255
bridge_ports bond0.101
bridge_stp off
bridge_fd 0
post-up route add -net 192.168.102.0 netmask 255.255.255.0 gw 192.168.101.1