Use your router as an advertizing gateway

Post new topic   Reply to topic    DD-WRT Forum Index -> Contributions Upload
Author Message
gaganwalia
DD-WRT User


Joined: 24 Dec 2007
Posts: 449

PostPosted: Thu Feb 10, 2011 19:45    Post subject: Use your router as an advertizing gateway Reply with quote
first move your web management to another port (81 in my example)

YOU NEED TO ENABLE JFFS ON YOUR ROUTER

startup script:
Code:

killall httpd
httpd -p 81 -h /www
httpd -p 80 -h /jffs/www


then

firwall script:
Code:

iptables -A INPUT -p tcp -d $(nvram get lan_ipaddr) --dport 80 -j ACCEPT
iptables -t nat -A PREROUTING -p tcp -d $(nvram get wan_ipaddr) --dport 80 -j DNAT --to $(nvram get lan_ipaddr):80
iptables -A INPUT -p tcp -d $(nvram get lan_ipaddr) --dport 81 -j ACCEPT
iptables -t nat -A PREROUTING -p tcp -d $(nvram get wan_ipaddr) --dport 81 -j DNAT --to $(nvram get lan_ipaddr):81


everyone can still access internet on your router. so stop them from doing so.

add to your startup script:
Code:

iptables -t nat -A PREROUTING -p tcp --dport 80 -d yorsite.com -j ACCEPT
iptables -t nat -A PREROUTING -p tcp --dport 1:65535 -j DNAT --to $(nvram get lan_ipaddr):80


This will route all users to your site where you have your ads.

to allow specific ussers to access the internet, use the following code between the above 2 codes
Code:

iptables -t nat -A PREROUTING -m mac --mac-source xx:xx:xx:xx:07:D2 -j ACCEPT
iptables -t nat -A PREROUTING -m mac --mac-source xx:xx:xx:xx:08:D2 -j ACCEPT
iptables -t nat -A PREROUTING -m mac --mac-source xx:xx:xx:xx:09:D2 -j ACCEPT


This will allow the above three MACs to access the internet and all others will be sent to your webpage to see the ads.
Sponsor
yousaf465
DD-WRT User


Joined: 12 Sep 2010
Posts: 380

PostPosted: Fri Feb 11, 2011 6:10    Post subject: Reply with quote
A splash page Smile
_________________
Upgraded to
DD-WRT v24-sp2 (03/25/13) std -
build 21061

DD-WRT v24-sp2 (10/12/12) std
(SVN revision 20119)

TP-link 741ND
DD-WRT v24-sp2 (11/21/10) std
(SVN revision 15778)

Finding the correct MTU value for your ISP | BrainSlayer Vlan on Atheros
|

debrick Buffalo WZR-HP-G300NH
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Contributions Upload 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 cannot attach files in this forum
You cannot download files in this forum