LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 10-20-2014, 12:12 PM   #1
Elliottlc
LQ Newbie
 
Registered: Oct 2014
Posts: 7

Rep: Reputation: Disabled
Is bond0 ready and a bonding interface? - Bonding Problems (RPI)


HI all,

First post on the forum, and my first proper project on the Paspberry Pi, so sorry if this is in the wrong place.

I am trying to turn my Pi in to a 3G/4G Bonding router. I have been researching and trying this for a week or so now. The basic plan is to have up to 6 ZTE MF823 USB dongles. The Pi would then bond them together in to bond0. It would then forward traffic on eth0 (my internal network) to the bond. Having the bond on a mode to allow for maximum bandwidth & redundancy.

I started with setting up my Pi as a router. It took me some time and a lot of problems but I have managed to use iptables to forward traffic from eth0 to usb0, and this works perfectly.

I have set up isc-dhcp-server on my Pi and added the IP range for the local subnet. So I have proven that my Pi works as a router, with one internet source.

The problem I am getting starts with plugging in two of the dongles. They both go in separate ports on the PI but both get the same IP (192.168.0.194) and the same MAC address. But they are on different interfaces, usb0 + usb1. But when on the 192.168.0.1 page the information about the dongle says that it has got a public ip with in it. I have tried setting usb0 & usb1 to dhcp and static, on dhcp they both get the same 192.168.0.194 address. On static they wont actually connect to the internet.

I would like to also add the ability to access all of the USB modems control page, but they all come though on 192.168.0.1, can I change this to work in a sequensual order? 192.168.0.1, 192.168.0.2, 192.168.0.3 ….

So my question/request is for a bit of guidance on setting up the bond. I have followed some guides that talk you though setting up the bond but have had no luck, I currently am getting the error message “Failed to enslave usb0 to bond0, Is bond0 ready and a bonding interface?” when I start networking.

I have the follow setup;

Raspberry Pi B+
Latest Raspbian
LTE MF823 X 2
1 – 4 USB hub, used just to allow space for both dongle to plug in, one plugs into that and the other into the Pi.

My /etc/network/interfaces looks like

Code:
auto lo
auto bond0
auto eth0
auto usb0
suto usb1

iface lo inet loopback

iface bond0 inet static
address 192.168.1.2
gateway 192.168.0.1
netmask 255.255.255.0
bond-slave none (have tried with “usb0 usb1” aswell)
bond-mode balance-alb
bond0miimon 100

iface eth0 inet static
address 192.168.1.1

iface usb0 inet dhcp
bond-master bond0
#comes up as 192.168.0.194

iface usb1 inet static
address 192.168.0.195
bond-master bond0

allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp


Iptables walk though - https://www.debian-administration.or...Debian_gateway

Code:
#!/bin/sh

PATH=/usr/sbin:/sbin:/bin:/usr/bin

#
# delete all existing rules.
#
iptables -F
iptables -t nat -F
iptables -t mangle -F
iptables -X

# Always accept loopback traffic
iptables -A INPUT -i lo -j ACCEPT


# Allow established connections, and those not coming from the outside
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -m state --state NEW -i ! eth1 -j ACCEPT
iptables -A FORWARD -i bond0 -o eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT

# Allow outgoing connections from the LAN side.
iptables -A FORWARD -i eth0 -o bond0 -j ACCEPT

# Masquerade.
iptables -t nat -A POSTROUTING -o bond0 -j MASQUERADE

# Don't forward from the outside to the inside.
iptables -A FORWARD -i bond0 -o bond0 -j REJECT

# Enable routing.
echo 1 > /proc/sys/net/ipv4/ip_forward
I then chmod 755 and executed it as well as saved in if-up.d. I swapped the eth1 for usb0 to test it, and then I have changed it to bond0 for it to pass that though.

Router walk though (DHCP setup ) - http://www.g7smy.co.uk/?p=505
A bonding walk though - http://www.linuxhorizon.ro/bonding.html
A bonding walk though - http://askubuntu.com/questions/53499...tions-into-one


I have tried numerous walk thoughts for bonding but all seem to come up short.

My problems;

- USB Modems not getting there own IP’s and MAC address
- Bond not starting/set up correctly

If any one has any ideas or solutions i would love to hear them.

Many thanks.
Elliott
 
Old 10-21-2014, 09:52 PM   #2
nmo
LQ Newbie
 
Registered: Jul 2014
Distribution: Debian
Posts: 21

Rep: Reputation: 8
Normally with bonding you do not give the slave devices ip addresses. You don't even need to auto them.

Example:

Quote:
# physical interfaces
iface eth0 inet manual
iface eth1 inet manual

auto bond0
iface bond0 inet static
address 192.168.1.2
netmask 255.255.255.0
gateway 192.168.1.1
slaves eth0 eth1
bond-mode balance-tlb
bond-miimon 100
Also make sure your module is loaded. If you run:

Quote:
lsmod | grep bond
You should get something like:

Quote:
bonding 79169 0
 
Old 10-22-2014, 05:17 AM   #3
Elliottlc
LQ Newbie
 
Registered: Oct 2014
Posts: 7

Original Poster
Rep: Reputation: Disabled
Hi Nmo,

Thanks for this, i have down that now but i am still getting the same error when starting the network, "Failed to enslave usb0 to bond0, Is bond0 ready and a bonding interface?" - it also comes up with usb1. When i run lsmod | grep bond i get

Bonding 98225 0

Is it because I'm trying to bond usb interfaces? Though i have read that that has been done before.

Cheers
 
Old 10-22-2014, 08:26 AM   #4
nmo
LQ Newbie
 
Registered: Jul 2014
Distribution: Debian
Posts: 21

Rep: Reputation: 8
You could try to install ifenslave. I have never bonded usb interfaces only Ethernet. But it appears to me after doing some searching. That with usb some people build the bond interface and then do ifenslave bond0 usb0 usb1

I'm not sure if that would help. I don't have a configuration similar to test with.
 
Old 10-23-2014, 02:04 PM   #5
Elliottlc
LQ Newbie
 
Registered: Oct 2014
Posts: 7

Original Poster
Rep: Reputation: Disabled
I have got ifenslave installed but know sure if it is configured correctly. have found so many different ways of doing it and even some saying there isn't any real configuration on the ifenslave end.

Yes i am trying to bond usb0 & usb1 and then using eth0 as the pan facing port, so that isn't part of the bond.
 
Old 10-23-2014, 05:13 PM   #6
nmo
LQ Newbie
 
Registered: Jul 2014
Distribution: Debian
Posts: 21

Rep: Reputation: 8
I'm a little worried this won't work. Your usb0 and 1 devices are 3/4g so that would imply they are another companies wireless device. In order to bond those I think you would have to have bonding support on your wireless providers side. You can't just pick an ip, etc. you could try dhcp on the bond0 instead of static but if the wireless company doesn't support you bonding it won't work.
 
Old 10-24-2014, 06:04 AM   #7
Elliottlc
LQ Newbie
 
Registered: Oct 2014
Posts: 7

Original Poster
Rep: Reputation: Disabled
Is that how it works. From my understanding the USB dongle is just a 4G USB Modem so i would have thought that the computer would register it as a modem.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Is bond0 ready and a bonding interface? - 4G Bonding Router Problems Elliottlc Linux - Networking 5 10-22-2014 02:37 PM
Channel bonding Issue - Bond0 interface not getting up in on RHEL6 Rohit_4739 Linux - Networking 13 05-01-2012 04:13 PM
bonding with bond0, but VMware Workstation does not see bond0 dimm0k Linux - Virtualization and Cloud 1 07-14-2011 09:22 PM
bonding bonding-xor and bonding-alb Chrysalis Linux - Networking 1 10-24-2009 02:14 PM
bonding and vlans. Bonding a vlan interface vs applying vlans to a bond interface JasonCzerak Linux - Networking 0 09-11-2008 09:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 03:35 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration