Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Is it possible to create a bonding adapter on an openvz guest?
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Is it possible to create a bonding adapter on an openvz guest?

hacktekhacktek Member
edited April 2015 in Help

I'm working on doing some line bonding by using a combination of tun adapters (via OpenVPN) and ifenslave with balance-rr mode. I'm trying to set this up in an openvz VPS and are failing so I'm wondering if this is even possible on openvz or if my guest is simply missing the bonding module (and I need to open a support ticket for that).

Tun interfaces are defined:

root@vps222:~# ifconfig tun0
tun0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:10.8.0.1 P-t-P:10.8.0.2 Mask:255.255.255.255
POINTOPOINT NOARP MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

root@vps222:~# ifconfig tun1
tun1 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:10.9.0.1 P-t-P:10.9.0.2 Mask:255.255.255.255
POINTOPOINT NOARP MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

So is the bond:

root@vps222:~# cat /etc/network/interfaces.head
iface bond0 inet static
address 172.0.0.1
netmask 255.255.255.252
bond-slaves tun0 tun1
bond_mode balance-rr

It shows up in /etc/network/interfaces after a reboot:

root@vps222:~# grep -A4 bond0 /etc/network/interfaces
iface bond0 inet static
address 172.0.0.1
netmask 255.255.255.252
bond-slaves tun0 tun1
bond_mode balance-rr

But doesn't show up in the interfaces, nor can it be brought up:

root@vps222:~# ifconfig bond0
bond0: error fetching interface information: Device not found
root@vps222:~# ifup bond0
/etc/network/if-pre-up.d/ifenslave: line 19: /sys/class/net/bonding_masters: No such file or directory
/etc/network/if-pre-up.d/ifenslave: line 29: /sys/class/net/bond0/bonding/mode: No such file or directory
Failed to enslave tun0 to bond0. Is bond0 ready and a bonding interface ?
Failed to enslave tun1 to bond0. Is bond0 ready and a bonding interface ?
SIOCSIFADDR: No such device
bond0: ERROR while getting interface flags: No such device
SIOCSIFNETMASK: No such device
bond0: ERROR while getting interface flags: No such device
Failed to bring up bond0.

Any guidance is appreciated.

Comments

  • RalliasRallias Member
    edited April 2015

    Well, I don't know about what would be required by the dom0, however, OpenVZ's bridge module is powered by OpenVSwitch. You can use OpenVSwitch utilities to create bond domains with multiple ethernet devices provided you have access to the bridge module.

    Also, bond devices are ethernet-type devices. Tun devices don't satisfy the ethernet requirement.

  • Thanks for the response! I don't have access to the host so I don't think the above applies, does it?

    I know tun devices are L3. The plan is to do per-packet round robin of an internal network from one remote location and two providers through the tun interfaces (OpenVPN and connections forced through different providers by means of static routes) to the data-center and then back to the internet through the data-center's backbone. This is something I've successfully done in the past without containerization. In rough terms it's something like this:

    192.168.56.0/24 -> Local linux box -> 172.0.0.2-bond0 (10.8.0.2-tun0/10.9.0.2-tun1) -> INTERNET -> 172.0.0.1-bond0 (10.8.0.1-tun0/10.9.0.1-tun1) -> INTERNET.

    All this of course with ipv4 forwarding on both servers and a static route on the remote server that tells it it to get back to 192.168.56.0 through the bonded interface.

  • ClouviderClouvider Member, Patron Provider

    You should do the bonding on the host node level.

  • hacktek said: The plan is to do per-packet round robin of an internal network from one remote location and two providers through the tun interfaces (OpenVPN and connections forced through different providers by means of static routes) to the data-center and then back to the internet through the data-center's backbone.

    Bond devices are layer 2 devices. Use Tap if you really want a bond device.

  • Ok I can do tap I guess (although I would have preferred not sending broadcasts out through the tunnel). I still can't seem to bond two taps though as I get the same error. I've opened a support case with the provider as it appears that they need to load the module in the host for things to work. Hopefully they can do it, otherwise, would kvm or xen be better for this? If anyone has successfully created a bonding device in a low cost VPS I'd love to hear which provider that was.

Sign In or Register to comment.