Ethernet-briding a MBIM-interface

Markus Gothe nietzsche at lysator.liu.se
Fri Nov 7 14:40:57 PST 2014


Dear all,
FWIW: After hustling around with tap-devices, without luck because obvious reasons (despite the name, tap-devices are useless for intercepting data on), I found out that this virtual configuration works pretty well for debugging a driver in bridged mode:

ip link add veth0 type veth peer name veth1 #Create a virtual ethernet pair veth0 with its endpoint in veth1
brctl addbr br0 #Create a virtual bridge
brctl addif br0 veth0 #Add veth0 to the virtual bridge
brctl addif br0 wwan0  #Add our modem to the virtual bridge
mbim-network /dev/cdc-wdm0 start (or qmi-network /dev/cdc-wdm0 start ) #Start the data packet service
tcpdump -v -e -i veth0 &  #Start intercepting
udhcpc -i veth1 #Issue a DHCP request from veth0 to wwan0, remember that veth1 is the endpoint.

//M

On 28 Oct 2014, at 20:10 , Markus Gothe <nietzsche at lysator.liu.se> wrote:

> I can conclude this by saying that using a non-null unique source and destination mac + briding rules and ARP magic solved it all for a simple Huawei IPv4-only stick...
> 
> So yes the root cause is the null mac.
> 
> I will try to modify usbnet.h to get a decent patch for upstream.
> 
> //M
> 
> Skickat ifrån min mobil.
> Den 28 okt 2014 10:13 skrev =?ISO-8859-1?Q?Bj=F8rn_Mork?= <bjorn at mork.no>:
>> 
>> Markus Gothe <nietzsche at lysator.liu.se> writes: 
>> 
>>> Explains why the fix_dst-stuff breaks briding in qmi_wwan.c as well I 
>>> guess. However even if setting a null mac there it seems to be 
>>> replaced by the modem fw, right? 
>> 
>> 
>> No, you're right.  If we hit the code dealing with raw IP packets in 
>> qmi_wwan, then the h_source of the genereated header will be 0. Which 
>> makes those packets fail in a brigde. 
>> 
>> That should also be fixed. 
>> 
>>> Sure I can do ARP-replies with ebtables / arptables as well I 
>>> suppose. :-) ARP is all about preferences. 
>> 
>> Yes. 
>> 
>> 
>> Bjørn 
> _______________________________________________
> libmbim-devel mailing list
> libmbim-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/libmbim-devel



//Markus - The panama-hat hacker

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.freedesktop.org/archives/libmbim-devel/attachments/20141107/9b5a8c24/attachment.sig>


More information about the libmbim-devel mailing list