본문 바로가기

Linux

brctl bridge 만들기 (android)

su
#create the bridge
busybox brctl addbr br0
#add usb0 to the bridge
busybox brctl addif br0 usb0
#add eth0 to the bridge
busybox brctl addif br0 eth0 
#give the bridge interface an ip and bring it up
busybox ifconfig br0 192.168.1.1 netmask 255.255.255.0 up



무선 wlan0 연결 

busybox brctl addif br0 wlan0

iw

can't add wlan0 to bridge mybridge: Operation not supported

-> iw dev wlan0 set 4addr on



참고자료 iw -> android porting 


Porting iw tools to Android

0.Introduce

This posts is a guide for porting iw to Android ICS.

iw is a new utility for wireless devices on Linux. It developed by linuxwireless.org.

You can see more detail about how to use it in here.

1.Build requirements: libnl

Frist, you need Grab the tree for libnl:

Be sure to make ANDROID_PATH point to your android build environment.

Download the android.sh, and apply it.

Apply this libnl.patch to your ./lib/Makefile and build it.

It will have error happen during the compile process, but if you’re lucky enough, you will find 4 file in ./lib folder (libnl.a libnl-genl.a libnl-nf.a libnl-route.a) . That is exactly what we want. We will static build iw, and wrap those files in iw.

2.Build iw

Make $LIBNL point to your libnl folder.
Download the iw.patch, and apply it to iw/Makefile

Finally, we get iw binary file in current folder, if you want know more detail, please read the 2 patch file and android.sh. All compile progress was run in Ubuntu 10.10. Hope you lucky.

* The iw’s Makefile is very unfriendly for cross compile.

* You can add V=1 option when build Android. This option will let build process output full command, I collected all output compiler options and put them in Android.sh.

* Also you can just download this binary file on iw.tar, which is I compiled for my android ics. Hope you lucky enough.