Recommended Posts

anyone have any idea how to schedule all traffic (mainly port 80) to redirect ?

ie: rather than simply use a schedule to cut off access, i'd like to route to a page during set times that gives a description of why the connection isn't working.

almost like a 'walledgarden' state, but on a schedule

i'm running DD-WRT mega, btw

Link to comment
https://www.neowin.net/forum/topic/848900-scheduled-re-routing-via-router/
Share on other sites

From what I understood, you want traffic (presumably outside, internet traffic) redirected to another server (or port on the same server) at specific times?

One way this could be accomplished is through Destination NAT and iptables. Since you're using DD-WRT, you basically have a Linux box capable of doing these things for you ;).

telnet into your router and issue a command similar to the following:

iptables -t nat -A PREROUTING -d 192.168.1.1 -p tcp --dport 80 -m time --timestart 00:00 --timestop 08:00 --days Mon,Tue,Wed,Thu,Fri -j DNAT --to-destination 192.168.1.2:8080

This iptables rule will catch packets coming into the network (from the internet for example) and "re-route" the packet accordingly.

"-d 192.168.1.1" would be the destination address of your web server.

"--dport 80" is the port the web server is listening on (port 80)

"-m time" sets up a rule to look at time and date - configure "--timestart", "--timestop" and "--days" to your needs

"-j DNAT" tells the router what to do when a match is found (in this case, preform a Destination NAT)

and finally,

"--to-destination 192.168.1.2:8080" is the re-directed location and port you want the traffic to go to instead.

Now, the above is a very crude example of how you could do this with iptables. I'm pretty sure there are others here that have a far superior understanding and can chime in with something more elegant.

Also, given the nature of routing and switching, the above iptable rule may not work for computers if they are on the same LAN segment as the webserver (since computers on the LAN will be switched instead of routed).

Also, visit DD-WRT - Iptables for a brief guide on further use of iptables. Learn the basic commands and toy around with it until it works to your liking.

Good luck!

Edited by TGT

Thanks TGT!

I'm sure that would work, but i'm unsure of if i want to set up a dedicated server. i know i could run one off of dd-wrt to display a single page, but the other problem is this also needs to be done at another location on a router that doesn't support DD-WRT

I'm trying to help my cousin cut off WAN access daily. right now he's got a schedule in his router that just stops it altogether. we were thinking it would be nice to have a 404-like page come up when you try to attempt to access WAN during this time frame. he runs a wifi hotspot and people all the time complain that 'it's not working' because they are unaware there is a time frame involved.

it's too small of a hotspot to use sputnik or wifidog.... although, it might end up going that way before too long. i like to keep it simple for now, at least

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • Dead by Daylight, Two Point Museum, and more join Xbox Free Play Days for the weekend by Pulasthi Ariyasinghe There is a brand-new Free Play Days offer available to Xbox players, giving them a chance to try out a new selection of games over the weekend. Microsoft's latest promotion brings some high-profile titles, including the sports title PGA TOUR 2K25 and the racing sim Assetto Corsa. Almost all the games being offered this time require an Xbox Game Pass subscription, with only one title being available for all players. Starting with the fully free-to-play section, Dead by Daylight is populating it solo. This asymmetric survival horror title should be the most familiar to most gamers, considering its age. The multiplayer four-versus-one asymmetric survival horror game has you assuming the roles of survivors or the killer to see who can come out on top. This Dead by Daylight offer will be available to play until Monday, June 22, giving you an extra day of play compared to the remainder of the Free Play Days titles. Meanwhile, Xbox Game Pass Ultimate, Premium, and Essential members can now try out the well-received tycoon game Two Point Museum, the circuit racing sim Assetto Corsa, as well as 2K's golf sim experience that gives players a career to develop alongside real-world pros and courses. Here are the announced games and the platforms they are available to play on: PGA TOUR 2K25 (Xbox Series X|S) Two Point Museum (Xbox Series X|S) Assetto Corsa (Xbox Series X|S, Xbox One) Dead by Daylight (Xbox Series X|S, Xbox One) To easily find the titles on Xbox consoles, first head to the Store, and then in the sidebar, find the Home section. In there, open the Subscriptions tab. All the games from the Free Play Days collection will show up in this section for quick access. Apart from Dead by Daylight's offer, this week's Free Play Days promotions will end on Sunday, June 21, at 11:59 pm PT.
  • Recent Achievements

    • Week One Done
      Huge Trailer earned a badge
      Week One Done
    • Week One Done
      Classifyskilleducation earned a badge
      Week One Done
    • One Month Later
      eurospharma62 earned a badge
      One Month Later
    • Week One Done
      With What earned a badge
      Week One Done
    • Week One Done
      Harris Gilbert earned a badge
      Week One Done
  • Popular Contributors

    1. 1
      +primortal
      587
    2. 2
      +Edouard
      171
    3. 3
      PsYcHoKiLLa
      74
    4. 4
      Michael Scrip
      66
    5. 5
      neufuse
      64
  • Tell a friend

    Love Neowin? Tell a friend!