1) For starters, I moved OpenWRT's web interface to another port. It originally sits on port 80, so it catches all of the requests to port 80. You may also find it convenient to move OpenWRT's SSH access to a port other than 22, so that you can enable SSH access to a server on the network. You can change these settings through the admin web interface.
The rest of this builds on the following blog post, which I found after a few hours of Googling. The post has a couple of typos and outdated URLs in the provided code, and I'll try to fix those here. Also, the original poster no longer uses OpenWRT, so if there's any tweaking or testing, I'm able to try things out.
2) You want to configure your server to have a static IP, which you can do through OpenWRT's web interface. For example, you can have your server at 192.168.1.100, so that your redirect can send requests directly to the server. For the rest of this HOWTO, I'll assume that your router is at 192.168.1.1 and your server at 192.168.1.100.
3) Next, you want to configure your firewall to allow port 80 and 22 requests and redirect them to your server IP. You can find OpenWRT's firewall configuration at /etc/config/firewall (through SSH access). Open the file with your favorite text editor, and add the following lines in order to open the ports (via a "rule") and redirect the traffic (via a "redirect"):
config 'redirect' 'http'
option 'src' 'wan'
option 'proto' 'tcp'
option 'src_ip' ''
option 'src_dport' '80'
option 'dest_ip' '192.168.1.100' # your server IP
option 'dest_port' '80'
config 'rule'
option 'src' 'wan'
option 'proto' 'tcp'
option 'src_ip' ''
option 'dest_ip' ''
option 'dest_port' '80'
option 'target' 'ACCEPT'
config 'redirect' 'ssh'
option 'src' 'wan'
option 'proto' 'tcp'
option 'src_ip' ''
option 'src_dport' '22'
option 'dest_ip' '192.168.1.100' # your server IP
option 'dest_port' '22'
config 'rule'
option 'src' 'wan'
option 'proto' 'tcp'
option 'src_ip' ''
option 'dest_ip' ''
option 'dest_port' '22'
option 'target' 'ACCEPT'
Somewhat surprisingly, this doesn't fix our problem. I'm not entirely clear on the reason, but basically, we need the equivalent of lan-to-lan port forwarding (according to the original blog post) and this isn't natively provided by OpenWRT. We need to redirect the on-lan traffic explicitly, and to do that, we can use xinetd, a secure web server.
4) Install xinetd on your router using opkg, which should be installed on the router:
opkg install http://ipkg.nslu2-linux.org/feeds/optware/openwrt-brcm24/cross/unstable/xinetd_2.3.14-9_mipsel.ipk
5) xinetd depends on a couple of configuration files. One file common to many *nix systems (but not OpenWRT) is /etc/services. Create an /etc/services file, and add listings for http and ssh services as follows:
http 80/tcp http # HTTP service
ssh 22/tcp ssh # SSH service
6) There should be a folder created by the xinetd install at /opt/etc/xinetd.d. We want to add a couple of files here to configure the internal forwarding for our services. I chose to add separate files, http-forward and ssh-forward, but any files in this directory are loaded when xinetd is started, so you can name them whatever you want.
http-forward:
service http
{
flags = REUSE
socket_type = stream
wait = no
user = root
redirect = 192.168.1.100 80
log_on_failure += USERID
}
ssh-forward:
service ssh
{
flags = REUSE
socket_type = stream
wait = no
user = root
redirect = 192.168.1.100 22
log_on_failure += USERID
}
7) Create a startup script for xinetd by creating a file /etc/init.d/xinetd and placing the following:
#!/bin/sh /etc/rc.common
# Copyright (C) 2006 OpenWrt.org
START=39
start() {
[ -x /opt/sbin/xinetd ] && {
/opt/sbin/xinetd
}
}
(*Update on 3/2, thanks to comment from Dubravko) You can change the permissions of this file to 755 with:
chmod 755 /etc/init.d/xinetdThen you can use this script to enable the newly defined service with:
/etc/init.d/xinetd enableand to start the service with:
/etc/init.d/xinetd start8) I usually reboot the router at this point, to ensure that the firewall rules and xinetd configuration files are all freshly loaded. After reboot, you'll want to start xinetd (currently, I do this manually, although I know it's possible to have the service started every time the router reboots - I just haven't taken the time to do that). You should now be able to access your web server correctly.
Debugging tools: The following tools can be helpful in debugging your setup:
- DynDNS's Open Port tool
- The logread command in the OpenWRT SSH - shows when xinetd starts, how many services started, and when each request is received/processed, etc.
If anyone wants to update on how to setup xinetd or a similar service to automatically start on router reboot, OR the precise need for "internal LAN redirect" please let me know so I can update the post. I've also hacked out a little script for automating some of this, and I'll post that once I clean it up.
Isn't doing all this and spending hours on google trying to figure something out fun! People ask me all the time how I can dedicate so much time doing stuff like this and it's because it's a challenge. Once I get something in my head that I want to try something, It's hard for me to give up.
ReplyDeleteKeep up the good work!
Add chmod 755 for /etc/init.d/xinetd
ReplyDeleteGood work
hmm, I'm a noob regarding iptables, but the following in firewall.users is working, too; without the need to install xinetd:
ReplyDeleteMYSERVER="your.ip"
iptables -F forwarding_wan
iptables -t nat -F prerouting_wan
iptables -t nat -A prerouting_wan -p tcp --dport 80 -j DNAT --to $MYSERVER:80
iptables -A forwarding_wan -p tcp --dport 80 -d $MYSERVER -j ACCEPT
I have read your blog its very attractive and impressive. I like it your blog.
ReplyDeleteJava Training in Chennai Core Java Training in Chennai Core Java Training in Chennai
Java Online Training Java Online Training JavaEE Training in Chennai Java EE Training in Chennai
Great Article
DeleteCloud Computing Projects
Networking Projects
Final Year Projects for CSE
JavaScript Training in Chennai
JavaScript Training in Chennai
The Angular Training covers a wide range of topics including Components, Angular Directives, Angular Services, Pipes, security fundamentals, Routing, and Angular programmability. The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer. Angular Training
A package forwarding service should be very fast and very reliable and the customer care should always be outstanding.Таможенное оформление в россии и беларуси
ReplyDeleteExcellant post!!!. The strategy you have posted on this technology helped me to get into the next level and had lot of information in it.
ReplyDeleteBest Devops online Training
Online DevOps Certification Course - Gangboard
Some us know all relating to the compelling medium you present powerful steps on this blog and therefore strongly encourage contribution from other ones on this subject while our own child is truly discovering a great deal. Have fun with the remaining portion of the year.
ReplyDeleteSelenium training in Chennai
Selenium training in Bangalore
Selenium training in Pune
Selenium Online training
This is such a great post, and was thinking much the same myself. Another great update.
ReplyDeletepython Training in Pune
python Training in Chennai
python Training in Bangalore
Thanks for the informative article. This is one of the best resources I have found in quite some time. Nicely written and great info. I really cannot thank you enough for sharing.
ReplyDeletemicrosoft azure training in bangalore
rpa training in bangalore
best rpa training in bangalore
rpa online training
Attend The Python training in bangalore From ExcelR. Practical Python training in bangalore Sessions With Assured Placement Support From Experienced Faculty. ExcelR Offers The Python training in bangalore.
ReplyDeletepython training in bangalore
ReplyDeleteI have express a few of the articles on your website now, and I really like your style of Python classes in pune blogging. I added it to my favorite’s blog site list and will be checking back soon…
The article is so informative. This is more helpful for our
ReplyDeletesoftware testing training in chennai
selenium training in chennai
software testing training online
Thanks for sharing.
This blog is more informative and innovative with me.
ReplyDeleteweb designing course in chennai with placement
php training institute with placement
magento training in chennai
thanks for your information really good and very nice web design company in velachery
ReplyDeleteAwesome Blog, It is very informative and unique. This page really helps me, I really appreciate. Thanks for sharing this information.Keep blogging!!
ReplyDeletemachine learning course
Thanks for this Blog in your Blog i read all aspects of digital marketing. i want to share your article because it is very helpful and the benefits of newcomers.
ReplyDeleteVisit Us- I Digital Academy
Attend The Data Analytics Course Bangalore From ExcelR. Practical Data Analytics Course Bangalore Sessions With Assured Placement Support From Experienced Faculty. ExcelR Offers The Data Analytics Course Bangalore.
ReplyDeleteExcelR Data Analytics Course Bangalore
Wow it is really wonderful and awesome thus it is veWow, it is really wonderful and awesome thus it is very much useful for me to understand many concepts and helped me a lot.
ReplyDeletepython training in bangalore
python courses in bangalore
python classes in bangalore
python training institute in bangalore
python course syllabus
best python training
python training centers
This is the exact information I am been searching for, Thanks for sharing the required infos with the clear update and required points. To appreciate this I like to share some useful information.
ReplyDeleteaws training in bangalore
aws courses in bangalore
aws classes in bangalore
aws training institute in bangalore
aws course syllabus
best aws training
aws training centers
It is very good and useful for students and developer.Learned a lot of new things from your post Good creation,thanks for give a good information at sap crm.
ReplyDeletedevops training in bangalore
devops courses in bangalore
devops classes in bangalore
devops training institute in bangalore
devops course syllabus
best devops training
best devops training
I have to voice my passion for your kindness giving support to those people that should have guidance on this important matter.
ReplyDeletesap s4 hana training in bangalore
sap s4 hana courses in bangalore
sap s4 hana classes in bangalore
sap s4 hana training institute in bangalore
sap s4 hana course syllabus
best sap s4 hana training
sap s4 hana training centers
Excellent post for the people who really need information for this technology.
ReplyDeletesap simplefinance training in bangalore
sap simplefinance courses in bangalore
sap simplefinance classes in bangalore
sap simplefinance training institute in bangalore
sap simplefinance course syllabus
best sap simplefinance training
sap simplefinance training centers
Post is very useful. Thank you, this useful information.
ReplyDeleteStart your journey with SAP S4 HANA Simple Logistics Training and get hands-on Experience with 100% Placement assistance from experts Trainers @Softgen Infotech Located in BTM Layout Bangalore.
Anyone looking to upgrade in career with in demand training skills can reach out to us for best career mapping solutions and training recommendations.This course enables beginners to grasp the basics of Mathematics, Artificial Intelligence, Machine Learning, and Deep Learning. The use of Python libraries like Keras, Tensor Flow, and OpenCV to solve AI and Deep learning problems are explained. Students are instructed on how to implement Deep Learning solutions and image processing applications using Convolution Neural Networks. Training is imparted on performing Text Analytics and Natural Language Processing (NLP) using Recurrent Neural Networks. They also learn how GPUs and TPUs are applied in Deep Learning algorithms. ai training in hyderabad 360DigiTMG
ReplyDeleteVery well written blog and I always love to read blogs like these because they offer very good information to readers with very less amount of words....thanks for sharing your info with us and keep devops training in chennai | devops training in anna nagar | devops training in omr | devops training in porur | devops training in tambaram | devops training in velachery
ReplyDeleteI keep on reading your blog post.. This was still amazing. Thanks a lot for sharing this unique informative post with us.. I really enjoyed by reading your blog post keep it up
ReplyDeleteAi & Artificial Intelligence Course in Chennai
PHP Training in Chennai
Ethical Hacking Course in Chennai Blue Prism Training in Chennai
UiPath Training in Chennai
This is my first time visit here. From the tons of comments ExcelR Machine Learning Courses on your articles.I guess I am not only one having all the enjoyment right here!
ReplyDeleteThanks for sharing this information. I really Like Very Much.
ReplyDeletetop devops online training
Totally awesome posting! Loads of valuable data and motivation, both of which we all need!Relay welcome your work. we provide Logistics Companies in miami at affordable prices. for more info visit our website.
ReplyDeleteThanks for sharing this information. I really Like Very Much.
ReplyDeletebest devops online training
This is my first time visit here. From the tons of comments ExcelR Machine Learning Courses on your articles.I guess I am not only one having all the enjoyment right here!
ReplyDeleteAttend The Data Analytics Courses From ExcelR. Practical Data Analytics Courses Sessions With Assured Placement Support From Experienced Faculty. ExcelR Offers The Data Analytics Courses.
ReplyDeleteData Analytics Courses
I must say you are very much concise and experienced at persuasive writing. I just loved your flair of writing.
ReplyDeleteData Science training in Mumbai
Data Science course in Mumbai
SAP training in Mumbai
The information given in this article is very good and I like it. I have also written this kind of blog you can also read for more knowledge.
ReplyDeletehow to improve google
search results
how to improve seo ranking on google
artificial intelligence latest developments
Very well written blog and I always love to read blogs like these because they offer very good information to readers with very less amount of words....thanks for sharing your info with us
ReplyDelete[url=https://nearlearn.com/machine-learning-classroom-training-in-bangalore-india/]Machine Learning Training in Bangalore[/url]
Machine Learning Training in Bangalore
ReplyDeletethanks for your information really good and very nice The Best Result Driven Digital Marketing Agency in Chennai
ReplyDeleteInteresting article, waiting for new contents.
ReplyDeletenodejs interview questions
pega interview questions
seo interview questions
android interview questions
ms excel interview questions
hacking books
interview questions on tableau
cyber security interview questions
Great Blog!!! Thanks for sharing this wonderful data with us.
ReplyDeleteSelenium Training in Chennai
Selenium Training in Bangalore
Selenium Online Training
Selenium Training in Coimbatore
Selenium Training in Pune
Great Blog!!! Thanks for sharing this wonderful blog with us.
ReplyDeleteData Science Course in Chennai
Data Science Course in Bangalore
Data Science Online Course
Data Science Course in Coimbatore
Data Science Course in Hyderabad
Data Science Course in Pune
Very excellent post!!! Thank you so much for your great content. Keep posting.....
ReplyDeleteBest AWS Training Institute in Pune
It is imperative that we read blog post very carefully. I am already done it and find that this post is really amazing. ExcelR Business Analytics Courses
ReplyDeleteTruly mind blowing blog went amazed with the subject they have developed the content. These kind of posts really helpful to gain the knowledge of unknown things which surely triggers to motivate and learn the new innovative contents. Hope you deliver the similar successive contents forthcoming as well.
ReplyDeletedata science in bangalore
Aivivu đại lý vé máy bay, tham khảo
ReplyDeletevé máy bay đi Mỹ hạng thương gia
vé máy bay nha trang hồ chí minh
các chuyến bay cần thơ đi hà nội
chuyến bay hà nội nha trang
ve may bay gia re di Hue
xe đưa rước sân bay
combo đà nẵng 4 ngày 3 đêm
I am always searching online for articles that can help me. There is obviously a lot to know about this. I think you made some good points in Features also. Keep working, great job !
ReplyDeleteAmazon Web Services Training in Chennai
rastgele görüntülü konuşma - kredi hesaplama - instagram video indir - instagram takipçi satın al - instagram takipçi satın al - tiktok takipçi satın al - instagram takipçi satın al - instagram beğeni satın al - instagram takipçi satın al - instagram takipçi satın al - instagram takipçi satın al - instagram takipçi satın al - binance güvenilir mi - binance güvenilir mi - binance güvenilir mi - binance güvenilir mi - instagram beğeni satın al - instagram beğeni satın al - polen filtresi - google haritalara yer ekleme - btcturk güvenilir mi - binance hesap açma - kuşadası kiralık villa - tiktok izlenme satın al - instagram takipçi satın al - sms onay - paribu sahibi - binance sahibi - btcturk sahibi - paribu ne zaman kuruldu - binance ne zaman kuruldu - btcturk ne zaman kuruldu - youtube izlenme satın al - torrent oyun - google haritalara yer ekleme - altyapısız internet - bedava internet - no deposit bonus forex - erkek spor ayakkabı - webturkey.net - karfiltre.com - tiktok jeton hilesi - tiktok beğeni satın al - microsoft word indir - misli indir
ReplyDeletethis article is useful to read.keep up the good work.Angular training in Chennai
ReplyDeleteaşk kitapları
ReplyDeleteyoutube abone satın al
cami avizesi
cami avizeleri
avize cami
no deposit bonus forex 2021
takipçi satın al
takipçi satın al
takipçi satın al
takipcialdim.com/tiktok-takipci-satin-al/
instagram beğeni satın al
instagram beğeni satın al
btcturk
tiktok izlenme satın al
sms onay
youtube izlenme satın al
no deposit bonus forex 2021
tiktok jeton hilesi
tiktok beğeni satın al
binance
takipçi satın al
uc satın al
sms onay
sms onay
tiktok takipçi satın al
tiktok beğeni satın al
twitter takipçi satın al
trend topic satın al
youtube abone satın al
instagram beğeni satın al
tiktok beğeni satın al
twitter takipçi satın al
trend topic satın al
youtube abone satın al
takipcialdim.com/instagram-begeni-satin-al/
perde modelleri
instagram takipçi satın al
instagram takipçi satın al
takipçi satın al
instagram takipçi satın al
betboo
marsbahis
sultanbet
www.escortsmate.com
ReplyDeleteescortsmate.com
https://www.escortsmate.com
cover coin hangi borsada
ReplyDeletecover coin hangi borsada
cover coin hangi borsada
xec coin hangi borsada
xec coin hangi borsada
xec coin hangi borsada
ray hangi borsada
tiktok jeton hilesi
tiktok jeton hilesi
With Aximtrade Review You Can Also Use Technical Analysis Tools Such As The Candle Chart, Price-time Charts And More. As Well As Offering 24/5 Trading On Mt4 To All Its Clients, With Xtb You Can Benefit From Additional Features And Enhanced Functionality.
ReplyDeleteVisit Aximtrade Reviews Login To View Your Personal Area Where You Can Manage Your Trading Accounts, Set Up Your Watchlist, And Track Your Recent Trades.
ReplyDeleteInformative blog
ReplyDeletecloud computing courses in ahmedabad
Great post. keep sharing such a worthy information.
ReplyDeleteCloud Computing Courses in Chennai
Cloud Computing Courses
tiktok jeton hilesi
ReplyDeletetiktok jeton hilesi
binance referans kimliği
gate güvenilir mi
tiktok jeton hilesi
paribu
btcturk
bitcoin nasıl alınır
yurtdışı kargo
Great post. keep sharing such a worthy information.
ReplyDeleteGraphic Design courses in Chennai
Online Graphic Design Course
Graphic Design Courses In Bangalore
seo fiyatları
ReplyDeletesaç ekimi
dedektör
instagram takipçi satın al
ankara evden eve nakliyat
fantezi iç giyim
sosyal medya yönetimi
mobil ödeme bozdurma
kripto para nasıl alınır
instagram beğeni satın al
ReplyDeleteyurtdışı kargo
seo fiyatları
saç ekimi
dedektör
fantazi iç giyim
sosyal medya yönetimi
farmasi üyelik
mobil ödeme bozdurma
MMORPG OYUNLAR
ReplyDeleteinstagram takipçi satın al
TİKTOK JETON HİLESİ
tiktok jeton hilesi
antalya saç ekimi
referans kimliği nedir
instagram takipçi satın al
metin2 pvp serverler
instagram takipçi satın al
PERDE MODELLERİ
ReplyDeletesms onay
mobil ödeme bozdurma
Nft nasıl alınır
Ankara evden eve nakliyat
trafik sigortası
Dedektor
kurma website
aşk kitapları
uc satın al
ReplyDeletenft nasıl alınır
özel ambulans
en son çıkan perde modelleri
en son çıkan perde modelleri
yurtdışı kargo
lisans satın al
minecraft premium
bostansepeti.com
ReplyDeletesite kurma
ürünler
vezirsosyalmedya.com
postegro
sosyal medya yönetimi
surucukursuburada.com