MAC Clone: How do I get a very different IP each time?

Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions
Author Message
Spoofy
DD-WRT Novice


Joined: 03 Jun 2019
Posts: 7

PostPosted: Wed Jun 12, 2019 0:21    Post subject: MAC Clone: How do I get a very different IP each time? Reply with quote
I think that my edits to the MAC Address Clone area too often give me too similar an IP to one I already had before, such as where the only section of the IP that's any different from a previous one is the last numbers. I think that's not different enough of an IP for my uses. I keep a record of each IP my computer had with each MAC address change, and it always uses one of two sets of the same first 2 starting numbers (in the first 2 out of 4 total areas of the IP). How can I get the IP to change to something more different? Where even the very first number of the resulting IP address is always different each time?
Thanks
Sponsor
Wildlion
DD-WRT Guru


Joined: 24 May 2016
Posts: 1408

PostPosted: Wed Jun 12, 2019 1:14    Post subject: Reply with quote
what is the subnet (or netmask) that you have?

If it is of the form 255.255.255.0 or a /24, the only number that will change is the last number.
Spoofy
DD-WRT Novice


Joined: 03 Jun 2019
Posts: 7

PostPosted: Wed Jun 12, 2019 2:01    Post subject: Reply with quote
eibgrad wrote:
I'm going to assume having a very different MAC address each time will help.

Code:
echo $(tr -dc A-F0-9 < /dev/urandom | head -c 10 | sed -r 's/(..)/\1:/g;s/:$//;s/^/02:/')


Not my own invention. Found it at the following website.

https://serverfault.com/questions/299556/how-to-generate-a-random-mac-address-from-the-linux-command-line

Where do I put this code? I'm used to just using the http://192.168.1.1/WanMAC.asp area of DD-WRT. Thanks
Spoofy
DD-WRT Novice


Joined: 03 Jun 2019
Posts: 7

PostPosted: Wed Jun 12, 2019 2:08    Post subject: Reply with quote
Wildlion wrote:
what is the subnet (or netmask) that you have?

If it is of the form 255.255.255.0 or a /24, the only number that will change is the last number.

The Router IP Subnet Mask is indeed 255.255.255.0 under Setup, Basic Setup, Network Setup. Is it possible for me to change this, without breaking internet, and where it helps?
So far I only get IPs in this pattern:
67.243.(50 or 51).Random #
24.161.(39 or 108 or 118).Random #
Hopefully it's safe for me to post that. That's the most different it gets so far. I hope, for my uses, it's fine as long as the third number is at least something totally new, but, for all I know, the fact that the first two numbers are always the same is what's failing me. Is there a way of increasing my chances of at least getting the second number to be something different?
Thanks
Spoofy
DD-WRT Novice


Joined: 03 Jun 2019
Posts: 7

PostPosted: Wed Jun 12, 2019 3:17    Post subject: Reply with quote
eibgrad wrote:
Spoofy wrote:
eibgrad wrote:
I'm going to assume having a very different MAC address each time will help.

Code:
echo $(tr -dc A-F0-9 < /dev/urandom | head -c 10 | sed -r 's/(..)/\1:/g;s/:$//;s/^/02:/')


Not my own invention. Found it at the following website.

https://serverfault.com/questions/299556/how-to-generate-a-random-mac-address-from-the-linux-command-line

Where do I put this code? I'm used to just using the http://192.168.1.1/WanMAC.asp area of DD-WRT. Thanks


