Port forwarding with NAT and iptables (transparent proxying) - “Run” your webapp on port 80

  Рет қаралды 23,400

Hussein Nasser

Hussein Nasser

Күн бұрын

Пікірлер: 43
@hnasr
@hnasr 3 жыл бұрын
If you want to learn more about the power of iptables checkout this video here iptables Demystified - Port Redirection and Forwarding HTTP Traffic to another machine (part 1) kzbin.info/www/bejne/hHLHe6KgraqBe7c
@davidjdailey
@davidjdailey 4 жыл бұрын
Thank you. After searching about 15 written tutorials, I found your video. The written tutorials don't seem to address something simple like this. I wanted to use non-standard ports that are exposed to the public, and then forward to default ports in my server.
@hnasr
@hnasr 4 жыл бұрын
Glad it worked Dave!
@debasismandal1924
@debasismandal1924 4 жыл бұрын
This channel is like a hidden gem! I'm glad I found this.
@DrSTAHP
@DrSTAHP 3 жыл бұрын
Very nice explanation! It was actually easier than I expected it to be.
@nicozica
@nicozica 4 жыл бұрын
Thanks for the magical forwarding command!! I've been reading a lot to launch my home server behind a CG-NAT connection. I finally made it with that command! Using a Lightsail instance with OpenVPN and a virtual machine I can now run my home serving for testing my web apps.
@hnasr
@hnasr 4 жыл бұрын
nicozica so awesome! Thanks for sharing glad it works
@nerdion1911
@nerdion1911 3 жыл бұрын
You are a saviour! No one explained me this shit on the fucking internet, people running on sudo n shit Thanks man 😅 You saved my brain
@jedi_v
@jedi_v 3 жыл бұрын
Thank you Hussein, really nice way of explaining you've got. Keep going !
@blazed-space
@blazed-space Жыл бұрын
Dude, these videos are amazing! Thank you 🙏 for this great content!
@nafasm
@nafasm 4 жыл бұрын
Thank you for your tutorial Hussein
@risardirisardi4556
@risardirisardi4556 4 жыл бұрын
Amazing Hussein!, thank your for the tutorial
@hnasr
@hnasr 4 жыл бұрын
Your welcome Risardi!! Glad you enjoyed this video :) cheers
@Aemilindore
@Aemilindore 4 жыл бұрын
With this simply we can get a cheap digital ocean instance and fwd the Nextcloud traffic via WireGuard to our powerful home server. It’s amazing.
@AnasHmamouch
@AnasHmamouch 3 жыл бұрын
this channel is a gem thank you so much!
@TheDEMMX
@TheDEMMX 2 жыл бұрын
Hussein, why do we need to do this in the first place? Why not let users access our app on port 8080? Why 80?
@jordybayo9374
@jordybayo9374 2 жыл бұрын
if you don't know the ip addr of the machine, just do this > sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 8080 # 8080 -> 8080
@rne1223
@rne1223 2 жыл бұрын
That worked...thanks.
@KrizyzZ00
@KrizyzZ00 4 жыл бұрын
Thank you for your awesome content i enjoy each video of yours love your accent and the way you explain things love from israel
@hnasr
@hnasr 4 жыл бұрын
Thanks for your comment! Your the first who likes my accent haha cheers and have a great weekend
@keshavbadhekar
@keshavbadhekar 3 жыл бұрын
Hi Hussein.. I have follow all this steps you have mentioned in the video on my EC2 instance on AWS... I already ensured that port forwarding is enabled.....but still request is not forwarding to port 8080 from 80....please help
@Timska
@Timska 5 жыл бұрын
Good videos! informative and easy to follow
@hnasr
@hnasr 5 жыл бұрын
timska thank you 🙏
@synchronizingsynchronize3066
@synchronizingsynchronize3066 3 жыл бұрын
well explained thank you !
@rezzpa
@rezzpa 5 жыл бұрын
works like a charm, thanks man
@hnasr
@hnasr 5 жыл бұрын
Glad I could help!! Thanks for commenting
@ViperrKsa
@ViperrKsa 4 жыл бұрын
if my university blocks range of ports does this actually help? I am not a software engineer but I am trying to setup my pivpn the best way for me.
@ahangk
@ahangk 3 жыл бұрын
can we use this method to redirect port 443 to another port? I tried but it didn't work.
@arunteltia7888
@arunteltia7888 4 жыл бұрын
sir i dont get the need of this why are we doing this cant we just use reverse proxy that will redirect us to port 80 and if you see my question can you tell me are we exposing our 8080 port to 80 port I am getting confuse It will mean a lot if you tell me the doubt New to networking kid
@hnasr
@hnasr 4 жыл бұрын
You don't have to use it, its just in cases where it is not possible to listen on port 80 for security reason (any thing less than 1024 must run with high permissions) .. so you use iptables instaed
@arunteltia7888
@arunteltia7888 4 жыл бұрын
@@hnasr sir i was not expecting your answer that fast Thank you very much Any thing you will suggest me other that your network engineeriing video for network Thank uou once again Heheheh i am being selfish🤗🤩
@ahmedboutaraa8771
@ahmedboutaraa8771 3 жыл бұрын
@@arunteltia7888 sorry if this will not help you but this is the best place to learn about all the nitty-gritty of backend engineering,
@arunteltia7888
@arunteltia7888 3 жыл бұрын
@@ahmedboutaraa8771 yes I completely agree with you I learned so much from this channel in 3 months I am glad I found this channel
@Yours--Truly
@Yours--Truly 4 жыл бұрын
With this iptables setup, your server would be online too?
@MrZerged
@MrZerged 4 жыл бұрын
Hey, sorry maybe I misunderstood, but this example only works if you can send your request directly to the machine. How is it configured if the router is port forwarding back? Or rather how does it work on 80 from a public side request?
@hnasr
@hnasr 4 жыл бұрын
Hey! if you want to port forwards the router to an internal host than you can simply provide do that like here kzbin.info/www/bejne/b2PFXp2gd7qFodk
@lopo8000
@lopo8000 3 жыл бұрын
can u help me i'm building my own infrastructure pointing to my own home server, does anyone know how to open ports to the internet on a 02 router?, i only get http port 80 from my server when i open port to the internet but no connection through https por 443 ? , i need to open my ubuntu server from proxmox to the internet and https need to work but i run into problems
@ArjayShortClip
@ArjayShortClip 4 жыл бұрын
Hi Thanks for this awesome tutorial I was wondering if you can help me how to display my raspberry pi iptables in my nodejs api? thanks in advance
@hnasr
@hnasr 4 жыл бұрын
Sure! The idea is to execute a command on linux from nodejs and get the output and iptables is just a command. Check the answer here hope that helps. Careful im not sure if iptables required root, if it does than nodejs will need to be root as well which is not a good idea stackoverflow.com/questions/12941083/execute-and-get-the-output-of-a-shell-command-in-node-js
@vikasc325
@vikasc325 4 жыл бұрын
With this command can I run app on 443 port
@hnasr
@hnasr 4 жыл бұрын
Yes you can and redirect it to anyport you want
Network Address Translation - NAT Explained
21:28
Hussein Nasser
Рет қаралды 62 М.
Миллионер | 1 - серия
34:31
Million Show
Рет қаралды 2,3 МЛН
Good teacher wows kids with practical examples #shorts
00:32
I migliori trucchetti di Fabiosa
Рет қаралды 8 МЛН
nginx configuration in ubuntu with port forwarding
11:30
aditya saha
Рет қаралды 9 М.
VPN vs Proxy Explained Pros and Cons
36:18
Hussein Nasser
Рет қаралды 29 М.
Is this the BEST Reverse Proxy for Docker? // Traefik Tutorial
21:57
Christian Lempa
Рет қаралды 521 М.
IPTables: NAT и Port forwarding
24:25
Поддержка Сайтов :: Метод Лаб
Рет қаралды 22 М.
Address Resolution Protocol - ARP
14:22
Hussein Nasser
Рет қаралды 10 М.
Launching your own ScrollHub Server in 60 seconds
9:20
ScrollTalk
Рет қаралды 12
NAT - SNAT, DNAT, PAT & Port Forwarding
9:50
Sunny Classroom
Рет қаралды 355 М.