OpenWrt Forum Archive

Topic: Atheros only! - Next Generation Piranha firmware (v4) + AAP (v3)

The content of this topic has been archived between 20 Aug 2015 and 21 Apr 2018. Unfortunately there are posts – most likely complete pages – missing.

Did you try what Lux posted in post #34 ??

I made the change but haven't  checked to see if the mac is random or not yet.

Its true the mac dosen't change right now in Orange's version - soon maybe. He is quite busy and this is just a hobby to him i think. Im sue he would be happy to have help with coding ..

(Last edited by Seth7 on 6 Oct 2010, 21:48)

w0rdpress wrote:

not sure if this is a bug for Piranha, or openwrt:

config 'interface' 'wan'
        option 'ifname' 'eth0'
        option 'macaddr' 00:11:22:33:44:55

is not effective, original mac is always showing. neither is the following:

ifconfig eth0 hw ether 00:11:22:33:44:55
ifconfig: SIOCSIFHWADDR: Operation not supported

any idea?

What exactly do you want to do? Using eth0 as wan interface isn't at all the intent of Piranha/AAP obviously. Please provide some more details about your scenario. I may be able to help you then.

Seth7 wrote:

Its true the mac dosen't change right now in Orange's version - soon maybe

Sorry, but this is incorrect information. Mac changing on interface ath0 (AAP interface) works if configured correctly. It just doesn't seem to be too random, that's what lux is currently working on. Not a bug.

(Last edited by orange on 6 Oct 2010, 21:57)

thanks for ur replies, orange and seth.

yeah, macaddr works for ath0, or if the wan type is bridge with eth0 (in this case, br-wan is showing as macaddr, but not eth0, which is part of the bridge)

this setup is for my occasional use of this little device as a regular router and the isp needs a registered mac sad

Hi guys,

   I was off for 2 weeks.
I made all the changes I was talking about.
Give me just a few days to organize it better, finish the web interface and translate everything in english (cause I wrote comments and whatever in Italian....)

Just a fast answer about the mac change: the source of entropy for the /dev/random device - used by macchanger - is just the ethernet connection
So if the router has an active ethernet connection, the choice is quite random
If there is no active ethernet connection (but just wifi) so the choice is always the same
I solved with a trick

See you soon!

hi Lux, are you saying that there is a way to change the mac of eth0?
thx

lux wrote:

Hi guys,

   I was off for 2 weeks.
I made all the changes I was talking about.
Give me just a few days to organize it better, finish the web interface and translate everything in english (cause I wrote comments and whatever in Italian....)

Just a fast answer about the mac change: the source of entropy for the /dev/random device - used by macchanger - is just the ethernet connection
So if the router has an active ethernet connection, the choice is quite random
If there is no active ethernet connection (but just wifi) so the choice is always the same
I solved with a trick

See you soon!

Nice to hear ....

Looking forward to testing a new build ....

@w0rdpress
No, the mac of ath*, the wifi network card
The original code of AAP is changing the mac of the wireless device (ath0) before connecting to a network according to the configuration (it means: a defined mac for networks with a filter, a random mac for all the other nets).
But the original code has a "weakness": if there is no active ethernet connection (but just wifi) so the random choice is not random at all (it is always the same)
There is no a top solution for it, cause of a leak of entropy in such small device
But I thought a trick, a pseudo-random choice: it is random cause it is every time different, but just pseudo cause behind there is a math algorithm (not a real randomness)

If you want to change the address of your eth0 (but actually I dont see why) you can use macchanger, the same used by AAP
It is installed by default on Piranha

thx.
macchanger does not work. even ifconfig doesnot work. i guess it's a driver issue.

lux wrote:

@w0rdpress
No, the mac of ath*, the wifi network card
The original code of AAP is changing the mac of the wireless device (ath0) before connecting to a network according to the configuration (it means: a defined mac for networks with a filter, a random mac for all the other nets).
But the original code has a "weakness": if there is no active ethernet connection (but just wifi) so the random choice is not random at all (it is always the same)
There is no a top solution for it, cause of a leak of entropy in such small device
But I thought a trick, a pseudo-random choice: it is random cause it is every time different, but just pseudo cause behind there is a math algorithm (not a real randomness)

If you want to change the address of your eth0 (but actually I dont see why) you can use macchanger, the same used by AAP
It is installed by default on Piranha

@w0rdpress
With this /etc/config/network:

config 'interface' 'loopback'
    option 'ifname' 'lo'
    option 'proto' 'static'
    option 'ipaddr' '127.0.0.1'
    option 'netmask' '255.0.0.0'

config 'interface' 'wan'
    option 'proto' 'dhcp'
#    option 'ifname' 'eth0.2'

config 'interface' 'lan'
    option 'proto' 'static'
    option 'ipaddr' '10.0.0.1'
    option 'netmask' '255.255.255.0'
    option 'ifname' 'eth0.1 eth0.2'
    option 'type' 'bridge'

Connected via wifi, I can change the mac address with an easy:
macchanger -A eth0.1

this looks interesting. never tried this before.
my goal was to change wan's mac though, to use my fonera as a regular router sometimes.

the bad news is that i just messed my the redboot of my little device :*( . btw, is there a howto on debricking this thing?(i guess jtag has to be involved this time)..

lux wrote:

@w0rdpress
With this /etc/config/network:

config 'interface' 'loopback'
    option 'ifname' 'lo'
    option 'proto' 'static'
    option 'ipaddr' '127.0.0.1'
    option 'netmask' '255.0.0.0'

config 'interface' 'wan'
    option 'proto' 'dhcp'
#    option 'ifname' 'eth0.2'

config 'interface' 'lan'
    option 'proto' 'static'
    option 'ipaddr' '10.0.0.1'
    option 'netmask' '255.255.255.0'
    option 'ifname' 'eth0.1 eth0.2'
    option 'type' 'bridge'

Connected via wifi, I can change the mac address with an easy:
macchanger -A eth0.1

orange,

It seems like your new Piranha build does indeed work flawlessly with my EnGenius EOC-2611P device that still has DD-WRT's idiotic MicroRedboot.

1. Does the Piranha firmware lack a web interface.
2. How do I set it up as a client bridge to an open network ?

KEEP UP THE GREAT WORK !!! GOOD LUCK WITH YOUR APARTMENT.

(Last edited by bulanula on 17 Oct 2010, 22:35)

orange,

It seems like your site is down. Can you please upload the 2 files needed to flash the firmware on rapidshare.com or 2shared.com etc. ?

THANKS !!!

Its currently working now ...

I was writing about some changes to AAP
I worked on it and I completed all that changes
This is to let everyone know about it

Anyway I sent all the new code to Orange
It is important to know that the biggest and hardest-to-write part of AAP is written by Orange and I couldn't write it starting from 0
I've just added and changed some features
So Orange now will decide what to do with my code: he can add some of my changes to the next Piranha release and he can refuse some changes
Moreover, at the moment, I'm in a mess cause I'm going to move in a week to a new country (to Amsterdam) with a new job
So probably I'll have not so much spare time in the next month

Here is a brief summary of my changes:

1) AAP WORKS ALSO WITH MULTIPLE VAP
AAP works with "a single madwifi-VAP ath0 in STA mode" as Orange wrote here: https://forum.openwrt.org/viewtopic.php?id=21636
I.e. the fonera connects to a wifi net in client mode and uses its internet connection
Fonera's clients has to connect to it via ethernet
I want fonera to create a VAP (virtual access point) in AP mode, i.e. a new wifi net which uses the internet connection from the previous
Now it is working even with multiple VAPs

2) RANDOM MAC ALSO WITHOUT ANY ETH CONNECTION
Before connecting to a net in client mode, AAP changes randomly the MAC address of the fonera's wifi device
But this change is not really random
The command used to randomly change the MAC address is:
macchanger -A wifi0
Macchanger, to get a random number, uses the device /dev/random
But in devices diskless, small and simple like the fonera, the entropy's source has not a high quality
So it happens often (e.g. 2 times on 10) that the new MAC is an old one already used before
This problem becomes more frustrating if the fonera is used without any ethernet connection (like me)
Because the entropy's source for the device /dev/random is right the ethernet connection
So, if there is no ethernet connection, 9 times on 10 the same "random" MAC is choosen
https://secure.wikimedia.org/wikipedia/en/wiki//dev/random
http://www.pinkas.net/PAPERS/gpr06.pdf
Now this problem is solved and the MAC is pseudo-random (every time it is different)

