Jump to content

Change Mac, DHCP Request, Sleep


vinistois
 Share

Recommended Posts

Hi, 

I want my packet squirrel to:

- spoof a MAC that I specify (not a client connected to either port)

- do a DHCP request with that MAC

- Go to sleep for 24 hours and repeat

The reason for this is that my ISP requires DHCP requests every 24 hours for their "static" IPs, otherwise it stops working.  The network I need this IP for must be set for true static IP and will not make any DHCP requests.  So I want to plug the squirrel into another port of the gateway device just to periodically request the IP as a "keep-alive". 

Is this possible with the Packet Squirrel?   Is there something wrong with the wiki at the moment?  (cannot resolve https://wiki.packetsquirrel.com/)

Thanks!

 

 

Link to comment
Share on other sites

That sounds very complicated for something that everyone else in the world has to deal with so I think you're overcomplicating it.

I'm not sure how service works in your part of the world but can you not simply configure the WAN port on your router to grab it's IP via DHCP? If you're using ADSL/VDSL it'll be a little different, but direct it should just be DHCP, the lease times given automagically.

Someone correct me if I'm wrong - it's not my greatest area of knowledge. :S

Link to comment
Share on other sites

3 minutes ago, Dave-ee Jones said:

That sounds very complicated for something that everyone else in the world has to deal with so I think you're overcomplicating it.

I'm not sure how service works in your part of the world but can you not simply configure the WAN port on your router to grab it's IP via DHCP? If you're using ADSL/VDSL it'll be a little different, but direct it should just be DHCP, the lease times given automagically.

Someone correct me if I'm wrong - it's not my greatest area of knowledge. :S

Thanks, I can give further background to justify the use case. 

I'm using two PFsense firewalls in high availability.  This requires 3 Static IPs, they can not be DHCP.  You assign a static IP to each firewall's WAN port and then a Virtual IP which is used for the actual traffic.  The virtual IP can attach itself to either interface according to the high-availability rules.  This means that everything keeps working if one of your firewalls die. 

The ISP I am dealing with provided the 3 static IPs, but with the caveat that if they do not see a DHCP request every 24 hours, they disable the IP reservation, and no traffic gets through.  This ISP is huge, and there is no budging on these rules (I've been trying for months). 

I have a small switch in front of the Firewalls to distribute the WAN link from the gateway device to each firewall.  This is where I want to connect the Squirrel. 

I can setup the static IPs on the three required interfaces and it functions for 24 hours.  After that time, I need each of the MAC addresses to issue a DHCP request.  This functions as a keep-alive and stops the ISP from disabling the links.  I know it will work, because all I need to do is temporarily change one of the interfaces to DHCP, and bam, it comes online again, and I can set it back to static.  

It's a bit insane that they operate this way, but this is the only way.  PFSense is unable to work around it, and the ISP is unwilling to accommodate.  So this is the best solution I could come up with!

Link to comment
Share on other sites

5 hours ago, vinistois said:

-snip-

Definitely an interesting use case. Probably a bit too complicated for me, but you can do something along these lines to change the MAC address:

uci set network.wan.macaddr="<mac_address>"
uci commit network
/etc/init.d/network reload

Just double check the interfaces in "/etc/config/network" and make sure you get the right one.

The PS is basically a OpenWRT box, so small things like that are fairly easy to do.

What you could do after that is just set the interface to static, then every 24 hours set it to DHCP, wait for it, then go back to static? Not sure how you'd want to do it but maybe you could just set it to DHCP and change the lease time/reset time to 24 hours or something. Might be worth syncing with a time server first, just to be sure.

Should be able to set DHCP like so (once again, double check the interface):

uci set network.wan.proto="dhcp"

In regards to requesting DHCP packets every 24 hours you could either do a script with a timed loop, or you could do a scheduled task with cron or something like that. Not sure if PS has cron, though.

Sorry about the "I'm-not-really-sure-about-this-but-here's-what-might-work"-type reply, but this isn't something I've ever done, so I'm not overly sure. Hope it helps anyway! :grin:

Link to comment
Share on other sites

Hey thanks!

I have 3 mac addresses to spoof then DHCP, and I don't think I even need to wait for the dhcp response.  So my script would be:

 

set mac 1

set dhcp

wait

set mac 2

set dhcp

wait

set mac 3

set dhcp

wait

 

And I would just run that loop once every 24 hours.  I'll give it a shot. 

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...