# [SOLVED] Bonding and Arping

## mimosinnet

I have managed to bond my ethernet and wireless interfaces. After that I get an error with arping2:

```
# arping2 mimosinnet

arping: libnet_get_ipaddr4(libnet): libnet_get_ipaddr4(): ioctl(): Cannot assign requested address
```

I am able to ping the same host:

```
# ping mimosinnet

PING mimosinnet (192.168.1.101) 56(84) bytes of data.

64 bytes from mimosinnet (192.168.1.101): icmp_seq=1 ttl=64 time=1.75 ms

64 bytes from mimosinnet (192.168.1.101): icmp_seq=2 ttl=64 time=1.10 ms

64 bytes from mimosinnet (192.168.1.101): icmp_seq=3 ttl=64 time=0.740 ms

^C

--- mimosinnet ping statistics ---

3 packets transmitted, 3 received, 0% packet loss, time 2002ms

rtt min/avg/max/mdev = 0.740/1.200/1.759/0.423 ms
```

If I unbound the interfaces, I am able to use arping2:

```
# arping2 mimosinnet

ARPING 192.168.1.101

60 bytes from 00:01:2e:12:2d:c1 (192.168.1.101): index=0 time=91.000 usec

60 bytes from 00:01:2e:12:2d:c1 (192.168.1.101): index=1 time=81.000 usec

60 bytes from 00:01:2e:12:2d:c1 (192.168.1.101): index=2 time=78.000 usec

^C

--- 192.168.1.101 statistics ---

3 packets transmitted, 3 packets received,   0% unanswered
```

Is arping unable to work with bond interfaces?

I am using arping2 in a script on a laptop. This performs actions depending on the MAC address of the gateway (-t option):

```
if [ "$(arping2 -t 00:01:2E:12:2D:C1 -c 3 -i eth0 mimosinnet | grep '3 packets received')" ]
```

In case I am unable to use arping2 with bonding, is there another alternative?

Cheers!

Edit:

P.S. In the post I am using the term "arping2" as this is how it is called the instruction after installing:

```
 # eix arping

[I] net-analyzer/arping

     Available versions:  (2)  2.05 2.06

     Installed versions:  2.06(2)(23:17:44 21/07/08)

     Homepage:            http://www.habets.pp.se/synscan/programs.php?prog=arping

     Description:         A utility to see if a specific IP address is taken and what MAC address owns it
```

Last edited by mimosinnet on Tue Aug 19, 2008 12:54 am; edited 1 time in total

----------

## poly_poly-man

 *mimosinnet wrote:*   

> I have managed to bond my ethernet and wireless interfaces.

 

ummm... why'd you do that?

First of all, which bonding mode (what mode= option to the bonding driver?)

also, are you connected to the same switch on the wireless and wired interfaces? Does the router/access point actually have the wireless interface on the same switch as the ethernet?

Most likely, you're running into a problem with the fact that your two interfaces are on different switches - similar stuff happens to me if I plug my second wired interface (I bond 2 ethernet cards together) into a different switch than the first.

----------

## mimosinnet

 *poly_poly-man wrote:*   

>  *mimosinnet wrote:*   I have managed to bond my ethernet and wireless interfaces. 
> 
> ummm... why'd you do that?

 

In a laptop, no matter if I am using the ethernet or wireless, I can assign a single IP in the same network. For example, my computer at home gets the 192.168.1.105 IP, no matter if I am using eth0 or ath0. 

 *poly_poly-man wrote:*   

> First of all, which bonding mode (what mode= option to the bonding driver?)

 

I have these lines in my /etc/conf.d/modules

```
modules_2_6="${modules_2_6} bonding"

module_bonding_args_2_6="miimon=100 mode=1"
```

 *poly_poly-man wrote:*   

> also, are you connected to the same switch on the wireless and wired interfaces? Does the router/access point actually have the wireless interface on the same switch as the ethernet?

 

I am not sure. This is my DHCP Active IP Table from my linksys router showing both interfaces (when the interfaces are not bonded):

```
DHCP Server IP Address:   192.168.1.1

Client Host Name  IP Address        MAC Address           Expires 

  joanet               192.168.1.102    00:16:44:1b:0c:4a  23:56:56

  joanet               192.168.1.100    00:a0:d1:cb:2f:38   21:15:56
```

 *poly_poly-man wrote:*   

> Most likely, you're running into a problem with the fact that your two interfaces are on different switches - similar stuff happens to me if I plug my second wired interface (I bond 2 ethernet cards together) into a different switch than the first.

 

You caught me!   :Embarassed:   What do you mean with "a different switch"? I get the connection from my ISP provider, I have a wireless router and a switch (where different computers, including this one, are connected). 

Thanks very much for the answer!

EDIT:

I have connected the ethernet cable to the router (instead of the switch) and arping2 is now working!!! Wonderful!   :Very Happy:   :Very Happy: 

```
# arping2 -c 3 -i bond0 mimosinnet

ARPING 192.168.1.101

60 bytes from 00:01:2e:12:2d:c1 (192.168.1.101): index=0 time=885.000 usec

60 bytes from 00:01:2e:12:2d:c1 (192.168.1.101): index=1 time=853.000 usec

60 bytes from 00:01:2e:12:2d:c1 (192.168.1.101): index=2 time=873.000 usec
```

Thanks very very much for your help! I am really amazed. Could you recommend me some links to help me understand this magic?

Cheers!!!

----------

## poly_poly-man

honestly... I barely understand this.

Here's what I do know: bonding works very, very strangely when on different switches - see, the two network cards end up *sharing* a MAC address - switches get confused when it keeps moving. (wikipedia for what a "switch" does)

See, a wireless router (I'm talking about a wrt54g in this case, because I know how it works - othersd work like this too) has a router inside. This has three interfaces - the wireless card, wired card 1 and wired card 2 (I forget which order they're in...) Card 1 is hooked up to a 1-port switch (with basically no features except allowing both straight and crossover cabling) on the "WAN" interface. Card 2 is hooked to a 4-port switch (or however many ports), for the "LAN" interface. The computer inside is responsible (through software) to figure out what packets from each interface get routed where.

Wired routers do exactly the same thing, without the wireless interface.

The only reason your setup works at all is because of vlan magic - don't ask me at all how that works - basically, it puts the wireless clients on the same switch as the LAN interface.

confused yet?  :Razz: 

----------

## mimosinnet

Thanks very much for your hints! I have spent a couple of days reading on switches. From what I have understood, switches cannot be connected in a ring as the same MAC address are found following two different directions. Bonding interfaces in two different switches creates a ring: 

[computer MAC address] --wireless connection-- [wireless router (switch)] --cable connection-- [switch] --cable connection-- [same computer MAC address]

Is this correct enough for a layperson explanation?   :Wink: 

Cheers!

----------

## poly_poly-man

 *mimosinnet wrote:*   

> Thanks very much for your hints! I have spent a couple of days reading on switches. From what I have understood, switches cannot be connected in a ring as the same MAC address are found following two different directions. Bonding interfaces in two different switches creates a ring: 
> 
> [computer MAC address] --wireless connection-- [wireless router (switch)] --cable connection-- [switch] --cable connection-- [same computer MAC address]
> 
> Is this correct enough for a layperson explanation?  
> ...

 

Good enough.... everything there is true and explains why it happens.

The way the internet gets by with multiple routes to a dingle host is routing, btw - you could make a very smart setup with hubs an routers, if you felt like it.

----------

