Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #203724 > unrolled thread

kvm bridge network with systemd-networkd 802.3ad bonding

Started byGary Dale <garyndp@gmail.com>
First post2018-12-30 01:00 +0100
Last post2019-01-02 04:20 +0100
Articles 8 — 5 participants

Back to article view | Back to linux.debian.user


Contents

  kvm bridge network with systemd-networkd 802.3ad bonding Gary Dale <garyndp@gmail.com> - 2018-12-30 01:00 +0100
    Re: kvm bridge network with systemd-networkd 802.3ad bonding john doe <johndoe65534@mail.com> - 2018-12-30 07:40 +0100
    Re: kvm bridge network with systemd-networkd 802.3ad bonding Reco <recoverym4n@enotuniq.net> - 2018-12-30 09:30 +0100
      Re: kvm bridge network with systemd-networkd 802.3ad bonding "." <simon.kengelbacher@mail.ch> - 2018-12-30 12:30 +0100
        Re: kvm bridge network with systemd-networkd 802.3ad bonding Reco <recoverym4n@enotuniq.net> - 2018-12-30 13:00 +0100
      Re: kvm bridge network with systemd-networkd 802.3ad bonding Gary Dale <garyndp@gmail.com> - 2019-01-01 00:30 +0100
        Re: kvm bridge network with systemd-networkd 802.3ad bonding Igor Cicimov <icicimov@gmail.com> - 2019-01-01 10:40 +0100
    Re: kvm bridge network with systemd-networkd 802.3ad bonding Gary Dale <garyndp@gmail.com> - 2019-01-02 04:20 +0100

#203724 — kvm bridge network with systemd-networkd 802.3ad bonding

FromGary Dale <garyndp@gmail.com>
Date2018-12-30 01:00 +0100
Subjectkvm bridge network with systemd-networkd 802.3ad bonding
Message-ID<xawGl-7QI-5@gated-at.bofh.it>
I've added a second NIC to a server and am trying to configure the 
virtual bridge network to work with it.

I configured the network bonding initially as per 
https://wiki.debian.org/Bonding#Using_systemd-networkd but I couldn't 
get virt-manager to take bond0 as the bridge device (using the Virtual 
Machine Manager gui). I eventually go it to accept it by removing the 
[Network] Address, etc. from my /etc/networkd-systemd/management.network 
file (which I normally use to specify the bond0 address, etc.) and then 
reworked my old /etc/network/interfaces file to refer to bond0 instead 
of eth0.

This seems to bring up bond0 with br0 having the correct static IP, 
etc.. However it seems somewhat archaic. I think it should be possible 
to use only systemd-networkd to make this work. Also, I may have some 
issues with connectivity - initial connections to the virtual machine 
sometimes fail.

Any suggestions?

[toc] | [next] | [standalone]


#203727

Fromjohn doe <johndoe65534@mail.com>
Date2018-12-30 07:40 +0100
Message-ID<xaCVr-3kF-3@gated-at.bofh.it>
In reply to#203724
On 12/30/2018 12:40 AM, Gary Dale wrote:
> I've added a second NIC to a server and am trying to configure the
> virtual bridge network to work with it.
> 
> I configured the network bonding initially as per
> https://wiki.debian.org/Bonding#Using_systemd-networkd but I couldn't
> get virt-manager to take bond0 as the bridge device (using the Virtual
> Machine Manager gui). I eventually go it to accept it by removing the
> [Network] Address, etc. from my /etc/networkd-systemd/management.network
> file (which I normally use to specify the bond0 address, etc.) and then
> reworked my old /etc/network/interfaces file to refer to bond0 instead
> of eth0.
> 
> This seems to bring up bond0 with br0 having the correct static IP,
> etc.. However it seems somewhat archaic. I think it should be possible
> to use only systemd-networkd to make this work. Also, I may have some
> issues with connectivity - initial connections to the virtual machine
> sometimes fail.
> 
> Any suggestions?
> 

Some untested hints:

https://www.reddit.com/r/linuxadmin/comments/5tsitj/systemdnetworkd_bond_bridge_vlan/
https://serverfault.com/questions/914327/issue-with-bond-vlan-bridge-on-top-of-systemd-network


https://www.linux-kvm.org/page/HOWTO_BONDING#Problem_with_Bridge_.2B_Bonding

-- 
John Doe

[toc] | [prev] | [next] | [standalone]


#203731

FromReco <recoverym4n@enotuniq.net>
Date2018-12-30 09:30 +0100
Message-ID<xaEDT-4pq-7@gated-at.bofh.it>
In reply to#203724
	Hi.

On Sat, Dec 29, 2018 at 06:40:57PM -0500, Gary Dale wrote:
> Any suggestions?

Keep your bonding as it is.
Forget about conventional Linux bridges, and do not use them ever.
Reconfigure your virtual machines to use macvtap (like suggested here -
[1]), you'll need 'bridge' mode.

Reco

[1] https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/virtualization_administration_guide/sect-attch-nic-physdev

[toc] | [prev] | [next] | [standalone]


#203732

From"." <simon.kengelbacher@mail.ch>
Date2018-12-30 12:30 +0100
Message-ID<xaHs6-68Y-19@gated-at.bofh.it>
In reply to#203731

[Multipart message — attachments visible in raw view] — view raw

I used this tutorial, works perfectly with my vms: jamielinux.com/ 
- docs
- libvirt 
- custom bridged 
( Sorry for bad description, written on Smartphone )

Am 30. Dezember 2018 09:04:28 MEZ schrieb Reco <recoverym4n@enotuniq.net>:
>	Hi.
>
>On Sat, Dec 29, 2018 at 06:40:57PM -0500, Gary Dale wrote:
>> Any suggestions?
>
>Keep your bonding as it is.
>Forget about conventional Linux bridges, and do not use them ever.
>Reconfigure your virtual machines to use macvtap (like suggested here -
>[1]), you'll need 'bridge' mode.
>
>Reco
>
>[1]
>https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/virtualization_administration_guide/sect-attch-nic-physdev

-- 
Diese Nachricht wurde von meinem Android-Gerät mit K-9 Mail gesendet.

[toc] | [prev] | [next] | [standalone]


#203733

FromReco <recoverym4n@enotuniq.net>
Date2018-12-30 13:00 +0100
Message-ID<xaHV7-6ju-9@gated-at.bofh.it>
In reply to#203732
	Hi.

On Sun, Dec 30, 2018 at 12:07:38PM +0100, . wrote:
> I used this tutorial, works perfectly with my vms: jamielinux.com/ 

Every time you mix a traditional Linux bridge and a bonding you risk
creating a virtual Ethernet loop. A hint - you do not want that.

All it takes is a single non-managed switch outside of your
'virtualization server'. Oh, and disabling STP (just as your link
'helpfully' suggest) can lead to even more funny results.

Reco

[toc] | [prev] | [next] | [standalone]


#203762

FromGary Dale <garyndp@gmail.com>
Date2019-01-01 00:30 +0100
Message-ID<xbfap-27J-1@gated-at.bofh.it>
In reply to#203731
On 2018-12-30 3:04 a.m., Reco wrote:
> 	Hi.
>
> On Sat, Dec 29, 2018 at 06:40:57PM -0500, Gary Dale wrote:
>> Any suggestions?
> Keep your bonding as it is.
> Forget about conventional Linux bridges, and do not use them ever.
> Reconfigure your virtual machines to use macvtap (like suggested here -
> [1]), you'll need 'bridge' mode.
>
> Reco
>
> [1] https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/virtualization_administration_guide/sect-attch-nic-physdev
>

Thanks Reco. I just went to my server's site (I lost remote access with 
the current network setup) and reconfigured the network to use macvtap 
for bridge. Once I did that it worked like a charm.

After getting rid of the /etc/network/interfaces file (again) and 
reinstating the [network] section of my 
/etc/systermd/network/management.xml file to assign a static IP, all I 
had to do was use

   virsh edit <servername>

to modify the network settings. Basically I changed the entire network 
interface segment to:

    <interface type='direct'>
       <mac address='xx:x:xx:xx:xx:xx'/>
       <source dev='bond0' mode='bridge'/>
     </interface>

where you would replace the "xx" with a valid mac address. When I opened 
the virtual machine using the Virtual Machine Manager gui, I noticed it 
wanted to use an rtl8139 device for the nic, so I changed that to virtio 
then fired it up.

Everything is running great. I've got the remote access back and the 
local area network is behaving itself.

[toc] | [prev] | [next] | [standalone]


#203763

FromIgor Cicimov <icicimov@gmail.com>
Date2019-01-01 10:40 +0100
Message-ID<xboGK-7RQ-3@gated-at.bofh.it>
In reply to#203762

[Multipart message — attachments visible in raw view] — view raw

On Tue, 1 Jan 2019 10:21 am Gary Dale <garyndp@gmail.com wrote:

> On 2018-12-30 3:04 a.m., Reco wrote:
> >       Hi.
> >
> > On Sat, Dec 29, 2018 at 06:40:57PM -0500, Gary Dale wrote:
> >> Any suggestions?
> > Keep your bonding as it is.
> > Forget about conventional Linux bridges, and do not use them ever.
> > Reconfigure your virtual machines to use macvtap (like suggested here -
> > [1]), you'll need 'bridge' mode.
> >
> > Reco
> >
> > [1]
> https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/virtualization_administration_guide/sect-attch-nic-physdev
> >
>
> Thanks Reco. I just went to my server's site (I lost remote access with
> the current network setup) and reconfigured the network to use macvtap
> for bridge. Once I did that it worked like a charm.
>
> After getting rid of the /etc/network/interfaces file (again) and
> reinstating the [network] section of my
> /etc/systermd/network/management.xml file to assign a static IP, all I
> had to do was use
>
>    virsh edit <servername>
>
> to modify the network settings. Basically I changed the entire network
> interface segment to:
>
>     <interface type='direct'>
>        <mac address='xx:x:xx:xx:xx:xx'/>
>        <source dev='bond0' mode='bridge'/>
>      </interface>
>
> where you would replace the "xx" with a valid mac address. When I opened
> the virtual machine using the Virtual Machine Manager gui, I noticed it
> wanted to use an rtl8139 device for the nic, so I changed that to virtio
> then fired it up.
>
> Everything is running great. I've got the remote access back and the
> local area network is behaving itself.
>

Since the days libvirt included support for OpenVSwitch I don't even think
about using anything else but OVS. It has builtin support for bonding (lacp
included), vlans, tunneling etc. You get to manage everything from single
piece of software not to mention extensibility to multiple hosts networks
and multi tenancy plus centralized network control plane.

>

[toc] | [prev] | [next] | [standalone]


#203786

FromGary Dale <garyndp@gmail.com>
Date2019-01-02 04:20 +0100
Message-ID<xbFex-1l7-3@gated-at.bofh.it>
In reply to#203724

[Multipart message — attachments visible in raw view] — view raw

On 2018-12-29 6:40 p.m., Gary Dale wrote:
> I've added a second NIC to a server and am trying to configure the 
> virtual bridge network to work with it.
>
> I configured the network bonding initially as per 
> https://wiki.debian.org/Bonding#Using_systemd-networkd but I couldn't 
> get virt-manager to take bond0 as the bridge device (using the Virtual 
> Machine Manager gui). I eventually go it to accept it by removing the 
> [Network] Address, etc. from my 
> /etc/networkd-systemd/management.network file (which I normally use to 
> specify the bond0 address, etc.) and then reworked my old 
> /etc/network/interfaces file to refer to bond0 instead of eth0.
>
> This seems to bring up bond0 with br0 having the correct static IP, 
> etc.. However it seems somewhat archaic. I think it should be possible 
> to use only systemd-networkd to make this work. Also, I may have some 
> issues with connectivity - initial connections to the virtual machine 
> sometimes fail.
>
> Any suggestions?
>
OK. It turns out I should have just read more about systemd-networkd. It 
handles the case easily and seems to work better than any of the 
suggestions previously made (including the one that I report success 
with). All I had to do was define the bridge with a couple of files:

br0.netdev contains

[NetDev]
Name=br0
Kind=bridge

br0.network contains

[Match]
Name=bond0

[Network]
Bridge=br0

Then I changed the reference in my network-defining .network file (the 
one that assigns the addresses) from bond0 to br0.

This is very simple and seems to run the bridge perfectly, with better 
speed than the macvlan approach I'd tried.


[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.user


csiph-web