четверг, 10 мая 2018 г.

Proxmox 5.x bond+vlan+openvswitch

1. Bond+Vlan (active-backup)
1.1 /etc/network/interfaces
auto eno1
auto eno2
auto bond0
iface bond0 inet manual
slaves eno1 eno2
bond-mode active-backup
bond-miimon 100
bond-downdelay 200
bond-updelay 200
auto vlan316
iface vlan316 inet static
address 10.1.18.6
netmask 255.255.255.0
network 10.1.18.0
broadcast 10.1.18.255
gateway 10.1.18.254
dns-nameservers 10.1.18.1
dns-search cloud.example.com
vlan-raw-device bond0

2. Openvswitch bond+vlan (active-backup)
2.1 Install openvswitch
# apt-get install openvswitch-switch
2.2 Check net-tools (need ifconfig)
# dpkg -l | grep net-tools
ii  net-tools                            1.60+git20161116.90da8a0-1     amd64        NET-3 networking toolkit

2.3 /etc/network/interfaces

auto lo
iface lo inet loopback

allow-vmbr0 bond0
iface bond0 inet manual
        ovs_bridge vmbr0
        ovs_type OVSBond
        ovs_bonds eno1 eno2
        pre-up ( ifconfig eno1 mtu 9000 && ifconfig eno2 mtu 9000 )
        ovs_options bond_mode=active-backup vlan_mode=native-untagged trunks=316,317
        mtu 9000

auto vmbr0
allow-ovs vmbr0
iface vmbr0 inet manual
        ovs_type OVSBridge
        ovs_ports bond0 vlan316
        mtu 9000

allow-vmbr0 vlan316
iface vlan316 inet static
        ovs_type OVSIntPort
        ovs_bridge vmbr0
        ovs_options vlan_mode=access tag=316
        ovs_extra set interface ${IFACE} external-ids:iface-id=$(hostname -s)-${IFACE}-vif
        address 10.1.18.6
        netmask 255.255.255.0
        gateway 10.1.18.254
        mtu 9000

auto eno1
iface eno1 inet manual

auto eno2
iface eno2 inet manual