You need to be more specific about when you want the IP/MAC address to change. Do you plan to reboot every night and expect a change in public IP? Do you want it to automatically reboot and change the IP on some regular basis (e.g., using the scheduler (cron)? Should it not involve a reboot at all, but just restart the WAN on some basis?

All of these will require a script to change the MAC address, reboot (or restart the WAN w/o a reboot), using some trigger. But you've provided no details. You just say it should change "each time", whatever that means.

Once you have those details, you can build a script to handle it using that piece of code as a means to generate a new MAC address. There happens to be such a script in the following link.

https://wiki.dd-wrt.com/wiki/index.php/Useful_Scripts#Auto_Random_MAC_Address

Not sure how good it is. Doesn't really seem complete. But there are probably other similar scripts either in the dd-wrt forums or perhaps elsewhere on the web. This isn't the first time I've heard this kind of request.

I mean each time I change the MAC address myself in http://192.168.1.1/WanMAC.asp
MAC Address Clone
MAC Clone
I usually just change the last two digits to something else, like +01, then hit Save, then Apply Changes, then unplug entire modem/router setup for at least 30sec, and when it's back up, it has a new IP.

It's in order to use a pretty well known website that unfortunately bans way too easily, even when following the ToS. VPNs seem impossible to use on this site as well, it's like they somehow know when you're using one, which is beyond me since that seems against one of the concepts of a VPN. However, I doubt a well-known site would want to ban every IP that simply shares the same first two octets, as that may represent a pretty wide radius of residential IPs on the map, which is why if I could just ensure that at least the third octet is different each time, maybe that IP wouldn't already be banned on the site. Maybe my best chance is to change the MAC, see what the IP becomes, and repeat.
Wildlion
DD-WRT Guru


Joined: 24 May 2016
Posts: 1408

PostPosted: Thu Jun 13, 2019 0:33    Post subject: Reply with quote
Okay, So it is on the ISP end. To get the those to change it depends on what areas the ISP has mapped and what others have open (assuming DHCP). Your ISP is only allocated certain blocks of IP address. with the IP Subnet Mask being 255.255.255.0 that means only the last number will change the majority of the time. Let's assume that each is 254 addresses, you have in the 5 options 5*254 or 1270 options. Depending on how big your ISP is that might be it, but it could also be because those are the only address that they have delegated for your area.

I can not find it right now, but many dhcp servers have changed to a calculation of your ip address based on your MAC address (and other factors) since the MAC address is the only thing you can control, but those other things make a difference such as what others are using
Spoofy
DD-WRT Novice


Joined: 03 Jun 2019
Posts: 7

PostPosted: Thu Jun 13, 2019 0:52    Post subject: Reply with quote
Wildlion wrote:
Okay, So it is on the ISP end. To get the those to change it depends on what areas the ISP has mapped and what others have open (assuming DHCP). Your ISP is only allocated certain blocks of IP address. with the IP Subnet Mask being 255.255.255.0 that means only the last number will change the majority of the time. Let's assume that each is 254 addresses, you have in the 5 options 5*254 or 1270 options. Depending on how big your ISP is that might be it, but it could also be because those are the only address that they have delegated for your area.

I can not find it right now, but many dhcp servers have changed to a calculation of your ip address based on your MAC address (and other factors) since the MAC address is the only thing you can control, but those other things make a difference such as what others are using

But is there a way I can use a site that seems to have, for all I know, banned enough octets or whatever that when I clone the MAC, it never gives me an IP that isn't already blocked? VPNs and proxies also appear to not work on the site. I was hoping a dd-wrt router would be the answer to everything, but it only seemed to do it for me up to the first banning. My plan was to change the IP anytime I need to by changing the MAC, but I'm very wary that the site may have already banned every IP that begins with the only 2 sets of first 2 octets that I've gotten so far. It sounds unbelievable, though, because that should represent thousands of people who now also cannot retain an account on the site. As always, I'll try to continue to figure out what other variables may be at play that allow the site to detect that it's "me".
Wildlion
DD-WRT Guru


Joined: 24 May 2016
Posts: 1408

PostPosted: Thu Jun 13, 2019 1:08    Post subject: Reply with quote
I found an example in dnsmasq version 2.80 file dhcp.c, function address_allocate getting to line 745 (and the comment, being stolen in this context since I do not want to post code and break it down) "/* pick a seed based on hwaddr */", So dnsmasq is using the MAC only as a seed as well as a few iterators and parameters. Other dhcp servers do very similar things

BUT I think that I have digressed (sorry)

I agree, it seems unlikely but at the same time possible, not sure what site you are referring to. I have set up systems that ban whole countries based on traffic, but that was what the customer wanted.

There are also other ways, such as cookies, browser finger prints, ... and so on. For all you know someone else on your isp is trying to do the exact same thing you are.
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12837
Location: Netherlands

PostPosted: Thu Jun 13, 2019 8:46    Post subject: Reply with quote
@Wildlion is abolutely right, sites use a host of other information to restrict access.

To get to the BBC you have to make sure you do not have a DNS leak and use in private browsing (starts a clean browser without any cookies or other information) and disable web RTC

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
Spoofy
DD-WRT Novice


Joined: 03 Jun 2019
Posts: 7

PostPosted: Thu Jun 13, 2019 16:49    Post subject: Reply with quote
egc wrote:
@Wildlion is abolutely right, sites use a host of other information to restrict access.

To get to the BBC you have to make sure you do not have a DNS leak and use in private browsing (starts a clean browser without any cookies or other information) and disable web RTC

I just use Firefox set to delete all cookies, cache, active logins, etc, every time I close it. Is that good enough?
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum