HOME
DOWNLOADS
SHOP
ACTIVATION CENTER
Professional
Support
Community
Contact
Imprint
Privacy Policy
Forum
Wiki
Donations
Bugtracker
Imprint
Privacy Policy
DD-WRT
Community
Contact
Donations
Forum
Wiki
Bugtracker
Imprint
Privacy Policy
Quick Links
Log in
Profile
View unanswered posts
Log in
Username:
Password:
Log me on automatically each visit
Use your router as an advertizing gateway
DD-WRT Forum Index
->
Contributions Upload
View previous topic
::
View next topic
Author
Message
gaganwalia
DD-WRT User
Joined: 24 Dec 2007
Posts: 449
Posted: Thu Feb 10, 2011 19:45
Post subject: Use your router as an advertizing gateway
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.
Back to top
Sponsor
yousaf465
DD-WRT User
Joined: 12 Sep 2010
Posts: 380
Posted: Fri Feb 11, 2011 6:10
Post subject:
A splash page
_________________
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
Back to top
Display posts from previous:
All Posts
1 Day
7 Days
2 Weeks
1 Month
3 Months
6 Months
1 Year
Oldest First
Newest First
Page
1
of
1
DD-WRT Forum Index
->
Contributions Upload
All times are GMT
Navigation
Jump to:
Select a forum
Forum Rules and Guidelines
----------------
Forum Rules and Guidelines English
Forum Regeln and Anleitungen Deutsch
Правила форума и рекомендации: Russian
DD-WRT (English)
----------------
Announcements
Atheros WiSOC based Hardware
Broadcom SoC based Hardware
General Questions
ARM or PPC based Hardware
Marvell MVEBU based Hardware (WRT1900AC etc.)
Senao Devices
Ubiquiti Devices
Ralink SoC based Hardware
X86 based Hardware
Broadcom Customer Downloads & Updates
Advanced Networking
Search & Find, Sales & Offers
Hardware DIY / Hardware Mods
DD-WRT (Deutsch)
----------------
Ankündigungen
Atheros WiSOC basierende Hardware
Broadcom SoC basierende Hardware
Allgemeine Fragen
ARM oder PPC basierte Hardware
X86 basierende Hardware
Ralink SoC basierte Hardware
DD-WRT (Español)
----------------
Anuncios
Hardware basado en Atheros
Hardware basado en Broadcom
DD-WRT (Communauté francophone)
----------------
Annonces Officielles
Questions générales
Matériels à base de Broadcom
Matériels à base de Atheros
Matériels à base de Ralink
Le Bistrot
DD-WRT (Russian)
----------------
Объявления
Использование и установка DD-WRT
Оборудование на основе Atheros WiSOC
Оборудование на основе Broadcom
Оборудование на основе X86 / WRAP / Soekris
Личные покупки и продажи
Устройства Ubiquiti
Оборудование на основе Ralink
DD-WRT по-русски
Development
----------------
Generic Questions
Contributions Upload
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
Quick Links
Log in
Profile
View unanswered posts
Log in
Username:
Password:
Log me on automatically each visit