-1

I have two tunnel devices tun0 and tun1 on my client pc connected to remote OpenVPN server.The ifconfig shows them as

tun0      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  
          inet addr:10.0.128.23  P-t-P:10.0.128.23  Mask:255.255.128.0
          UP POINTOPOINT RUNNING 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)

tun1      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  
          inet addr:10.0.128.24  P-t-P:10.0.128.24  Mask:255.255.128.0
          UP POINTOPOINT RUNNING 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)

Now I try to bond these devices by executing this command

sudo modprobe bonding miimon=100 mode=balance-rr
sudo ifconfig bond0 10.2.1.4 netmask 255.255.255.0
sudo ifenslave bond0 tun0
sudo ifenslave bond0 tun1

But the ifenslave command fails throwign the following message

ifenslave.c:v1.1.0 (December 1, 2003)
o Donald Becker (becker@cesdis.gsfc.nasa.gov).
o Detach support added on 2000/10/02 by Willy Tarreau (willy at meta-x.org).
o 2.4 kernel support added on 2001/02/16 by Chad N. Tindel
  (ctindel at ieee dot org).
ABI ver is 2
Interface 'tun0': flags set to 10D0.
Interface 'tun0': address cleared
Master 'bond0': Error: SIOCSIFHWADDR failed: Invalid argument
Master 'bond0': Error: set hw address failed
Slave 'tun0': MTU set to 1500.
Master 'bond0', Slave 'tun0': Error: Enslave failed

What could be wrong . First of all it is possible to bond two tunnel devices?

srix
  • 63
  • 1
  • 7

3 Answers3

4

You can't bond two TUN devices as they don't have MAC addresses. Bonding requires MAC address to operate. Note that bonded device inherits mac address of one of the slaves.

Try using TAP devices (instead of TUN), some people claims that it works (I didn't try it myself).

ItsMe
  • 373
  • 2
  • 15
0

You need to set a hardware address on the bond0 device:

ifconfig bond0 hw ether 00:11:22:33:44:55

Unknown
  • 5,722
  • 5
  • 43
  • 64
0

Try to look at https://forums.openvpn.net/topic14153.html#p37300

in short they recommended to:

  • set Bonding "mode" to "balance-xor" instead of "balance-rr": higher throughput with multiple connexions (no packet reordering)

  • set "xmit_hash_policy" to "layer3+4": TUN interface has no MAC address so balancing is done on upper level (source/dest IP + source/dest port)