3) REWRITE FUNCTION aap_counter()
The function counter() check the time since the last scan
When the rescandelay (a parameter in the config file) interval is over, a new scan have to be done
By default, rescandelay is 12 hours
I rewrote this function minimizing the writes on disk

4) ANALYZE AND MINIMIZE WRITES ON DISK
Minimized all the writes on disks, cause the router has a solid state memory and it can be ruined if written too often

5) BETTER SCAN
The scan function use a command which updates the values of the signal power too slowly
I.e. if a net become instantly less powerful (e.g. from a power of 80 to a power of 30), that command takes 5 min to updates this value (even if run more times)
Now it is faster

6) CHANGES TO THE CHECK FUNCTION aap_check()
I changed the way to check if the connection is ok or not
Now the watchinet param has a bit different meaning
The check can be done in 2 ways:
    - using the ping command: if the param watchinet is 1
    - checking that ath0 is associated: otherwise
The first one tests if the network has a working internet connection (using the ping command and the parameter ineturl)
The second one just tests if the ath0 is associated
This second option is useful for me cause in my situation I have a lot of wifi networks available and all of them has always an internet connection
So in this situation, if a ping fails, is just a temporary problem (caused by some delay) and I dont want to skip this network
So it will check just the association status of ath0 using the command iwconfig

98) WEB GUI
Get the web interface at: http://10.0.0.1

99) SMALL BUGS AND CHANGES
Fixed some bugs in the log

That's down right cool ....

Hope your not absent too long Lux ....

I just put piranha on my fon 2100 and love the fact that it has the patched madwifi drivers and aircrack installed. one thing i was wondering is how to turn off channel hopping?

for instance -  say i run these commands

airodump-ng -c 11 --bssid B:L:A:H ath2

i get the channel set and it's only monitoring channel 11.

however when i run say:

aireplay-ng -3 -b B:L:A:H ath2

it can't find a beacon because the channels are hopping, even though airodump shows channel 11. the SET FIXED CHANNEL in airodump is hopping through channels.

i'm not sure if this is because of piranha or aircrack but i don't experience this on my other atheros card in my laptop using the same commands.

anyone have any suggestions?

Lux could you post or PM me the changes you made ??

nevermind. i was able to overcome the problem i was having. i wrote a simple script that disables everything and just keeps the fon as an external aircrack box. luckily i have another fon around that i already flashed with piranha so i can play around with this some more from a clean flash.

Yeah, lux, your changes look very nice and thought out.
Make sure to convince orange to implement them in his firmware.

bulanula wrote:

Yeah, lux, your changes look very nice and thought out.
Make sure to convince orange to implement them in his firmware.

Im chomping at the bit to try out any changes ...

GUI Luci don't work.

CODE:
opkg update
opkg install luci

Piranha download and install luci, but don't work.
Its only my problem?

aldomartini wrote:

GUI Luci don't work.

CODE:
opkg update
opkg install luci

Piranha download and install luci, but don't work.
Its only my problem?

No .. AutoAP installed Pirahna dosent have a GUI .. yet that im aware of.

It would be really cool if it did indeed have a GUI with aircrack-ng scripts or similar.

Seth7 wrote:
aldomartini wrote:

GUI Luci don't work.

CODE:
opkg update
opkg install luci

Piranha download and install luci, but don't work.
Its only my problem?

No .. AutoAP installed Pirahna dosent have a GUI .. yet that im aware of.

Is possible install a GUI (see post of Lux).
The repository is  http://downloads.openwrt.org/backfire/10.03/atheros/packages/

I download luci. Install, configure, but don't work.
I hope in solution from orange o lux.

Wait, so you are saying that even luci does not work ?
Anyways that is not important luci is useless anyway. I was thinking a little bit more advanced purpose-built GUI ( pen testing features etc. ).

Sorry, posts 76 to 75 are missing from our archive.