Tutorial [HOW-TO] Have a homemade Streetpass Relay

What method you are using?

  • Linux

    Votes: 93 7.9%
  • Android

    Votes: 133 11.4%
  • Router

    Votes: 226 19.3%
  • Windows

    Votes: 426 36.4%
  • A pony with a wifi antenna O.o?

    Votes: 292 25.0%

  • Total voters
    1,170
Status
Not open for further replies.

Shinitai

Well-Known Member
Newcomer
Joined
Dec 17, 2013
Messages
86
Trophies
0
XP
180
Country
Uruguay
I see there doesn't seem to be a good solution for people stuck with dd-wrt micro, so I made my own.
This python script:
Code:
#!/usr/bin/python2 -tt
# -*- coding: utf-8 -*-
 
import sys
import re
 
# Don't set this to True unless you know what you're doing.
DEBUG = False
 
# Number of hours a full cycle lasts. 8 is the optimal number as you can only
# streetpass with the same mac once in 8 hours.
# See also minute_interval below.
FULL_CYCLE = 8
 
# Code to change the mac. The {} will be replaced by the mac.
# New method.
CODE = ("ifconfig {i} down && ifconfig {i} hw ether {m} && "
        "ifconfig {i} up".format(m="{}",
                                i="eth1")) # <- PLACE YOUR INTERFACE HERE.
# Old method.
#CODE = "nvram set def_whwaddr={} sleep 3 && nvram commit sleep 5 && reboot"
 
 
def printmacs(filename):
    macs = []
    with open(filename, "r") as f:
        for mac in f:
            mac = mac.strip().upper()
            if mac == "":
                continue
            if not re.match("^([0-9A-F]{2}[:]){5}([0-9A-F]{2})$", mac):
                sys.stderr.write("Warning: '{}' doesn't look like a valid "
                                "mac, ignoring.\n".format(mac))
                continue
            macs.append(mac)
 
    if len(macs) == 0:
        sys.stderr.write("No valid macs found.\n")
        return 1
 
    # Minutes to wait before changing to the next mac.
    # Default is the optimal according to hour_interval and the number of
    # macs. You can set it manually it if you're feeling adventurous, but if
    # you set it too low you will leave a span of time in which the mac
    # doesn't change, and if you set it too high not all macs will fit.
    minute_interval = int(float(FULL_CYCLE) / len(macs) * 60)
 
    hour_offset = 0
    minute = 0
 
    if DEBUG:
        print "- MAC CYCLING CRONTAB START -"
 
    for mac in macs:
        hours = [hour + hour_offset for hour in xrange(0, 24, FULL_CYCLE)]
        if hours[-1] >= 24:
            sys.stderr.write("Warning: {} and all macs following it didn't "
                            "fit.\n".format(mac))
            break
        print "{} {} * * * root {}".format(minute,
                                          ",".join(map(str, hours)),
                                          CODE.format(mac))
        minute += minute_interval
        if minute >= 60:
            minute %= 60
            hour_offset += 1
 
    if DEBUG:
        print "- MAC CYCLING CRONTAB END -"
 
    return 0
 
 
def print_help(cmd):
    print "Usage: {} FILE_WITH_MAC_LIST".format(cmd)
    print
    print "Also be sure to open the script with a text editor and read the "
    print "comments to fine-tune it."
 
 
def main():
    if DEBUG:
        sys.argv.append("macs.txt")
    if len(sys.argv) < 2:
        print_help(sys.argv[0])
        return 1
    return printmacs(sys.argv[1])
 
if __name__ == "__main__":
    main()
Pass a file with a bunch of macs, and it will generate a crontab for you, that you can just paste in the "Cron additional jobs" textarea in Administration > Management.
The script will come up with the best change interval according to how many macs you provide, for an 8 hour cycle.

Here's an example generated crontab, with interface eth1 and macs from http://duke-srg.dyndns.org/3ds/nzone/?49,BASE16 :
Code:
0 0,8,16 * * * root ifconfig eth1 down && ifconfig eth1 hw ether 00:0D:0A:33:ED:72 && ifconfig eth1 up
5 0,8,16 * * * root ifconfig eth1 down && ifconfig eth1 hw ether 00:0D:67:12:86:C7 && ifconfig eth1 up
10 0,8,16 * * * root ifconfig eth1 down && ifconfig eth1 hw ether 00:0D:67:12:87:71 && ifconfig eth1 up
15 0,8,16 * * * root ifconfig eth1 down && ifconfig eth1 hw ether 00:0D:67:15:2D:82 && ifconfig eth1 up
20 0,8,16 * * * root ifconfig eth1 down && ifconfig eth1 hw ether 00:0D:67:15:D2:59 && ifconfig eth1 up
25 0,8,16 * * * root ifconfig eth1 down && ifconfig eth1 hw ether 00:0D:67:15:D5:44 && ifconfig eth1 up
30 0,8,16 * * * root ifconfig eth1 down && ifconfig eth1 hw ether 00:0D:67:15:D6:FD && ifconfig eth1 up
35 0,8,16 * * * root ifconfig eth1 down && ifconfig eth1 hw ether 00:0D:67:15:D7:21 && ifconfig eth1 up
40 0,8,16 * * * root ifconfig eth1 down && ifconfig eth1 hw ether 00:0D:67:1A:46:E7 && ifconfig eth1 up
45 0,8,16 * * * root ifconfig eth1 down && ifconfig eth1 hw ether 00:0D:67:1A:67:F3 && ifconfig eth1 up
50 0,8,16 * * * root ifconfig eth1 down && ifconfig eth1 hw ether 00:0D:67:1A:97:F0 && ifconfig eth1 up
55 0,8,16 * * * root ifconfig eth1 down && ifconfig eth1 hw ether 00:0D:67:26:68:80 && ifconfig eth1 up
0 1,9,17 * * * root ifconfig eth1 down && ifconfig eth1 hw ether 00:0D:BD:AF:DA:4A && ifconfig eth1 up
5 1,9,17 * * * root ifconfig eth1 down && ifconfig eth1 hw ether 00:0F:8F:71:2E:A2 && ifconfig eth1 up
10 1,9,17 * * * root ifconfig eth1 down && ifconfig eth1 hw ether 00:0F:F7:00:2D:82 && ifconfig eth1 up
15 1,9,17 * * * root ifconfig eth1 down && ifconfig eth1 hw ether 00:11:92:86:BE:40 && ifconfig eth1 up
20 1,9,17 * * * root ifconfig eth1 down && ifconfig eth1 hw ether 00:11:92:8D:A3:80 && ifconfig eth1 up
25 1,9,17 * * * root ifconfig eth1 down && ifconfig eth1 hw ether 00:11:93:05:CE:F0 && ifconfig eth1 up
30 1,9,17 * * * root ifconfig eth1 down && ifconfig eth1 hw ether 00:12:01:96:98:A2 && ifconfig eth1 up
35 1,9,17 * * * root ifconfig eth1 down && ifconfig eth1 hw ether 00:12:7F:CA:A1:A3 && ifconfig eth1 up
40 1,9,17 * * * root ifconfig eth1 down && ifconfig eth1 hw ether 00:13:1A:13:06:42 && ifconfig eth1 up
45 1,9,17 * * * root ifconfig eth1 down && ifconfig eth1 hw ether 00:13:60:11:B3:22 && ifconfig eth1 up
50 1,9,17 * * * root ifconfig eth1 down && ifconfig eth1 hw ether 00:14:69:1E:D3:93 && ifconfig eth1 up
55 1,9,17 * * * root ifconfig eth1 down && ifconfig eth1 hw ether 00:14:6A:C5:69:52 && ifconfig eth1 up
0 2,10,18 * * * root ifconfig eth1 down && ifconfig eth1 hw ether 00:15:63:9A:23:D2 && ifconfig eth1 up
5 2,10,18 * * * root ifconfig eth1 down && ifconfig eth1 hw ether 00:15:C6:29:51:42 && ifconfig eth1 up
10 2,10,18 * * * root ifconfig eth1 down && ifconfig eth1 hw ether 00:15:C6:29:5F:92 && ifconfig eth1 up
15 2,10,18 * * * root ifconfig eth1 down && ifconfig eth1 hw ether 00:16:C8:17:6E:30 && ifconfig eth1 up
20 2,10,18 * * * root ifconfig eth1 down && ifconfig eth1 hw ether 00:18:B9:B3:CE:70 && ifconfig eth1 up
25 2,10,18 * * * root ifconfig eth1 down && ifconfig eth1 hw ether 00:18:BA:C9:5E:90 && ifconfig eth1 up
30 2,10,18 * * * root ifconfig eth1 down && ifconfig eth1 hw ether 00:1A:A2:A2:17:23 && ifconfig eth1 up
35 2,10,18 * * * root ifconfig eth1 down && ifconfig eth1 hw ether 00:1D:70:9B:08:62 && ifconfig eth1 up
40 2,10,18 * * * root ifconfig eth1 down && ifconfig eth1 hw ether 00:1D:A2:D8:7D:80 && ifconfig eth1 up
45 2,10,18 * * * root ifconfig eth1 down && ifconfig eth1 hw ether 00:1E:13:42:CA:50 && ifconfig eth1 up
50 2,10,18 * * * root ifconfig eth1 down && ifconfig eth1 hw ether 00:1E:13:43:92:F0 && ifconfig eth1 up
55 2,10,18 * * * root ifconfig eth1 down && ifconfig eth1 hw ether 00:1F:9E:D3:64:60 && ifconfig eth1 up
0 3,11,19 * * * root ifconfig eth1 down && ifconfig eth1 hw ether 00:1F:9E:D3:84:60 && ifconfig eth1 up
5 3,11,19 * * * root ifconfig eth1 down && ifconfig eth1 hw ether 00:1F:CA:60:3E:20 && ifconfig eth1 up
10 3,11,19 * * * root ifconfig eth1 down && ifconfig eth1 hw ether 00:1F:CA:60:42:80 && ifconfig eth1 up
15 3,11,19 * * * root ifconfig eth1 down && ifconfig eth1 hw ether 00:20:A6:E3:5E:09 && ifconfig eth1 up
20 3,11,19 * * * root ifconfig eth1 down && ifconfig eth1 hw ether 00:21:55:B1:D8:90 && ifconfig eth1 up
25 3,11,19 * * * root ifconfig eth1 down && ifconfig eth1 hw ether 00:21:55:B4:E4:00 && ifconfig eth1 up
30 3,11,19 * * * root ifconfig eth1 down && ifconfig eth1 hw ether 00:21:D8:34:41:70 && ifconfig eth1 up
35 3,11,19 * * * root ifconfig eth1 down && ifconfig eth1 hw ether 00:21:D8:DE:AB:C0 && ifconfig eth1 up
40 3,11,19 * * * root ifconfig eth1 down && ifconfig eth1 hw ether 00:21:D8:DE:AC:00 && ifconfig eth1 up
45 3,11,19 * * * root ifconfig eth1 down && ifconfig eth1 hw ether 00:22:55:C3:9E:A0 && ifconfig eth1 up
50 3,11,19 * * * root ifconfig eth1 down && ifconfig eth1 hw ether 00:22:55:C3:9E:B0 && ifconfig eth1 up
55 3,11,19 * * * root ifconfig eth1 down && ifconfig eth1 hw ether 00:22:55:C4:CC:10 && ifconfig eth1 up
0 4,12,20 * * * root ifconfig eth1 down && ifconfig eth1 hw ether 00:23:68:8F:25:50 && ifconfig eth1 up
5 4,12,20 * * * root ifconfig eth1 down && ifconfig eth1 hw ether 00:24:14:10:DF:12 && ifconfig eth1 up
10 4,12,20 * * * root ifconfig eth1 down && ifconfig eth1 hw ether 00:25:9C:52:1C:6A && ifconfig eth1 up
15 4,12,20 * * * root ifconfig eth1 down && ifconfig eth1 hw ether 00:26:99:4E:B2:30 && ifconfig eth1 up
20 4,12,20 * * * root ifconfig eth1 down && ifconfig eth1 hw ether 00:3A:99:5B:D0:82 && ifconfig eth1 up
25 4,12,20 * * * root ifconfig eth1 down && ifconfig eth1 hw ether 00:3A:9A:10:BF:91 && ifconfig eth1 up
30 4,12,20 * * * root ifconfig eth1 down && ifconfig eth1 hw ether 00:88:65:54:B9:8B && ifconfig eth1 up
35 4,12,20 * * * root ifconfig eth1 down && ifconfig eth1 hw ether 00:90:FB:17:BE:9E && ifconfig eth1 up
40 4,12,20 * * * root ifconfig eth1 down && ifconfig eth1 hw ether 00:90:FB:32:8C:A4 && ifconfig eth1 up
45 4,12,20 * * * root ifconfig eth1 down && ifconfig eth1 hw ether 50:3D:E5:75:50:62 && ifconfig eth1 up
50 4,12,20 * * * root ifconfig eth1 down && ifconfig eth1 hw ether 58:6D:8F:0F:AD:7B && ifconfig eth1 up
55 4,12,20 * * * root ifconfig eth1 down && ifconfig eth1 hw ether 58:8D:09:B1:8A:62 && ifconfig eth1 up
0 5,13,21 * * * root ifconfig eth1 down && ifconfig eth1 hw ether 5C:0A:5B:2F:3E:61 && ifconfig eth1 up
5 5,13,21 * * * root ifconfig eth1 down && ifconfig eth1 hw ether C4:71:FE:5B:B0:22 && ifconfig eth1 up
10 5,13,21 * * * root ifconfig eth1 down && ifconfig eth1 hw ether C4:71:FE:5B:DE:F2 && ifconfig eth1 up
15 5,13,21 * * * root ifconfig eth1 down && ifconfig eth1 hw ether C4:71:FE:5C:2D:F2 && ifconfig eth1 up
20 5,13,21 * * * root ifconfig eth1 down && ifconfig eth1 hw ether E8:40:40:CD:ED:21 && ifconfig eth1 up
25 5,13,21 * * * root ifconfig eth1 down && ifconfig eth1 hw ether F0:7D:68:16:B7:2D && ifconfig eth1 up
30 5,13,21 * * * root ifconfig eth1 down && ifconfig eth1 hw ether 4E:53:50:4F:4F:40 && ifconfig eth1 up
35 5,13,21 * * * root ifconfig eth1 down && ifconfig eth1 hw ether 4E:53:50:4F:4F:41 && ifconfig eth1 up
40 5,13,21 * * * root ifconfig eth1 down && ifconfig eth1 hw ether 4E:53:50:4F:4F:42 && ifconfig eth1 up
45 5,13,21 * * * root ifconfig eth1 down && ifconfig eth1 hw ether 4E:53:50:4F:4F:43 && ifconfig eth1 up
50 5,13,21 * * * root ifconfig eth1 down && ifconfig eth1 hw ether 4E:53:50:4F:4F:44 && ifconfig eth1 up
55 5,13,21 * * * root ifconfig eth1 down && ifconfig eth1 hw ether 4E:53:50:4F:4F:45 && ifconfig eth1 up
0 6,14,22 * * * root ifconfig eth1 down && ifconfig eth1 hw ether 4E:53:50:4F:4F:46 && ifconfig eth1 up
5 6,14,22 * * * root ifconfig eth1 down && ifconfig eth1 hw ether 4E:53:50:4F:4F:47 && ifconfig eth1 up
10 6,14,22 * * * root ifconfig eth1 down && ifconfig eth1 hw ether 4E:53:50:4F:4F:48 && ifconfig eth1 up
15 6,14,22 * * * root ifconfig eth1 down && ifconfig eth1 hw ether 4E:53:50:4F:4F:49 && ifconfig eth1 up
20 6,14,22 * * * root ifconfig eth1 down && ifconfig eth1 hw ether 4E:53:50:4F:4F:4A && ifconfig eth1 up
25 6,14,22 * * * root ifconfig eth1 down && ifconfig eth1 hw ether 4E:53:50:4F:4F:4B && ifconfig eth1 up
30 6,14,22 * * * root ifconfig eth1 down && ifconfig eth1 hw ether 4E:53:50:4F:4F:4C && ifconfig eth1 up
35 6,14,22 * * * root ifconfig eth1 down && ifconfig eth1 hw ether 4E:53:50:4F:4F:4D && ifconfig eth1 up
40 6,14,22 * * * root ifconfig eth1 down && ifconfig eth1 hw ether 4E:53:50:4F:4F:4E && ifconfig eth1 up
45 6,14,22 * * * root ifconfig eth1 down && ifconfig eth1 hw ether 4E:53:50:4F:4F:4F && ifconfig eth1 up


Problem is, dd-wrt micro is pretty limited in space, so if you use too many macs, the resulting crontab is actually too big to fit. To solve that, I modified the script a little bit:
Code:
#!/usr/bin/python2 -tt
# -*- coding: utf-8 -*-
 
import sys
import re
 
# Don't set this to True unless you know what you're doing.
DEBUG = False
 
# Number of hours a full cycle lasts. 8 is the optimal number as you can only
# streetpass with the same mac once in 8 hours.
# See also minute_interval below.
FULL_CYCLE = 8
 
 
def printmacs(filename):
    macs = []
    with open(filename, "r") as f:
        for mac in f:
            mac = mac.strip().upper()
            if mac == "":
                continue
            if not re.match("^([0-9A-F]{2}[:]){5}([0-9A-F]{2})$", mac):
                sys.stderr.write("Warning: '{}' doesn't look like a valid "
                                "mac, ignoring.\n".format(mac))
                continue
            macs.append(mac)
 
    if len(macs) == 0:
        sys.stderr.write("No valid macs found.\n")
        return 1
 
    # Minutes to wait before changing to the next mac.
    # Default is the optimal according to hour_interval and the number of
    # macs. You can set it manually it if you're feeling adventurous, but if
    # you set it too low you will leave a span of time in which the mac
    # doesn't change, and if you set it too high not all macs will fit.
    minute_interval = int(float(FULL_CYCLE) / len(macs) * 60)
 
 
    print('c="$(nvram get wl0_ifname)"\n'
          'a="* * * root ifconfig $c down && ifconfig $c hw ether"\n'
          'b="&& ifconfig $c up"\n'
          'stopservice cron\n'
          'mkdir /tmp/cron.d\n'
          'echo "')
    hour_offset = 0
    minute = 0
    for mac in macs:
        hours = [hour + hour_offset for hour in xrange(0, 24, FULL_CYCLE)]
        if hours[-1] >= 24:
            sys.stderr.write("Warning: {} and all macs following it didn't "
                            "fit.\n".format(mac))
            break
        print "{} {} $a {} $b".format(minute, ",".join(map(str, hours)), mac)
        minute += minute_interval
        if minute >= 60:
            minute %= 60
            hour_offset += 1
    print('" > /tmp/cron.d/mac_cycling\n'
          'startservice cron')
 
    return 0
 
 
def print_help(cmd):
    print "Usage: {} FILE_WITH_MAC_LIST".format(cmd)
    print
    print "Also be sure to open the script with a text editor and read the "
    print "comments to fine-tune it."
 
 
def main():
    if DEBUG:
        sys.argv.append("macs.txt")
    if len(sys.argv) < 2:
        print_help(sys.argv[0])
        return 1
    return printmacs(sys.argv[1])
 
if __name__ == "__main__":
    main()
This time it generates a code rather than a crontab. This code you have to paste it in Administration > Commands and save it as a startup script. Reboot the router and you should be good to go. (Make sure you empty the "Cron additional jobs" first so you have more space to work with.)

Here's an example with the same macs from before:
Code:
c="$(nvram get wl0_ifname)"
a="* * * root ifconfig $c down && ifconfig $c hw ether"
b="&& ifconfig $c up"
stopservice cron
mkdir /tmp/cron.d
echo "
0 0,8,16 $a 00:0D:0A:33:ED:72 $b
5 0,8,16 $a 00:0D:67:12:86:C7 $b
10 0,8,16 $a 00:0D:67:12:87:71 $b
15 0,8,16 $a 00:0D:67:15:2D:82 $b
20 0,8,16 $a 00:0D:67:15:D2:59 $b
25 0,8,16 $a 00:0D:67:15:D5:44 $b
30 0,8,16 $a 00:0D:67:15:D6:FD $b
35 0,8,16 $a 00:0D:67:15:D7:21 $b
40 0,8,16 $a 00:0D:67:1A:46:E7 $b
45 0,8,16 $a 00:0D:67:1A:67:F3 $b
50 0,8,16 $a 00:0D:67:1A:97:F0 $b
55 0,8,16 $a 00:0D:67:26:68:80 $b
0 1,9,17 $a 00:0D:BD:AF:DA:4A $b
5 1,9,17 $a 00:0F:8F:71:2E:A2 $b
10 1,9,17 $a 00:0F:F7:00:2D:82 $b
15 1,9,17 $a 00:11:92:86:BE:40 $b
20 1,9,17 $a 00:11:92:8D:A3:80 $b
25 1,9,17 $a 00:11:93:05:CE:F0 $b
30 1,9,17 $a 00:12:01:96:98:A2 $b
35 1,9,17 $a 00:12:7F:CA:A1:A3 $b
40 1,9,17 $a 00:13:1A:13:06:42 $b
45 1,9,17 $a 00:13:60:11:B3:22 $b
50 1,9,17 $a 00:14:69:1E:D3:93 $b
55 1,9,17 $a 00:14:6A:C5:69:52 $b
0 2,10,18 $a 00:15:63:9A:23:D2 $b
5 2,10,18 $a 00:15:C6:29:51:42 $b
10 2,10,18 $a 00:15:C6:29:5F:92 $b
15 2,10,18 $a 00:16:C8:17:6E:30 $b
20 2,10,18 $a 00:18:B9:B3:CE:70 $b
25 2,10,18 $a 00:18:BA:C9:5E:90 $b
30 2,10,18 $a 00:1A:A2:A2:17:23 $b
35 2,10,18 $a 00:1D:70:9B:08:62 $b
40 2,10,18 $a 00:1D:A2:D8:7D:80 $b
45 2,10,18 $a 00:1E:13:42:CA:50 $b
50 2,10,18 $a 00:1E:13:43:92:F0 $b
55 2,10,18 $a 00:1F:9E:D3:64:60 $b
0 3,11,19 $a 00:1F:9E:D3:84:60 $b
5 3,11,19 $a 00:1F:CA:60:3E:20 $b
10 3,11,19 $a 00:1F:CA:60:42:80 $b
15 3,11,19 $a 00:20:A6:E3:5E:09 $b
20 3,11,19 $a 00:21:55:B1:D8:90 $b
25 3,11,19 $a 00:21:55:B4:E4:00 $b
30 3,11,19 $a 00:21:D8:34:41:70 $b
35 3,11,19 $a 00:21:D8:DE:AB:C0 $b
40 3,11,19 $a 00:21:D8:DE:AC:00 $b
45 3,11,19 $a 00:22:55:C3:9E:A0 $b
50 3,11,19 $a 00:22:55:C3:9E:B0 $b
55 3,11,19 $a 00:22:55:C4:CC:10 $b
0 4,12,20 $a 00:23:68:8F:25:50 $b
5 4,12,20 $a 00:24:14:10:DF:12 $b
10 4,12,20 $a 00:25:9C:52:1C:6A $b
15 4,12,20 $a 00:26:99:4E:B2:30 $b
20 4,12,20 $a 00:3A:99:5B:D0:82 $b
25 4,12,20 $a 00:3A:9A:10:BF:91 $b
30 4,12,20 $a 00:88:65:54:B9:8B $b
35 4,12,20 $a 00:90:FB:17:BE:9E $b
40 4,12,20 $a 00:90:FB:32:8C:A4 $b
45 4,12,20 $a 50:3D:E5:75:50:62 $b
50 4,12,20 $a 58:6D:8F:0F:AD:7B $b
55 4,12,20 $a 58:8D:09:B1:8A:62 $b
0 5,13,21 $a 5C:0A:5B:2F:3E:61 $b
5 5,13,21 $a C4:71:FE:5B:B0:22 $b
10 5,13,21 $a C4:71:FE:5B:DE:F2 $b
15 5,13,21 $a C4:71:FE:5C:2D:F2 $b
20 5,13,21 $a E8:40:40:CD:ED:21 $b
25 5,13,21 $a F0:7D:68:16:B7:2D $b
30 5,13,21 $a 4E:53:50:4F:4F:40 $b
35 5,13,21 $a 4E:53:50:4F:4F:41 $b
40 5,13,21 $a 4E:53:50:4F:4F:42 $b
45 5,13,21 $a 4E:53:50:4F:4F:43 $b
50 5,13,21 $a 4E:53:50:4F:4F:44 $b
55 5,13,21 $a 4E:53:50:4F:4F:45 $b
0 6,14,22 $a 4E:53:50:4F:4F:46 $b
5 6,14,22 $a 4E:53:50:4F:4F:47 $b
10 6,14,22 $a 4E:53:50:4F:4F:48 $b
15 6,14,22 $a 4E:53:50:4F:4F:49 $b
20 6,14,22 $a 4E:53:50:4F:4F:4A $b
25 6,14,22 $a 4E:53:50:4F:4F:4B $b
30 6,14,22 $a 4E:53:50:4F:4F:4C $b
35 6,14,22 $a 4E:53:50:4F:4F:4D $b
40 6,14,22 $a 4E:53:50:4F:4F:4E $b
45 6,14,22 $a 4E:53:50:4F:4F:4F $b
" > /tmp/cron.d/mac_cycling
startservice cron

TL;DR: If you have dd-wrt micro, just paste that code ^ into Administration > Commands, save it as a startup script, and then reboot the router.

(And of course don't forget about setting the SSID to attwifi and whatnot.)
Keep in mind, this will reboot the router for every mac change. I haven't found a way to change the mac with code without rebooting.

Edit: Also read Koldur's reply below.
Edit 2: Scripts and example codes updated. The problem described by Koldur is no longer relevant.
Also the router doesn't reboot for every mac change anymore, but the wireless interface is restarted each time.
 

Koldur

Virtual Boy Ambassador
Member
Joined
Feb 2, 2008
Messages
294
Trophies
1
XP
1,542
Country
Netherlands
I see there doesn't seem to be a good solution for people stuck with dd-wrt micro, so I made my own.
This python script:
Code:
#!/usr/bin/python2 -tt
# -*- coding: utf-8 -*-
 
import sys
import re
 
# Don't set this to True unless you know what you're doing.
DEBUG = False
 
# Number of hours a full cycle lasts. 8 is the optimal number as you can only
# streetpass with the same mac once in 8 hours.
# See also minute_interval below.
FULL_CYCLE = 8
 
# Code to change the mac. The {} will be replaced by the mac.
CODE = "nvram set def_whwaddr={} sleep 3 && nvram commit sleep 5 && reboot"
 
 
def printmacs(filename):
    macs = []
    with open(filename, "r") as f:
        for mac in f:
            mac = mac.strip().upper()
            if mac == "":
                continue
            if not re.match("^([0-9A-F]{2}[:]){5}([0-9A-F]{2})$", mac):
                sys.stderr.write("Warning: '{}' doesn't look like a valid "
                                "mac, ignoring.\n".format(mac))
                continue
            macs.append(mac)
 
    if len(macs) == 0:
        sys.stderr.write("No valid macs found.\n")
        return 1
 
    # Minutes to wait before changing to the next mac.
    # Default is the optimal according to hour_interval and the number of
    # macs. You can set it manually it if you're feeling adventurous, but if
    # you set it too low you will leave a span of time in which the mac
    # doesn't change, and if you set it too high not all macs will fit.
    minute_interval = int(float(FULL_CYCLE) / len(macs) * 60)
 
    hour_offset = 0
    minute = 0
 
    if DEBUG:
        print "- MAC CYCLING CRONTAB START -"
 
    for mac in macs:
        hours = [hour + hour_offset for hour in xrange(0, 24, FULL_CYCLE)]
        if hours[-1] >= 24:
            sys.stderr.write("Warning: {} and all macs following it didn't "
                            "fit.\n".format(mac))
            break
        print "{} {} * * * root {}".format(minute,
                                          ",".join(map(str, hours)),
                                          CODE.format(mac))
        minute += minute_interval
        if minute >= 60:
            minute %= 60
            hour_offset += 1
 
    if DEBUG:
        print "- MAC CYCLING CRONTAB END -"
 
    return 0
 
 
def print_help(cmd):
    print "Usage: {} FILE_WITH_MAC_LIST".format(cmd)
    print
    print "Also be sure to open the script with a text editor and read the "
    print "comments to fine-tune it."
 
 
def main():
    if DEBUG:
        sys.argv.append("macs.txt")
    if len(sys.argv) < 2:
        print_help(sys.argv[0])
        return 1
    return printmacs(sys.argv[1])
 
if __name__ == "__main__":
    main()

Pass a file with a bunch of macs, and it will generate a crontab for you, that you can just paste in the "Cron additional jobs" textarea in Administration > Management.
The script will come up with the best change interval according to how many macs you provide, for an 8 hour cycle.

Here's an example generated crontab, with macs from http://duke-srg.dyndns.org/3ds/nzone/?49,BASE16 :
Code:
0 0,8,16 * * * root nvram set def_whwaddr=00:0D:0A:33:ED:72 sleep 3 && nvram commit sleep 5 && reboot
5 0,8,16 * * * root nvram set def_whwaddr=00:0D:67:12:86:C7 sleep 3 && nvram commit sleep 5 && reboot
10 0,8,16 * * * root nvram set def_whwaddr=00:0D:67:12:87:71 sleep 3 && nvram commit sleep 5 && reboot
15 0,8,16 * * * root nvram set def_whwaddr=00:0D:67:15:2D:82 sleep 3 && nvram commit sleep 5 && reboot
20 0,8,16 * * * root nvram set def_whwaddr=00:0D:67:15:D2:59 sleep 3 && nvram commit sleep 5 && reboot
25 0,8,16 * * * root nvram set def_whwaddr=00:0D:67:15:D5:44 sleep 3 && nvram commit sleep 5 && reboot
30 0,8,16 * * * root nvram set def_whwaddr=00:0D:67:15:D6:FD sleep 3 && nvram commit sleep 5 && reboot
35 0,8,16 * * * root nvram set def_whwaddr=00:0D:67:15:D7:21 sleep 3 && nvram commit sleep 5 && reboot
40 0,8,16 * * * root nvram set def_whwaddr=00:0D:67:1A:46:E7 sleep 3 && nvram commit sleep 5 && reboot
45 0,8,16 * * * root nvram set def_whwaddr=00:0D:67:1A:67:F3 sleep 3 && nvram commit sleep 5 && reboot
50 0,8,16 * * * root nvram set def_whwaddr=00:0D:67:1A:97:F0 sleep 3 && nvram commit sleep 5 && reboot
55 0,8,16 * * * root nvram set def_whwaddr=00:0D:67:26:68:80 sleep 3 && nvram commit sleep 5 && reboot
0 1,9,17 * * * root nvram set def_whwaddr=00:0D:BD:AF:DA:4A sleep 3 && nvram commit sleep 5 && reboot
5 1,9,17 * * * root nvram set def_whwaddr=00:0F:8F:71:2E:A2 sleep 3 && nvram commit sleep 5 && reboot
10 1,9,17 * * * root nvram set def_whwaddr=00:0F:F7:00:2D:82 sleep 3 && nvram commit sleep 5 && reboot
15 1,9,17 * * * root nvram set def_whwaddr=00:11:92:86:BE:40 sleep 3 && nvram commit sleep 5 && reboot
20 1,9,17 * * * root nvram set def_whwaddr=00:11:92:8D:A3:80 sleep 3 && nvram commit sleep 5 && reboot
25 1,9,17 * * * root nvram set def_whwaddr=00:11:93:05:CE:F0 sleep 3 && nvram commit sleep 5 && reboot
30 1,9,17 * * * root nvram set def_whwaddr=00:12:01:96:98:A2 sleep 3 && nvram commit sleep 5 && reboot
35 1,9,17 * * * root nvram set def_whwaddr=00:12:7F:CA:A1:A3 sleep 3 && nvram commit sleep 5 && reboot
40 1,9,17 * * * root nvram set def_whwaddr=00:13:1A:13:06:42 sleep 3 && nvram commit sleep 5 && reboot
45 1,9,17 * * * root nvram set def_whwaddr=00:13:60:11:B3:22 sleep 3 && nvram commit sleep 5 && reboot
50 1,9,17 * * * root nvram set def_whwaddr=00:14:69:1E:D3:93 sleep 3 && nvram commit sleep 5 && reboot
55 1,9,17 * * * root nvram set def_whwaddr=00:14:6A:C5:69:52 sleep 3 && nvram commit sleep 5 && reboot
0 2,10,18 * * * root nvram set def_whwaddr=00:15:63:9A:23:D2 sleep 3 && nvram commit sleep 5 && reboot
5 2,10,18 * * * root nvram set def_whwaddr=00:15:C6:29:51:42 sleep 3 && nvram commit sleep 5 && reboot
10 2,10,18 * * * root nvram set def_whwaddr=00:15:C6:29:5F:92 sleep 3 && nvram commit sleep 5 && reboot
15 2,10,18 * * * root nvram set def_whwaddr=00:16:C8:17:6E:30 sleep 3 && nvram commit sleep 5 && reboot
20 2,10,18 * * * root nvram set def_whwaddr=00:18:B9:B3:CE:70 sleep 3 && nvram commit sleep 5 && reboot
25 2,10,18 * * * root nvram set def_whwaddr=00:18:BA:C9:5E:90 sleep 3 && nvram commit sleep 5 && reboot
30 2,10,18 * * * root nvram set def_whwaddr=00:1A:A2:A2:17:23 sleep 3 && nvram commit sleep 5 && reboot
35 2,10,18 * * * root nvram set def_whwaddr=00:1D:70:9B:08:62 sleep 3 && nvram commit sleep 5 && reboot
40 2,10,18 * * * root nvram set def_whwaddr=00:1D:A2:D8:7D:80 sleep 3 && nvram commit sleep 5 && reboot
45 2,10,18 * * * root nvram set def_whwaddr=00:1E:13:42:CA:50 sleep 3 && nvram commit sleep 5 && reboot
50 2,10,18 * * * root nvram set def_whwaddr=00:1E:13:43:92:F0 sleep 3 && nvram commit sleep 5 && reboot
55 2,10,18 * * * root nvram set def_whwaddr=00:1F:9E:D3:64:60 sleep 3 && nvram commit sleep 5 && reboot
0 3,11,19 * * * root nvram set def_whwaddr=00:1F:9E:D3:84:60 sleep 3 && nvram commit sleep 5 && reboot
5 3,11,19 * * * root nvram set def_whwaddr=00:1F:CA:60:3E:20 sleep 3 && nvram commit sleep 5 && reboot
10 3,11,19 * * * root nvram set def_whwaddr=00:1F:CA:60:42:80 sleep 3 && nvram commit sleep 5 && reboot
15 3,11,19 * * * root nvram set def_whwaddr=00:20:A6:E3:5E:09 sleep 3 && nvram commit sleep 5 && reboot
20 3,11,19 * * * root nvram set def_whwaddr=00:21:55:B1:D8:90 sleep 3 && nvram commit sleep 5 && reboot
25 3,11,19 * * * root nvram set def_whwaddr=00:21:55:B4:E4:00 sleep 3 && nvram commit sleep 5 && reboot
30 3,11,19 * * * root nvram set def_whwaddr=00:21:D8:34:41:70 sleep 3 && nvram commit sleep 5 && reboot
35 3,11,19 * * * root nvram set def_whwaddr=00:21:D8:DE:AB:C0 sleep 3 && nvram commit sleep 5 && reboot
40 3,11,19 * * * root nvram set def_whwaddr=00:21:D8:DE:AC:00 sleep 3 && nvram commit sleep 5 && reboot
45 3,11,19 * * * root nvram set def_whwaddr=00:22:55:C3:9E:A0 sleep 3 && nvram commit sleep 5 && reboot
50 3,11,19 * * * root nvram set def_whwaddr=00:22:55:C3:9E:B0 sleep 3 && nvram commit sleep 5 && reboot
55 3,11,19 * * * root nvram set def_whwaddr=00:22:55:C4:CC:10 sleep 3 && nvram commit sleep 5 && reboot
0 4,12,20 * * * root nvram set def_whwaddr=00:23:68:8F:25:50 sleep 3 && nvram commit sleep 5 && reboot
5 4,12,20 * * * root nvram set def_whwaddr=00:24:14:10:DF:12 sleep 3 && nvram commit sleep 5 && reboot
10 4,12,20 * * * root nvram set def_whwaddr=00:25:9C:52:1C:6A sleep 3 && nvram commit sleep 5 && reboot
15 4,12,20 * * * root nvram set def_whwaddr=00:26:99:4E:B2:30 sleep 3 && nvram commit sleep 5 && reboot
20 4,12,20 * * * root nvram set def_whwaddr=00:3A:99:5B:D0:82 sleep 3 && nvram commit sleep 5 && reboot
25 4,12,20 * * * root nvram set def_whwaddr=00:3A:9A:10:BF:91 sleep 3 && nvram commit sleep 5 && reboot
30 4,12,20 * * * root nvram set def_whwaddr=00:88:65:54:B9:8B sleep 3 && nvram commit sleep 5 && reboot
35 4,12,20 * * * root nvram set def_whwaddr=00:90:FB:17:BE:9E sleep 3 && nvram commit sleep 5 && reboot
40 4,12,20 * * * root nvram set def_whwaddr=00:90:FB:32:8C:A4 sleep 3 && nvram commit sleep 5 && reboot
45 4,12,20 * * * root nvram set def_whwaddr=50:3D:E5:75:50:62 sleep 3 && nvram commit sleep 5 && reboot
50 4,12,20 * * * root nvram set def_whwaddr=58:6D:8F:0F:AD:7B sleep 3 && nvram commit sleep 5 && reboot
55 4,12,20 * * * root nvram set def_whwaddr=58:8D:09:B1:8A:62 sleep 3 && nvram commit sleep 5 && reboot
0 5,13,21 * * * root nvram set def_whwaddr=5C:0A:5B:2F:3E:61 sleep 3 && nvram commit sleep 5 && reboot
5 5,13,21 * * * root nvram set def_whwaddr=C4:71:FE:5B:B0:22 sleep 3 && nvram commit sleep 5 && reboot
10 5,13,21 * * * root nvram set def_whwaddr=C4:71:FE:5B:DE:F2 sleep 3 && nvram commit sleep 5 && reboot
15 5,13,21 * * * root nvram set def_whwaddr=C4:71:FE:5C:2D:F2 sleep 3 && nvram commit sleep 5 && reboot
20 5,13,21 * * * root nvram set def_whwaddr=E8:40:40:CD:ED:21 sleep 3 && nvram commit sleep 5 && reboot
25 5,13,21 * * * root nvram set def_whwaddr=F0:7D:68:16:B7:2D sleep 3 && nvram commit sleep 5 && reboot
30 5,13,21 * * * root nvram set def_whwaddr=4E:53:50:4F:4F:40 sleep 3 && nvram commit sleep 5 && reboot
35 5,13,21 * * * root nvram set def_whwaddr=4E:53:50:4F:4F:41 sleep 3 && nvram commit sleep 5 && reboot
40 5,13,21 * * * root nvram set def_whwaddr=4E:53:50:4F:4F:42 sleep 3 && nvram commit sleep 5 && reboot
45 5,13,21 * * * root nvram set def_whwaddr=4E:53:50:4F:4F:43 sleep 3 && nvram commit sleep 5 && reboot
50 5,13,21 * * * root nvram set def_whwaddr=4E:53:50:4F:4F:44 sleep 3 && nvram commit sleep 5 && reboot
55 5,13,21 * * * root nvram set def_whwaddr=4E:53:50:4F:4F:45 sleep 3 && nvram commit sleep 5 && reboot
0 6,14,22 * * * root nvram set def_whwaddr=4E:53:50:4F:4F:46 sleep 3 && nvram commit sleep 5 && reboot
5 6,14,22 * * * root nvram set def_whwaddr=4E:53:50:4F:4F:47 sleep 3 && nvram commit sleep 5 && reboot
10 6,14,22 * * * root nvram set def_whwaddr=4E:53:50:4F:4F:48 sleep 3 && nvram commit sleep 5 && reboot
15 6,14,22 * * * root nvram set def_whwaddr=4E:53:50:4F:4F:49 sleep 3 && nvram commit sleep 5 && reboot
20 6,14,22 * * * root nvram set def_whwaddr=4E:53:50:4F:4F:4A sleep 3 && nvram commit sleep 5 && reboot
25 6,14,22 * * * root nvram set def_whwaddr=4E:53:50:4F:4F:4B sleep 3 && nvram commit sleep 5 && reboot
30 6,14,22 * * * root nvram set def_whwaddr=4E:53:50:4F:4F:4C sleep 3 && nvram commit sleep 5 && reboot
35 6,14,22 * * * root nvram set def_whwaddr=4E:53:50:4F:4F:4D sleep 3 && nvram commit sleep 5 && reboot
40 6,14,22 * * * root nvram set def_whwaddr=4E:53:50:4F:4F:4E sleep 3 && nvram commit sleep 5 && reboot
45 6,14,22 * * * root nvram set def_whwaddr=4E:53:50:4F:4F:4F sleep 3 && nvram commit sleep 5 && reboot

Problem is, dd-wrt micro is pretty limited in space, so if you use too many macs, the resulting crontab is actually too big to fit. To solve that, I modified the script a little bit:
Code:
#!/usr/bin/python2 -tt
# -*- coding: utf-8 -*-
 
import sys
import re
 
# Don't set this to True unless you know what you're doing.
DEBUG = False
 
# Number of hours a full cycle lasts. 8 is the optimal number as you can only
# streetpass with the same mac once in 8 hours.
# See also minute_interval below.
FULL_CYCLE = 8
 
 
def printmacs(filename):
    macs = []
    with open(filename, "r") as f:
        for mac in f:
            mac = mac.strip().upper()
            if mac == "":
                continue
            if not re.match("^([0-9A-F]{2}[:]){5}([0-9A-F]{2})$", mac):
                sys.stderr.write("Warning: '{}' doesn't look like a valid "
                                "mac, ignoring.\n".format(mac))
                continue
            macs.append(mac)
 
    if len(macs) == 0:
        sys.stderr.write("No valid macs found.\n")
        return 1
 
    # Minutes to wait before changing to the next mac.
    # Default is the optimal according to hour_interval and the number of
    # macs. You can set it manually it if you're feeling adventurous, but if
    # you set it too low you will leave a span of time in which the mac
    # doesn't change, and if you set it too high not all macs will fit.
    minute_interval = int(float(FULL_CYCLE) / len(macs) * 60)
 
    print('a="* * * root nvram set def_whwaddr"\n'
          'b="sleep 3 && nvram commit sleep 5 && reboot"\n'
          'stopservice cron\n'
          'mkdir /tmp/cron.d\n'
          'echo "')
 
    hour_offset = 0
    minute = 0
    for mac in macs:
        hours = [hour + hour_offset for hour in xrange(0, 24, FULL_CYCLE)]
        if hours[-1] >= 24:
            sys.stderr.write("Warning: {} and all macs following it didn't "
                            "fit.\n".format(mac))
            break
        print "{} {} $a={} $b".format(minute, ",".join(map(str, hours)), mac)
        minute += minute_interval
        if minute >= 60:
            minute %= 60
            hour_offset += 1
    print('" > /tmp/cron.d/mac_cycling\n'
          'startservice cron')
 
    return 0
 
 
def print_help(cmd):
    print "Usage: {} FILE_WITH_MAC_LIST".format(cmd)
    print
    print "Also be sure to open the script with a text editor and read the "
    print "comments to fine-tune it."
 
 
def main():
    if DEBUG:
        sys.argv.append("macs.txt")
    if len(sys.argv) < 2:
        print_help(sys.argv[0])
        return 1
    return printmacs(sys.argv[1])
 
if __name__ == "__main__":
    main()
This time it generates a code rather than a crontab. This code you have to paste it in Administration > Commands and save it as a startup script, then paste it again and execute it and you should be good to go. (Make sure you empty the "Cron additional jobs" first so you have more space to work with.)

Here's an example with the same macs from before:
Code:
a="* * * root nvram set def_whwaddr"
b="sleep 3 && nvram commit sleep 5 && reboot"
stopservice cron
mkdir /tmp/cron.d
echo "
0 0,8,16 $a=00:0D:0A:33:ED:72 $b
5 0,8,16 $a=00:0D:67:12:86:C7 $b
10 0,8,16 $a=00:0D:67:12:87:71 $b
15 0,8,16 $a=00:0D:67:15:2D:82 $b
20 0,8,16 $a=00:0D:67:15:D2:59 $b
25 0,8,16 $a=00:0D:67:15:D5:44 $b
30 0,8,16 $a=00:0D:67:15:D6:FD $b
35 0,8,16 $a=00:0D:67:15:D7:21 $b
40 0,8,16 $a=00:0D:67:1A:46:E7 $b
45 0,8,16 $a=00:0D:67:1A:67:F3 $b
50 0,8,16 $a=00:0D:67:1A:97:F0 $b
55 0,8,16 $a=00:0D:67:26:68:80 $b
0 1,9,17 $a=00:0D:BD:AF:DA:4A $b
5 1,9,17 $a=00:0F:8F:71:2E:A2 $b
10 1,9,17 $a=00:0F:F7:00:2D:82 $b
15 1,9,17 $a=00:11:92:86:BE:40 $b
20 1,9,17 $a=00:11:92:8D:A3:80 $b
25 1,9,17 $a=00:11:93:05:CE:F0 $b
30 1,9,17 $a=00:12:01:96:98:A2 $b
35 1,9,17 $a=00:12:7F:CA:A1:A3 $b
40 1,9,17 $a=00:13:1A:13:06:42 $b
45 1,9,17 $a=00:13:60:11:B3:22 $b
50 1,9,17 $a=00:14:69:1E:D3:93 $b
55 1,9,17 $a=00:14:6A:C5:69:52 $b
0 2,10,18 $a=00:15:63:9A:23:D2 $b
5 2,10,18 $a=00:15:C6:29:51:42 $b
10 2,10,18 $a=00:15:C6:29:5F:92 $b
15 2,10,18 $a=00:16:C8:17:6E:30 $b
20 2,10,18 $a=00:18:B9:B3:CE:70 $b
25 2,10,18 $a=00:18:BA:C9:5E:90 $b
30 2,10,18 $a=00:1A:A2:A2:17:23 $b
35 2,10,18 $a=00:1D:70:9B:08:62 $b
40 2,10,18 $a=00:1D:A2:D8:7D:80 $b
45 2,10,18 $a=00:1E:13:42:CA:50 $b
50 2,10,18 $a=00:1E:13:43:92:F0 $b
55 2,10,18 $a=00:1F:9E:D3:64:60 $b
0 3,11,19 $a=00:1F:9E:D3:84:60 $b
5 3,11,19 $a=00:1F:CA:60:3E:20 $b
10 3,11,19 $a=00:1F:CA:60:42:80 $b
15 3,11,19 $a=00:20:A6:E3:5E:09 $b
20 3,11,19 $a=00:21:55:B1:D8:90 $b
25 3,11,19 $a=00:21:55:B4:E4:00 $b
30 3,11,19 $a=00:21:D8:34:41:70 $b
35 3,11,19 $a=00:21:D8:DE:AB:C0 $b
40 3,11,19 $a=00:21:D8:DE:AC:00 $b
45 3,11,19 $a=00:22:55:C3:9E:A0 $b
50 3,11,19 $a=00:22:55:C3:9E:B0 $b
55 3,11,19 $a=00:22:55:C4:CC:10 $b
0 4,12,20 $a=00:23:68:8F:25:50 $b
5 4,12,20 $a=00:24:14:10:DF:12 $b
10 4,12,20 $a=00:25:9C:52:1C:6A $b
15 4,12,20 $a=00:26:99:4E:B2:30 $b
20 4,12,20 $a=00:3A:99:5B:D0:82 $b
25 4,12,20 $a=00:3A:9A:10:BF:91 $b
30 4,12,20 $a=00:88:65:54:B9:8B $b
35 4,12,20 $a=00:90:FB:17:BE:9E $b
40 4,12,20 $a=00:90:FB:32:8C:A4 $b
45 4,12,20 $a=50:3D:E5:75:50:62 $b
50 4,12,20 $a=58:6D:8F:0F:AD:7B $b
55 4,12,20 $a=58:8D:09:B1:8A:62 $b
0 5,13,21 $a=5C:0A:5B:2F:3E:61 $b
5 5,13,21 $a=C4:71:FE:5B:B0:22 $b
10 5,13,21 $a=C4:71:FE:5B:DE:F2 $b
15 5,13,21 $a=C4:71:FE:5C:2D:F2 $b
20 5,13,21 $a=E8:40:40:CD:ED:21 $b
25 5,13,21 $a=F0:7D:68:16:B7:2D $b
30 5,13,21 $a=4E:53:50:4F:4F:40 $b
35 5,13,21 $a=4E:53:50:4F:4F:41 $b
40 5,13,21 $a=4E:53:50:4F:4F:42 $b
45 5,13,21 $a=4E:53:50:4F:4F:43 $b
50 5,13,21 $a=4E:53:50:4F:4F:44 $b
55 5,13,21 $a=4E:53:50:4F:4F:45 $b
0 6,14,22 $a=4E:53:50:4F:4F:46 $b
5 6,14,22 $a=4E:53:50:4F:4F:47 $b
10 6,14,22 $a=4E:53:50:4F:4F:48 $b
15 6,14,22 $a=4E:53:50:4F:4F:49 $b
20 6,14,22 $a=4E:53:50:4F:4F:4A $b
25 6,14,22 $a=4E:53:50:4F:4F:4B $b
30 6,14,22 $a=4E:53:50:4F:4F:4C $b
35 6,14,22 $a=4E:53:50:4F:4F:4D $b
40 6,14,22 $a=4E:53:50:4F:4F:4E $b
45 6,14,22 $a=4E:53:50:4F:4F:4F $b
" > /tmp/cron.d/mac_cycling
startservice cron

TL;DR: If you have dd-wrt micro, just paste that code ^ into Administration > Management, save it as a startup script, paste it again and execute it.

(And of course don't forget about setting the SSID to attwifi and whatnot.)

Keep in mind, this will reboot the router for every mac change. I haven't found a way to change the mac with code without rebooting.


Very nice to have this available, though for everyone wanting to use this, be aware that your router will wear out within a very short amount of time due to the nvram writes this uses! Nvram is somewhat similar to an SSD and has a relatively low write life. If you change up macs this much, it will kill the nvram (which means you can never change settings again when this happens, thus renders the router useless) pretty fast.
 

Shinitai

Well-Known Member
Newcomer
Joined
Dec 17, 2013
Messages
86
Trophies
0
XP
180
Country
Uruguay
Very nice to have this available, though for everyone wanting to use this, be aware that your router will wear out within a very short amount of time due to the nvram writes this uses! Nvram is somewhat similar to an SSD and has a relatively low write life. If you change up macs this much, it will kill the nvram (which means you can never change settings again when this happens, thus renders the router useless) pretty fast.
Jesus, are you serious? I wasn't aware of that.
Time to think of a better solution then. Preferably one that also doesn't involve rebooting the router :/.
 

lambstone

No. Nyet. 不. Non. Nein.
Banned
Joined
Aug 14, 2011
Messages
614
Trophies
0
XP
310
Country
What happens if my laptop has a intel wifi card and I plug in a seperate TP-Link wifi dongle? How can I set the dongle to be the virtual AP?
 

Shinitai

Well-Known Member
Newcomer
Joined
Dec 17, 2013
Messages
86
Trophies
0
XP
180
Country
Uruguay
Jesus, are you serious? I wasn't aware of that.
Time to think of a better solution then. Preferably one that also doesn't involve rebooting the router :/.
It's official - I can't figure it out. The most obvious solution would be
Code:
ifconfig eth1 down
ifconfig eth1 hw ether 00:11:22:33:44:55
ifconfig eth1 up
but it doesn't work. ifconfig reports the mac has changed but it hasn't.

On another note however, it seems dd-wrt already maintains a couple of logs in nvram, and doing so involves writing to nvram quite often. So I say the code is probably fine as it is. Probably.
 

Koldur

Virtual Boy Ambassador
Member
Joined
Feb 2, 2008
Messages
294
Trophies
1
XP
1,542
Country
Netherlands
It's official - I can't figure it out. The most obvious solution would be
Code:
ifconfig eth1 down
ifconfig eth1 hw ether 00:11:22:33:44:55
ifconfig eth1 up
but it doesn't work. ifconfig reports the mac has changed but it hasn't.

On another note however, it seems dd-wrt already maintains a couple of logs in nvram, and doing so involves writing to nvram quite often. So I say the code is probably fine as it is. Probably.


It has been covered here a lot, that it is not a good idea to use nvram, I used to have a micro router and this command worked flawlessly:

Code:
0 0 * * * root ifconfig eth1 down && ifconfig eth1 hw ether 4E:53:50:4F:4F:08 && ifconfig eth1 up
So, it is strange it doesn't work for you.
 

Shinitai

Well-Known Member
Newcomer
Joined
Dec 17, 2013
Messages
86
Trophies
0
XP
180
Country
Uruguay
It has been covered here a lot, that it is not a good idea to use nvram, I used to have a micro router and this command worked flawlessly:

Code:
0 0 * * * root ifconfig eth1 down && ifconfig eth1 hw ether 4E:53:50:4F:4F:08 && ifconfig eth1 up
So, it is strange it doesn't work for you.
You've gotta be kidding me. How did you check that the mac did indeed change?
When I run that code via telnet, ifconfig shows the new mac, but the control panel still shows the old one, and running `iwlist wlan0 scan` on my Linux PC also reports that the mac associated with the "attwifi" ESSID is the old one.
But I'll try it with cron...

Edit: Well I'll be. It seems to be working and everything. I'll do some more testing and post the updated scripts/crontab...
Edit 2: OK, scripts updated. Everyone should be happy now.
 

Koldur

Virtual Boy Ambassador
Member
Joined
Feb 2, 2008
Messages
294
Trophies
1
XP
1,542
Country
Netherlands
You've gotta be kidding me. How did you check that the mac did indeed change?
When I run that code via telnet, ifconfig shows the new mac, but the control panel still shows the old one, and running `iwlist wlan0 scan` on my Linux PC also reports that the mac associated with the "attwifi" ESSID is the old one.
But I'll try it with cron...

Edit: Well I'll be. It seems to be working and everything. I'll do some more testing and post the updated scripts/crontab...
Edit 2: OK, scripts updated. Everyone should be happy now.


Great that it worked out! I had that too though, that the router still showed the old MAC, but inSSIDer showed the new MAC, which is what counts in the end. Have fun Streetpassing!!
 

lambstone

No. Nyet. 不. Non. Nein.
Banned
Joined
Aug 14, 2011
Messages
614
Trophies
0
XP
310
Country
I still can't seem to get homepass working.

The BSSID was set to attwifi, and I've changed the mac address of my wifi adapter to the ones on the google docs list. My 3ds was connected to the attwifi AP with internet access. I still am not getting any streetpasses. Is there a minimum time limit? I left it on standby for about 5 mins and nothing.
 

Shinitai

Well-Known Member
Newcomer
Joined
Dec 17, 2013
Messages
86
Trophies
0
XP
180
Country
Uruguay
I still can't seem to get homepass working.

The BSSID was set to attwifi, and I've changed the mac address of my wifi adapter to the ones on the google docs list. My 3ds was connected to the attwifi AP with internet access. I still am not getting any streetpasses. Is there a minimum time limit? I left it on standby for about 5 mins and nothing.
What method are you using? Are you sure the mac is changing? If you're on Linux you can verify with `iwlist wlan0 scan`. Otherwise you can probably use that "inSSIDer" tool Koldur mentioned.
Also I don't know what you mean by "minimum time limit". You can only streetpass with one mac every eight hours if that's what you're asking. And 5 minutes should be more than enough (it usually takes less than a minute from the moment you close the console).

Edit: Oh and make sure your firmware version is 6.2 or higher.
 

lambstone

No. Nyet. 不. Non. Nein.
Banned
Joined
Aug 14, 2011
Messages
614
Trophies
0
XP
310
Country
What method are you using? Are you sure the mac is changing? If you're on Linux you can verify with `iwlist wlan0 scan`. Otherwise you can probably use that "inSSIDer" tool Koldur mentioned.
Also I don't know what you mean by "minimum time limit". You can only streetpass with one mac every eight hours if that's what you're asking. And 5 minutes should be more than enough (it usually takes less than a minute from the moment you close the console).

Edit: Oh and make sure your firmware version is 6.2 or higher.

I'm on windows 8 using the netsh method, I have an EU console on latest FW. Yeah, I did the mac change manually in device manager > network address thing.
 

Shinitai

Well-Known Member
Newcomer
Joined
Dec 17, 2013
Messages
86
Trophies
0
XP
180
Country
Uruguay
I'm on windows 8 using the netsh method, I have an EU console on latest FW. Yeah, I did the mac change manually in device manager > network address thing.
Does the Nintendo Zone become available when you start broadcasting the signal with the attwifi SSID?
 

gameboybin

Member
Newcomer
Joined
Jan 28, 2013
Messages
11
Trophies
0
Age
29
Location
Hanoi, Vietnam
XP
76
Country

pBullet

SHSL Idol
Member
Joined
May 8, 2012
Messages
176
Trophies
1
Age
33
Location
Rhode Island
XP
280
Country
United States
THis thread is to long now. I don't know where to begin. I want to use my PC (windows) to make a streetpass. So what should i do now

What are this???
http://gbatemp.net/threads/homepass-chaldrons-mac-cycler-for-windows.352935/

http://gbatemp.net/threads/macycle-the-improved-mac-changer-for-homepass.353328/

http://gbatemp.net/threads/homepass-macpass.354279/

which one is better. I searched from the thread and found that any of them contains some errors, so which one should i use


Do you have a laptop? And does it have a wireless card? And do you have an Ethernet cable?
 
Status
Not open for further replies.

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    K3Nv2 @ K3Nv2: https://youtu.be/sGvT5FKSiyk?si=TYqsdjjbF-4N8Xc8