NAT - SNAT, DNAT, PAT & Port Forwarding

Поделиться
HTML-код
  • Опубликовано: 1 фев 2025

Комментарии • 293

  • @IreshDissanayakaM
    @IreshDissanayakaM 5 лет назад +130

    Everything at high level in just 9 minutes yet more than enough clarity and slowness to understand. Everything on point. This is awesome! Thank you Sunny.

  • @as1337x
    @as1337x 4 года назад +14

    I love how Sunny explains the brief history behind technology in his videos, since at times it is a crucial part in the learning process to understand how the technology came to be and why we need it.

  • @vadicheg
    @vadicheg 4 года назад +30

    wow man i watched 2 other videos had few open questions, watched your 9 minute video and everything is clear now. You are talented teacher

    • @na93r
      @na93r 3 года назад

      @Sam Darwin this is a spam

  • @elisdamirchi1447
    @elisdamirchi1447 4 года назад +4

    I never write comments, but here it goes:
    Networking topics will be part of my final exam in two weeks and honestly your videos have been such a life saver.
    I hope you know you're changing lives with your content! Thank you Sir!

  • @lounescharef2441
    @lounescharef2441 4 года назад +5

    Thank you sunny, i have been in the field for over 18 years, no one made the concepts so clear for me, You're the best! I like your chenglish toooooo.

  • @biosah
    @biosah 2 года назад +3

    Simplicity! I love how you slowly and patiently explain complex subjects. Thank you🙏

  • @PT-ww9nc
    @PT-ww9nc 10 месяцев назад

    Thank you Sunny, I have been watching many RUclips videos but they do not explained this in such a logical and simple way.

  • @jamesj9744
    @jamesj9744 7 месяцев назад

    Whenever my Udemy instructors are being jive turkeys, I always look up Sunny's Classroom for a clear explanation. This guy is the best!

  • @londhe99
    @londhe99 6 лет назад +5

    the music at the end is epic ! it gives me recall of life in year 1980s and that time TV shows have this type of music. any way the content is best and crystal clear. good work.

    • @sunnyclassroom24
      @sunnyclassroom24  6 лет назад

      Thanks a lot for your nice comment! I appreciate your encouragement.

  • @LeirbagIII
    @LeirbagIII 5 месяцев назад

    Simple and very well explained. I get back to Sunny anytime I need to review the basics of any topic. Thanks Sunny!

  • @roberth7830
    @roberth7830 3 года назад +1

    Currently learning network services and DNS. So glad to have found your channel. You provide such clear and logical explanations with helpful animations. Thank you for sharing! Subscribed!

  • @AN1MATEK
    @AN1MATEK 4 года назад +1

    Sunny man you always come up when I want to learn something new about networking. Easy, clear but high quality!

  • @zidanetribal2343
    @zidanetribal2343 2 года назад +2

    Awesome, Sunny is my to go resource whenever I need to refresh concepts in networking, security and basically IT! Thanks again Sunny for the topnotch content :)

  • @bxldragonguy
    @bxldragonguy 5 лет назад +7

    Credits to you fir explaining it in such a clear and easy understanding way, thanks!

  • @syednabeelanwar46
    @syednabeelanwar46 3 года назад

    Thank you sunny , i have gone through all your videos they are well explanatory . you are the Teacher of the century

  • @gautamr366
    @gautamr366 5 лет назад +13

    Simply brilliant explanation! Your channel is a boon for anyone looking for good CS fundamentals. Keep it up and hope you can publish topics on Core OS concepts as well?

  • @haritadepalli959
    @haritadepalli959 9 месяцев назад

    Excellent presentation. It is very difficult to find a similar presentation which explained the differences between the 4 concepts as clearly and as easily.

  • @devinmorgan4953
    @devinmorgan4953 5 лет назад +11

    EXCELLENT VIDEO!! This was the explanation that I was missing 🙌🙌🙌

  • @sougata7
    @sougata7 4 года назад +4

    Awesome! Each concept clearly explained in a structured way with clearly illustrated charts. What more can one ask for? Great job!

  • @rajivraghu9857
    @rajivraghu9857 5 лет назад +7

    Thanks Sunny.. you explain stuffs so well. Wish I found these lectures during my engineering..😃

    • @sunnyclassroom24
      @sunnyclassroom24  5 лет назад +2

      You are welcome and thank you for your nice comment.

  • @virendrabhati6685
    @virendrabhati6685 5 лет назад

    This was a simplest understanding of NAT and type. Examples are very simple and user friendly at each type of NAT describe by Sunny.

  • @sanjayprima
    @sanjayprima 2 года назад

    Excellent . No Other video can be better than to explain NAT-PAT

  • @fatpong6173
    @fatpong6173 3 года назад

    Thank you Sunny, your videos helped me passed a lot of exams

  • @zhenwang123
    @zhenwang123 4 года назад +1

    Great video. It is very clear and detailed. Much easier to understand. Thank you Sunny.

  • @Fearless......
    @Fearless...... 4 года назад +1

    Give this man the nobel peace prize for teaching !

  • @abdullahshaheed4276
    @abdullahshaheed4276 3 года назад

    Thank you so much Sunny, I always come back to your lessons. It's my favorite reference.

  • @18ShotErnie
    @18ShotErnie 4 года назад

    WE LOVE YOU SUNN!!!! THANKS FOR THIS... AND PLENTY OTHER VIDEOS. I REALLY VALUE THE THINGS YOUVE TAUGHT ME

  • @FredoCorleone
    @FredoCorleone 5 лет назад

    Best explantion ever. Sunny is better than Google's IT course in exaplaining NAT, no doubt.

  • @atvid2983
    @atvid2983 2 года назад

    Thank you sir, the pace and simplicity with which you explain concepts is commendable, when In doubt or want to learn about a subject, I search with Sunny Classroom #####, #### stands for whatever network related concept I am looking for, simple and Brilliant

  • @kooolabo
    @kooolabo 3 года назад

    Thank you Sunny! clear explanation! To the point! no time wasting.

  • @parischarlievij4904
    @parischarlievij4904 3 года назад

    Thank you Sunny! For putting a number of topics into perspective.

  • @simonzhou8416
    @simonzhou8416 4 года назад +1

    Very clear, better than my expensive cissp textbook!

  • @AnshumanKumar007
    @AnshumanKumar007 2 года назад

    it's quite interesting how something really helpful and seemingly innoccous has prevented transition to IPV6.

  • @moses5427
    @moses5427 Год назад

    Thank you for the clear and concise explanation as usual. Your videos taught me a lot!

  • @scienceblossom6197
    @scienceblossom6197 6 лет назад +4

    I loved this video. Very high quality explanation.

  • @DG-zu4iy
    @DG-zu4iy 2 года назад

    That moment when you search on youtube and cross your fingers a video with Sunny shows up in the results feed- BINGO! oh Thank Jesus....press PLAY! 😂

  • @Mastagon
    @Mastagon 3 года назад +1

    I can't say enough good things about Sunny Classroom.

  • @dudinhtran3642
    @dudinhtran3642 4 года назад +1

    Very useful video, easy to understand and remember. Great job! Many thanks!

  • @JoshuaNartey
    @JoshuaNartey 5 лет назад +6

    A little confused here
    Read a book where SNAT means Source Network Address Translation and DNAT means Destination Network Address Translation. The explanation you gave for PAT is what was given for DNAT.

  • @taddy666
    @taddy666 4 года назад

    This is awesome! Thanks for the precision and detail, Sunny.

  • @vishalsharmahacks
    @vishalsharmahacks 11 месяцев назад

    Very Nice Explanation. Watched Many. only now all confusions are cleared

  • @rufusmurphy9990
    @rufusmurphy9990 3 года назад

    A really good explanation, well paced and clear. Thank you

  • @luthermaria1021
    @luthermaria1021 3 года назад

    You deserve more subscribers, this is awesome

  • @quisjourney3688
    @quisjourney3688 Год назад

    thank you very much for the videos, so clear, so easy to understand. Hats off 🤩

  • @StuffOffYouStuff
    @StuffOffYouStuff 4 года назад +1

    Again, the best explained video I've seen on this. Your videos are excellent. I needed a refresh. I do have a couple of clarifying questions about this. 1) Dynamic NAT - what happens if all the public IP addresses are used up? Are internal hosts denied access to the internet then? 2) PAT - If an internal host sends an outgoing packet on port 80, but the gateway then translates that to port 8001, how does the web server on the internet know you are trying to communicate with it on port 80? Thanks, Sunny.

    • @juanpasht
      @juanpasht 4 года назад +1

      Here is what I think: 1) Yes, they must be denied access until an available public IP comes out; and if not using PAT. 2) The port 80 of the internal host is NATed. The web server doesn't care about that port but the one that comes by 8001 where it will reply the request. The router-gateway receives by 8001 and translates to 80 to the internal host. The web server will never know you tried by the port 80, and doesn't matter.

  • @althafahmed5757
    @althafahmed5757 4 года назад +1

    Thats a Beautiful Explanation with some Graphics to explain

    • @sunnyclassroom24
      @sunnyclassroom24  4 года назад +1

      Glad it was helpful!

    • @althafahmed5757
      @althafahmed5757 4 года назад

      @@sunnyclassroom24 can you explain dmvpn the same way along with configuration? Is there a video tutorial already for dmvpn?

  • @lltagged
    @lltagged 3 года назад

    Quick, concise and very clear. Thanks!

  • @michaeleaster1815
    @michaeleaster1815 5 лет назад +7

    Great video! Thank you... Though I believe 7:25 should be "is 16-bit value", not "16 digit value" ?

  • @pattygq
    @pattygq Год назад

    Excellent content as always. Thanks Sunny!

  • @devinwick5056
    @devinwick5056 3 года назад

    At last I understood. Thank you sunny!

  • @limichael1519
    @limichael1519 5 лет назад +2

    Hi Sunny Love ur teaching videoes. Thanks for sharing

  • @gustavolautenschlaeger9195
    @gustavolautenschlaeger9195 3 года назад

    Wonderful explanation and illustration. Thanks so much!

  • @seshansesha7645
    @seshansesha7645 5 лет назад +1

    Simple and easy to understand... thank you

  • @umardelvi5715
    @umardelvi5715 6 лет назад +1

    Very clear and concise explanation. Thank you Sir!

  • @premnathkangatharan2193
    @premnathkangatharan2193 3 года назад

    Thanks for explaining the differences in the different types of NAT... i was a bit curious how the external unit would know where my request came from, but i think it is by using the PAT by default.

  • @saltech2024
    @saltech2024 4 года назад +1

    Awesome!!
    You are so amazing tutor

  • @muhammadhakim6038
    @muhammadhakim6038 4 года назад +1

    one word...
    AWESOME!!!!!

  • @armandobarragang
    @armandobarragang 4 года назад +1

    Sunny, simple and excelent explication. Thanks

  • @thepawsupply1501
    @thepawsupply1501 3 года назад

    Very good Sunny! Thanks for making this video

  • @mr.b5678
    @mr.b5678 3 года назад

    Best on the web explanation. thanks bud

  • @mybluemars
    @mybluemars 29 дней назад

    SNAT also stands for "Source NAT" which is different then "Static NAT" and DNAT also stands for "Destination NAT" which is different than "Dynamic NAT".

  • @Helkenberg
    @Helkenberg 2 года назад

    Excellent video. Extremelyt Informative. Subscribed!

  • @saidaitbrahim2968
    @saidaitbrahim2968 3 года назад

    Wonderful explaining my teacher. Thank you so much

  • @tomcat2512
    @tomcat2512 2 года назад

    Thank you for this interesting video. It enhances my understanding of NAT. I realized that this video was made quite some time and CGNAT is not yet widely used back then. With the advent of the use of CGNAT by most ISP, it basically deactivates the use of port forwarding in a private network. Do you have a way around this? I would love to see another video on this topic. Thank you!

  • @ekonialancewanariu9049
    @ekonialancewanariu9049 4 года назад

    Short and sharp. I learnt alot within a short time.
    A question here please.
    If I'm using DNAT to connect, should I forget about PNAT? Or can I use them both simultaneously?

  • @dianeventura3270
    @dianeventura3270 5 лет назад +6

    IP address conflict @ 3:49 Web Server: 192.168.100.2 and Mail Server: 192.168.100.2

    • @sunnyclassroom24
      @sunnyclassroom24  5 лет назад +8

      Thank you very much for pointing that out. I noticed this mistake after I published it. You are very detail-oriented. I appreciate it very much. I will try my best to avoid such mistakes.

  • @naderreda2020
    @naderreda2020 4 года назад +1

    This is the best video ...... thank you...

  • @Dertgyhud
    @Dertgyhud 4 года назад +1

    Excellent video!

  • @fahadoutlook1241
    @fahadoutlook1241 3 года назад

    you are wonderful teacher.

  • @mokodo_
    @mokodo_ Год назад

    Your videos are amazing, thank you

  • @vinitshandilya
    @vinitshandilya 4 года назад

    How amazing this explanation was!! 😀

  • @ImmiTheKhan
    @ImmiTheKhan 5 лет назад +2

    Awesome explanation Sunny, Subscribed!

  • @mohishrockstar
    @mohishrockstar 5 лет назад +1

    If I understand it uses the TCP port number for uniqueness, now suppose one host using all the available ports (2^16 ports), then how will NATs in the router will map other hosts for incoming traffic?

    • @addanametocontinue
      @addanametocontinue 4 года назад

      The truth is that your router typically uses more than just port number to track the socket/session. It uses the source IP, sort port, destination IP, destination port. This combination of 4 data points allows it to keep track of a lot more than 65536 sessions.

    • @juanpasht
      @juanpasht 4 года назад

      @@addanametocontinue The combination in raw is: 2^32 src ips * 2^16 src ports * 2^32 dst ips * 2^16 dst ports = 2^96. But normally it is only used 1 unique public IP so it is: 1 src ip * 2^16 src ports * 2^32 dst ips * 2^16 dst ports = 2^64. But also there are some reserved and private IP that are not used as dst ips; they are about 1/8 (en.wikipedia.org/wiki/Reserved_IP_addresses) of the possible 2^32 . About the dst ports, can be used them all (like for port forwarding to one's PC- server), but normally just a few are used, like 25, 80, 443, 5228. So they may not be 2^16, but let's leave them on these 4. We have 1 srcIP * 2^16 srcPorts * (7/8) 2^32 dstIPs * 4 dstPorts = (7/8)2^50 possible combinations-sessions. They are still a lot.
      If one user is using a public IP address on its PC, then can use all those ~2^50 combinations. For a single outside-server like Facebook (with single public IP let's say), with same port 443 for example, well then yes it is 1 srcIP * 2^16 srcPorts * 1 dstIP * 1 dstport = 2^16 possible combinations-sessions; it is 65536 sessions, that, to be active, need constant activity, because if not, they expire so srcPorts can be reused. All this implies that they are still so that many so that PAT is possible. Let's say it is not a user's PC with public IP but the router with NAT-PAT -the most common form 6:04-; and that 100 devices are connected to it and all browsing Facebok (with 1 public IP address) in same port 443: They share the 65336 combinations the router can give by assigning srcPorts to them all (very improbable all 100 at same time browsing same web but who knows, though it is about 650 srcPorts for each evenly). The router will translate the internal hosts' IPs (with their ports) to all srcPorts as they are available. If, as @Mohan Gyara stated, only 1 device is exhausting the 65536 (surely only with a virus making source DoS) srcPorts, then surely no way the other 99 devices will be able to browse Facebook... but only Facebook, not all the web; without a virus it is almost imposible for 1 device or even 100 devices to exhaust the 65536 srcPorts to one single dstIP and dstPort, and single public srcIP. If the same device or other devices visit RUclips, then it is other IP and other possible combinations of 65536 srcPorts with that different dst IP and Port to be written in the router's NAT table.

  • @andygerard228
    @andygerard228 2 года назад

    Watching our videos always makes my mind feel less stress .

  • @realtebo
    @realtebo 3 года назад

    Really good video. If I understand well, what at my home I am doing in my router is only a simple port forwarding.
    SNAT and DNAT are used at ISP level?
    Or every home router is using ? and if yes,. .. can yuo explain me how?

  • @janindubhanuka545
    @janindubhanuka545 4 года назад +1

    Great work my friend..

  • @ashkanizadpanah9761
    @ashkanizadpanah9761 4 года назад

    Thanks Mr. for your great videos.

  • @NicolaeCristian175
    @NicolaeCristian175 5 лет назад +1

    thank you Sunny. Very good video.

  • @tiruinternationalpublicspe4932
    @tiruinternationalpublicspe4932 5 лет назад

    Awesome Video Sunny , Well Explained !!!

  • @123umesho
    @123umesho 4 года назад

    Nice explanation.
    I have a question. Which type is suitable if there are 2 or more web servers and outside people want to access a particular web server. Here only one public ip address is available. Kindly reply please 🙏🙏🙏

    • @juanpasht
      @juanpasht 4 года назад

      One uses port 80 (or 443) and the other you will need another domain that redirects traffic from port 80 (or 443) to the port of the other server. Let's say you have 1.1.1.1 public address. You use as dns: domain1.com so you just use straight port 80 to web server A's port 80 and the same for port 443. And you then use another dns: domain2.com which will redirect from port 80 to the web server por 81, and the same using port 443 to port 444.

    • @123umesho
      @123umesho 4 года назад

      @@juanpasht sir thank you for the reply.
      My practical problem is
      I have two devices which have ip addresses and can be monitored and configured by accessing them through web browser from a computer connected to them through a switch. This is done locally.
      Now I want to access them remotely.
      Presently I have one public address. I have configured the modem and put one device ip address in the DMZ settings. By this I am able access only one device remotely.
      I want to access both the devices remotely.
      How to do the settings in the modem? I am new to this. Can you help me with this?
      Thank you!

    • @juanpasht
      @juanpasht 4 года назад

      @@123umesho Hi. Ok is simple. If you just want to access a web server or any service on the other computer (the one is not assigned as DMZ host), just from the modem use port forwarding to the port of this machine. If the 2 devices are 192.168.1.1 and the other 192.168.1.2, and the DMZ is 192.168.1.1, then use port forwarding to 192.168.1.2, let's say you are talking about a web server in port 80 of 192.168.1.2, use a forwarded port from public 80 to private 80, or from public 12345 to private 80. The port forwarding rules are prioritized over the DMZ by the modem, or it should be that way if is not a rare modem hehe. So if 192.168.1.1 is another web server with port 80, and your public IP address is 100.100.100.100, then 100.100.100.100:80 will go to 192.168.1.1:80, and 100.100.100.100:12345 to 192.168.1.2:80. A real problem is when you are using https and port 443, and a FQDN domain name, and an SSL key certified so that the domain is trusted and validated, so you can open my.domain.com to the web server of your choice. Only 1 server. If you want another domain to forward to the 2nd server, it is needed the same port 443 with another FQDN name. So for example I use noip.com for DDNS. You can have many names forwarding to the same public IP. But for 443 to work on both domain names with same public IP... I don't remember if is possible there should be a way (difficult way), but with port 80 and normal http in noip there is an option to forward one domain name to the port 12345 ;D

    • @123umesho
      @123umesho 4 года назад

      @@juanpasht thank you. I get it.🙂

  • @sdputurn
    @sdputurn 2 года назад

    thanks for video. few questions:
    1. can we say PAT is again IP masquerading?
    2. i often see people use SNAT as source NAT and DNAT as destination NAT. i am not sure which one is correct.
    thanks in advance :)

  • @parostpg
    @parostpg 4 года назад +1

    Excellent. Thank you.

  • @rkoitsjohncena1258
    @rkoitsjohncena1258 4 года назад +1

    Very well explaination, thanks

  • @ctsdeveloperx9248
    @ctsdeveloperx9248 4 года назад +1

    Great video! Thanks!

  • @arthurimona5901
    @arthurimona5901 5 лет назад +2

    Great explanation. Thanks a lot!

  • @akeelsalman7202
    @akeelsalman7202 5 лет назад +1

    Another perfect video... Thanks Sunny

  • @WorkSmarter__
    @WorkSmarter__ 6 лет назад

    Hi Sunny ur videos are very clear. Request you to rearrange ur playlist from basic networking concepts to advanced topics making sure to add videos for each stage if not already there. I will bet u will add few more subscribers and reviews.

    • @sunnyclassroom24
      @sunnyclassroom24  6 лет назад +2

      Thank you very much for your suggestions. I am thinking to reorganize my video different. From the very beginning, I did not plan well since I did not intend to cover every topics only those that are difficult to understand. Now I am trying to do all topics based on theme (such as wireless, encryption, remote access...) I would set up a website in the near future, that I can organize all videos in easier to find way. I am still uploading new videos and still in messy, disorganized manner. I will do! Thank you very much!

  • @derekwang9758
    @derekwang9758 4 года назад

    Very clear video!

  • @josecobo7179
    @josecobo7179 5 лет назад +1

    Hi Sunny, thanks for the video. On the PAT explanation, why a common PORT of 80 was chosen instead of a random port number also known as ephemeral port? thank you

  • @alexmook6786
    @alexmook6786 3 года назад

    Awesome explanations!!!!!!

  • @te4683
    @te4683 Год назад

    Love youre videos. Thx for sharing

  •  3 года назад

    Excellent explanation. Thank you.

  • @sairfan06
    @sairfan06 2 года назад

    great, what i was looking for is, what if we have one public static ip and multiple web servers listing port 80 what we need under our main router to redirect each request?

  • @elikelik3574
    @elikelik3574 6 лет назад +2

    Great video. Now I know a little bit about SNAT, DNAT, PAT but have a question =). Which IP usually ISP gives us when we as I user want to get internet at home? I think we get DNAT.You said it is expensive, but what can we do the is no another way =D By the way, I guess in this video 3:48 under the picture Mais Server's IP should be 192.168.100.4 . Thanks for help.

    • @sunnyclassroom24
      @sunnyclassroom24  6 лет назад +2

      that is correct! It is a typo and a big mistake. next time I would be more careful. Many thanks for pointing it out. I promise I won't make that stupid mistake :(.
      about your question. I guess you are right when we use the Internet at home. DNAT is expensive, but those ISP companies are rich any way (robbing all our money blindly).

    • @elikelik3574
      @elikelik3574 6 лет назад +1

      No worry, It's OK. All of us doing mistakes =)

    • @sunnyclassroom24
      @sunnyclassroom24  6 лет назад +1

      You are very detail-oriented, which I should improve. I did look at this diagram no less than 10 times , but I still missed it this obvious error :(

    • @juanpasht
      @juanpasht 4 года назад

      @@sunnyclassroom24 I guess ISPs don't use DNAT because that implies multiple public IPs. They must use PAT, only giving one public IP. and the router NATs everything by ports.

  • @lukevandam7610
    @lukevandam7610 Год назад

    Love you sunny. such helpful vidz

  • @letdo3449
    @letdo3449 2 года назад

    very great explainations about this 🤗🤗🤗

  • @MRSa-tw6ut
    @MRSa-tw6ut 5 лет назад +1

    Very informative, many thanks.

  • @straight_path_123
    @straight_path_123 9 месяцев назад

    best explanation of NAT can you tell me which editor are you used for these type of videos

  • @sajjadhaider9849
    @sajjadhaider9849 5 лет назад

    Awesome Sir.Excellent !

  • @srinivasprusty
    @srinivasprusty 6 лет назад

    all your videos are excellent