What's the difference between DHCP and NAT? Are they mutually exclusive?home network question regarding dhcpHow to connect wireless router to work network with NAT?1:1 NAT IP address using iptablesDoes NAT Map to the MAC Address, or to the Local IP?Two network-ranges, one gateway - Double NAT issue2 Routers on network, can i have them do different DHCPHow do routers avoid port clashes when DMZ and NAT are used?Use Ubuntu Iptable to route public ip to pc in private networkNAT port forwarding of the same service run on multiple hosts?Can I setup a webserver on a private network?

What is this airplane that sits in front of Barringer High School in Newark, NJ?

Synaptic Static - when to roll the d6?

Boundaries and Buddhism

What is the highest power supply a Raspberry pi 3 B can handle without getting damaged?

The Amazing Sliding Crossword

Freewill and rewarding dogs

Counterfeit checks were created for my account. How does this type of fraud work?

How can a clan of females defend themselves in the ancient world against wandering bands?

What mathematical theory is required for high frequency trading?

Why is it 出差去 and not 去出差?

How can I prevent a user from copying files on another hard drive?

What kind of chart is this?

How can I ping multiple IP addresses at the same time?

Would a 7805 5 V regulator drain a 9 V battery?

How is the idea of "girlfriend material" naturally expressed in Russian?

Story of a Witch Boy

How are で and いう being used in this context?

"Correct me if I'm wrong"

How to modify a string without altering its text properties

I just entered the USA without passport control at Atlanta airport

Can the pre-order traversal of two different trees be the same even though they are different?

I found a password with hashcat but it doesn't work

Why one uses 了 and the other one doesn’t?

Densest sphere packing



What's the difference between DHCP and NAT? Are they mutually exclusive?


home network question regarding dhcpHow to connect wireless router to work network with NAT?1:1 NAT IP address using iptablesDoes NAT Map to the MAC Address, or to the Local IP?Two network-ranges, one gateway - Double NAT issue2 Routers on network, can i have them do different DHCPHow do routers avoid port clashes when DMZ and NAT are used?Use Ubuntu Iptable to route public ip to pc in private networkNAT port forwarding of the same service run on multiple hosts?Can I setup a webserver on a private network?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








9















I know this is a rather basic question, but I'm struggling to find sources online to clarify it.



As I understand it, in NAT, the router which connects the private network to the public internet has one IP address, which all traffic for the private network is directed to; the router then uses port numbers to figure out which device on the private network the traffic is for. In contrast, with DHCP, each device on the network is assigned it's own public IP address which traffic for it is directed to.



My confusion stems from hearing that both can be used simultaneously, which seems to contradict the idea that with NAT, there is only one IP address for the entire private network whereas with DHCP, there is an IP address for each device on the network. If they are mutually exclusive, where is each typically used?



Please feel free tear apart the above statements if you think it will help :).



Edit: The answer below explains it really well - I was being dumb and not realising that DHCP can assign any "type" of IP address, it's just a protocol for devices to join a network?










share|improve this question









New contributor



S. Dauncey is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.














  • 19





    Your confusion most likely stems from the fact that DHCP is entirely unrelated to NAT. It’s NAT vs non-NAT (sometimes “fully routed”). It’s DHCP vs static IP addresses (or some other management method).

    – Daniel B
    Jun 10 at 12:03

















9















I know this is a rather basic question, but I'm struggling to find sources online to clarify it.



As I understand it, in NAT, the router which connects the private network to the public internet has one IP address, which all traffic for the private network is directed to; the router then uses port numbers to figure out which device on the private network the traffic is for. In contrast, with DHCP, each device on the network is assigned it's own public IP address which traffic for it is directed to.



My confusion stems from hearing that both can be used simultaneously, which seems to contradict the idea that with NAT, there is only one IP address for the entire private network whereas with DHCP, there is an IP address for each device on the network. If they are mutually exclusive, where is each typically used?



Please feel free tear apart the above statements if you think it will help :).



Edit: The answer below explains it really well - I was being dumb and not realising that DHCP can assign any "type" of IP address, it's just a protocol for devices to join a network?










share|improve this question









New contributor



S. Dauncey is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.














  • 19





    Your confusion most likely stems from the fact that DHCP is entirely unrelated to NAT. It’s NAT vs non-NAT (sometimes “fully routed”). It’s DHCP vs static IP addresses (or some other management method).

    – Daniel B
    Jun 10 at 12:03













9












9








9


3






I know this is a rather basic question, but I'm struggling to find sources online to clarify it.



As I understand it, in NAT, the router which connects the private network to the public internet has one IP address, which all traffic for the private network is directed to; the router then uses port numbers to figure out which device on the private network the traffic is for. In contrast, with DHCP, each device on the network is assigned it's own public IP address which traffic for it is directed to.



My confusion stems from hearing that both can be used simultaneously, which seems to contradict the idea that with NAT, there is only one IP address for the entire private network whereas with DHCP, there is an IP address for each device on the network. If they are mutually exclusive, where is each typically used?



Please feel free tear apart the above statements if you think it will help :).



Edit: The answer below explains it really well - I was being dumb and not realising that DHCP can assign any "type" of IP address, it's just a protocol for devices to join a network?










share|improve this question









New contributor



S. Dauncey is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











I know this is a rather basic question, but I'm struggling to find sources online to clarify it.



As I understand it, in NAT, the router which connects the private network to the public internet has one IP address, which all traffic for the private network is directed to; the router then uses port numbers to figure out which device on the private network the traffic is for. In contrast, with DHCP, each device on the network is assigned it's own public IP address which traffic for it is directed to.



My confusion stems from hearing that both can be used simultaneously, which seems to contradict the idea that with NAT, there is only one IP address for the entire private network whereas with DHCP, there is an IP address for each device on the network. If they are mutually exclusive, where is each typically used?



Please feel free tear apart the above statements if you think it will help :).



Edit: The answer below explains it really well - I was being dumb and not realising that DHCP can assign any "type" of IP address, it's just a protocol for devices to join a network?







networking router dhcp nat






share|improve this question









New contributor



S. Dauncey is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.










share|improve this question









New contributor



S. Dauncey is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.








share|improve this question




share|improve this question








edited Jun 10 at 13:17







S. Dauncey













New contributor



S. Dauncey is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.








asked Jun 10 at 11:54









S. DaunceyS. Dauncey

5814




5814




New contributor



S. Dauncey is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




New contributor




S. Dauncey is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









  • 19





    Your confusion most likely stems from the fact that DHCP is entirely unrelated to NAT. It’s NAT vs non-NAT (sometimes “fully routed”). It’s DHCP vs static IP addresses (or some other management method).

    – Daniel B
    Jun 10 at 12:03












  • 19





    Your confusion most likely stems from the fact that DHCP is entirely unrelated to NAT. It’s NAT vs non-NAT (sometimes “fully routed”). It’s DHCP vs static IP addresses (or some other management method).

    – Daniel B
    Jun 10 at 12:03







19




19





Your confusion most likely stems from the fact that DHCP is entirely unrelated to NAT. It’s NAT vs non-NAT (sometimes “fully routed”). It’s DHCP vs static IP addresses (or some other management method).

– Daniel B
Jun 10 at 12:03





Your confusion most likely stems from the fact that DHCP is entirely unrelated to NAT. It’s NAT vs non-NAT (sometimes “fully routed”). It’s DHCP vs static IP addresses (or some other management method).

– Daniel B
Jun 10 at 12:03










6 Answers
6






active

oldest

votes


















26














NAT is a way to translate traffic in several ways. The simplest in home routers is to make everything seem like they’re behind the same IP address. This means any outbound connection from the local network is taken in, its source address is set to the router’s public address, a new port is allocated and the modified packet is sent forward. When there’s a packet back the same thing is done in reverse and the packet is sent to the original device.



NAT doesn’t need to be between private and public networks. It can also be between two public networks or two private ones. It just diverts traffic and doesn’t know anything about public or private.



DHCP is completely unrelated to this. It is a way for devices to shout to the local network asking for an IP address and other related information (like the gateway address, name servers etc) to be given to them. Again, a home router usually has a server to serve the clients in the local network. Without a DHCP server you’d need to set all IP addressed by hand to each device (or use the automatic IP system in Windows, for example, but that is only for local networks, not internetworking). The devices can not communicate using IP unless they have IP addresses and since practically all communications is over IP it’s needed.



The IP address given isn’t necessarily public. Maybe this causes the confusion to you. It’s any address that’s defined in the DHCP pool, or maybe even a static one for that specific device.



So you can have DHCP allocating IP addresses and never use a NAT. It just gives IPs from the pool and that’s that. You can also have NAT without DHCP. You can set fixed IPs, or you can use NAT to divert traffic through a firewall to some other machine etc. It doesn’t need anything from DHCP.



In home networks both are useful since there’s pretty much always only one external IP and users don’t want to manually set fixed IP addresses. So DHCP gives them local private IPs and NAT translates connections so that they look like they come from the same address.






share|improve this answer
































    6














    DHCP is a protocol for configuring hosts, and runs periodically to keep their addresses and other configuration up to date.
    NAT a process is for rewriting packets as they are forwarded across a router. To be more specific it does translate the addresses and sometimes the ports.






    share|improve this answer








    New contributor



    yahya is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.


























      4














      • DHCP takes a pool of IPs and assigns them upon request. Could be public or private


      • NAT (typically) takes routable IP data and sends it through to a non-routable IP (like the ubiquitous 192.168.0.0 block)


      In other words, they're not the same thing. It's like engines and tires: they both belong on a car and help make it run, but they do VERY different things.



      What's probably tripping you up is that most of the Internet runs on NAT (and often IPv4 NAT). If you're using NAT, the default configuration there is you take a public IP and then DHCP your non-routing block to whatever devices connect behind the router. The trick there is you don't HAVE to DHCP NAT. You can actually assign all your devices a local, non-routing IP. In fact, most residential routers have some block they don't DHCP for that reason, so you can assign, say, a network printer a fixed IP.



      It would be a pain to have someone come to your house and go "What's your Wifi password?" only to have you respond "Wait, let me assign your device an IP. What's your MAC address?" Not only will you get a blank stare (and your parents will disown you for asking them to tech), but this is a massive pain for you too. As such, nobody runs their network like this because DHCP is really convenient. I mean Adam Jacobs from Chef (DevOps company) told this story about a company that thought they couldn't use DHCP. Which immediately raised eyebrows among technology professionals.






      share|improve this answer























      • +1 for the engine and tires comparison. Simple, elegant and comprehensible to non tech people.

        – dgnuff
        Jun 11 at 20:17


















      1














      All TCP/IP connections have 4 numbers. Suppose it is between Alice and Bob.



      We have Alice_IP and Alice_Port, and we have Bob_IP and Bob_Port.



      When there is a NAT between them (say, translating Alice-side requests), takes the Alice_IP and Alice_Port and replaces them with NAT_IP and NAT_Port.



      So to Bob and all networks between the NAT and Bob, the connection is between NAT_IP and NAT_Port and Bob_IP and Bob_Port.



      The NAT keeps a table saying "Packets from Bob_IP and Bob_Port targeting NAT_IP and NAT_Port gets translated to Alice_IP and Alice_Port".



      While this is typically used so that private IP addresses can be used by Alice and her friends, and the NAT owns a NAT_IP that is a public IP valid on the entire internet.



      But you can also have layers of NAT between Alice and Bob, some facing Alice some facing Bob. It could even be used to when the addresses translated-to are real public internet addresses (but I don't see much point).



      DHCP solves a different problem. When you connect to a network, you may not have an IP address. DHCP is a way your computer can broadcast "Hello, this is me [ethernet hardware id], I need an IP address, can anyone help me?"



      Often a router will be configured to respond with "Sure, here is an IP address", and the router remembers (a) your mac address has that IP address, and (b) the IP address is on that particular sub-network.



      Where it gets those IP addresses is not something DHCP concerns itself about. On a typical consumer router, it grabs them from a pool of IP addresses reserved for private use, 10.xx.xx.xx, or 192.168.xx.xx.



      The problem is then that the rest of the internet cannot route to those addresses. In fact, many routers on the internet are configured to just drop packets with those addresses.



      Your consumer router connects to your ISP's router (or equivalent), which in turn distributes it an IP address. Your router typically does NAT, converting the DHCP-from-private-IP address connections of your household computers to its own DHCP-from-ISP provided IP address. Possibly your ISP then translates your router's IP address into a real internet IP address using yet another layer of NAT; or, maybe your ISP owns enough IP addresses that they can give your router a "real on the internet" IP address.



      The downside to this NAT is that your computer doesn't have a unique identity. So when someone wants to connect to your computer, if they send a packet at what appears to be your computer's IP address, they instead send it to the router.



      And the router may not have an entry in its NAT table for this new, unsolicited connection, so it drops the connection as nonsense.



      There are hacks to get around this of varying effectiveness.






      share|improve this answer























      • NAT ins't exclusive to IPv4 (IP patter: ###.###.###.###), at all. You may have NAT in IPv6 too.

        – Luciano
        Jun 13 at 19:34











      • @Luciano Yes? I'm uncertain if your comment is intended as a correction, random fact, something I should mention in addition to what I said above, or what? If it is a correction, which statement do you think I need to correct? I don't think I implied the opposite; I did mention IPv4 addresses, but only as a "typical consumer router", which indeed uses those IPv4 addresses (at this point)

        – Yakk
        Jun 13 at 20:13












      • It's kinda late to edit my comment, sorry. Anyway... It's just an additional fact. Lots of people relate NAT to IPv4 stuff.

        – Luciano
        Jun 13 at 20:27


















      0














      Nat is used to translate public to private ip address inside a network, dhcp is used for automatically giving the hosts in a network an ip, so that they can communicate with the router, and the outside world.






      share|improve this answer








      New contributor



      Poiuyt is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.


























        -1














        You're confused about DHCP. Here's what's going on in simple terms:



        • A router is a device that joins two networks, providing communication between them and their neighboring networks. This means that a router has two IP addresses, one for each network it's in. A "pure" router has only two network connectors, one for each network. Yours has more private-side connectors because it has an integrated switch (ie. a smart network splitter).


        • NAT is when device's address in network 1 is exposed to network 2 under a different address. When the router receives data addressed to that address in network 2, it forwards it to network 1, changing recipient's address. Home networks use a one-to-many NAT, where all devices appear to have one public address in the Internet, but ports on that address are mapped to multiple devices in the private network.


        • DHCP is a protocol for handing out IP addresses. When a device connects to a network, it shouts "hey, are there any DHCP servers around that would give me an IP address?" and the DHCP server responds with a free IP.


        DHCP is not an alternative to NAT. It serves a completely different purpose. It doesn't cross the network border. In fact, your router is running a DHCP server to hand out addresses in the private network, but it's also getting its own public IP from your ISP's DHCP server. There's DHCP running in both networks!






        share|improve this answer




















        • 2





          That doesn't sound like NAT. Your description of routers seems incomplete and ignores routing packets for addresses behind a gateway.

          – Yakk
          Jun 11 at 14:26












        • @Yakk Thanks for feedback, answer updated. I don't want to go into too much details in this answer, so pardon some simplifications.

          – gronostaj
          Jun 12 at 5:26











        Your Answer








        StackExchange.ready(function()
        var channelOptions =
        tags: "".split(" "),
        id: "3"
        ;
        initTagRenderer("".split(" "), "".split(" "), channelOptions);

        StackExchange.using("externalEditor", function()
        // Have to fire editor after snippets, if snippets enabled
        if (StackExchange.settings.snippets.snippetsEnabled)
        StackExchange.using("snippets", function()
        createEditor();
        );

        else
        createEditor();

        );

        function createEditor()
        StackExchange.prepareEditor(
        heartbeatType: 'answer',
        autoActivateHeartbeat: false,
        convertImagesToLinks: true,
        noModals: true,
        showLowRepImageUploadWarning: true,
        reputationToPostImages: 10,
        bindNavPrevention: true,
        postfix: "",
        imageUploader:
        brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
        contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
        allowUrls: true
        ,
        onDemand: true,
        discardSelector: ".discard-answer"
        ,immediatelyShowMarkdownHelp:true
        );



        );






        S. Dauncey is a new contributor. Be nice, and check out our Code of Conduct.









        draft saved

        draft discarded


















        StackExchange.ready(
        function ()
        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1446961%2fwhats-the-difference-between-dhcp-and-nat-are-they-mutually-exclusive%23new-answer', 'question_page');

        );

        Post as a guest















        Required, but never shown

























        6 Answers
        6






        active

        oldest

        votes








        6 Answers
        6






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes









        26














        NAT is a way to translate traffic in several ways. The simplest in home routers is to make everything seem like they’re behind the same IP address. This means any outbound connection from the local network is taken in, its source address is set to the router’s public address, a new port is allocated and the modified packet is sent forward. When there’s a packet back the same thing is done in reverse and the packet is sent to the original device.



        NAT doesn’t need to be between private and public networks. It can also be between two public networks or two private ones. It just diverts traffic and doesn’t know anything about public or private.



        DHCP is completely unrelated to this. It is a way for devices to shout to the local network asking for an IP address and other related information (like the gateway address, name servers etc) to be given to them. Again, a home router usually has a server to serve the clients in the local network. Without a DHCP server you’d need to set all IP addressed by hand to each device (or use the automatic IP system in Windows, for example, but that is only for local networks, not internetworking). The devices can not communicate using IP unless they have IP addresses and since practically all communications is over IP it’s needed.



        The IP address given isn’t necessarily public. Maybe this causes the confusion to you. It’s any address that’s defined in the DHCP pool, or maybe even a static one for that specific device.



        So you can have DHCP allocating IP addresses and never use a NAT. It just gives IPs from the pool and that’s that. You can also have NAT without DHCP. You can set fixed IPs, or you can use NAT to divert traffic through a firewall to some other machine etc. It doesn’t need anything from DHCP.



        In home networks both are useful since there’s pretty much always only one external IP and users don’t want to manually set fixed IP addresses. So DHCP gives them local private IPs and NAT translates connections so that they look like they come from the same address.






        share|improve this answer





























          26














          NAT is a way to translate traffic in several ways. The simplest in home routers is to make everything seem like they’re behind the same IP address. This means any outbound connection from the local network is taken in, its source address is set to the router’s public address, a new port is allocated and the modified packet is sent forward. When there’s a packet back the same thing is done in reverse and the packet is sent to the original device.



          NAT doesn’t need to be between private and public networks. It can also be between two public networks or two private ones. It just diverts traffic and doesn’t know anything about public or private.



          DHCP is completely unrelated to this. It is a way for devices to shout to the local network asking for an IP address and other related information (like the gateway address, name servers etc) to be given to them. Again, a home router usually has a server to serve the clients in the local network. Without a DHCP server you’d need to set all IP addressed by hand to each device (or use the automatic IP system in Windows, for example, but that is only for local networks, not internetworking). The devices can not communicate using IP unless they have IP addresses and since practically all communications is over IP it’s needed.



          The IP address given isn’t necessarily public. Maybe this causes the confusion to you. It’s any address that’s defined in the DHCP pool, or maybe even a static one for that specific device.



          So you can have DHCP allocating IP addresses and never use a NAT. It just gives IPs from the pool and that’s that. You can also have NAT without DHCP. You can set fixed IPs, or you can use NAT to divert traffic through a firewall to some other machine etc. It doesn’t need anything from DHCP.



          In home networks both are useful since there’s pretty much always only one external IP and users don’t want to manually set fixed IP addresses. So DHCP gives them local private IPs and NAT translates connections so that they look like they come from the same address.






          share|improve this answer



























            26












            26








            26







            NAT is a way to translate traffic in several ways. The simplest in home routers is to make everything seem like they’re behind the same IP address. This means any outbound connection from the local network is taken in, its source address is set to the router’s public address, a new port is allocated and the modified packet is sent forward. When there’s a packet back the same thing is done in reverse and the packet is sent to the original device.



            NAT doesn’t need to be between private and public networks. It can also be between two public networks or two private ones. It just diverts traffic and doesn’t know anything about public or private.



            DHCP is completely unrelated to this. It is a way for devices to shout to the local network asking for an IP address and other related information (like the gateway address, name servers etc) to be given to them. Again, a home router usually has a server to serve the clients in the local network. Without a DHCP server you’d need to set all IP addressed by hand to each device (or use the automatic IP system in Windows, for example, but that is only for local networks, not internetworking). The devices can not communicate using IP unless they have IP addresses and since practically all communications is over IP it’s needed.



            The IP address given isn’t necessarily public. Maybe this causes the confusion to you. It’s any address that’s defined in the DHCP pool, or maybe even a static one for that specific device.



            So you can have DHCP allocating IP addresses and never use a NAT. It just gives IPs from the pool and that’s that. You can also have NAT without DHCP. You can set fixed IPs, or you can use NAT to divert traffic through a firewall to some other machine etc. It doesn’t need anything from DHCP.



            In home networks both are useful since there’s pretty much always only one external IP and users don’t want to manually set fixed IP addresses. So DHCP gives them local private IPs and NAT translates connections so that they look like they come from the same address.






            share|improve this answer















            NAT is a way to translate traffic in several ways. The simplest in home routers is to make everything seem like they’re behind the same IP address. This means any outbound connection from the local network is taken in, its source address is set to the router’s public address, a new port is allocated and the modified packet is sent forward. When there’s a packet back the same thing is done in reverse and the packet is sent to the original device.



            NAT doesn’t need to be between private and public networks. It can also be between two public networks or two private ones. It just diverts traffic and doesn’t know anything about public or private.



            DHCP is completely unrelated to this. It is a way for devices to shout to the local network asking for an IP address and other related information (like the gateway address, name servers etc) to be given to them. Again, a home router usually has a server to serve the clients in the local network. Without a DHCP server you’d need to set all IP addressed by hand to each device (or use the automatic IP system in Windows, for example, but that is only for local networks, not internetworking). The devices can not communicate using IP unless they have IP addresses and since practically all communications is over IP it’s needed.



            The IP address given isn’t necessarily public. Maybe this causes the confusion to you. It’s any address that’s defined in the DHCP pool, or maybe even a static one for that specific device.



            So you can have DHCP allocating IP addresses and never use a NAT. It just gives IPs from the pool and that’s that. You can also have NAT without DHCP. You can set fixed IPs, or you can use NAT to divert traffic through a firewall to some other machine etc. It doesn’t need anything from DHCP.



            In home networks both are useful since there’s pretty much always only one external IP and users don’t want to manually set fixed IP addresses. So DHCP gives them local private IPs and NAT translates connections so that they look like they come from the same address.







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Jun 10 at 12:05

























            answered Jun 10 at 12:00









            Sami KuhmonenSami Kuhmonen

            1,84211324




            1,84211324























                6














                DHCP is a protocol for configuring hosts, and runs periodically to keep their addresses and other configuration up to date.
                NAT a process is for rewriting packets as they are forwarded across a router. To be more specific it does translate the addresses and sometimes the ports.






                share|improve this answer








                New contributor



                yahya is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.























                  6














                  DHCP is a protocol for configuring hosts, and runs periodically to keep their addresses and other configuration up to date.
                  NAT a process is for rewriting packets as they are forwarded across a router. To be more specific it does translate the addresses and sometimes the ports.






                  share|improve this answer








                  New contributor



                  yahya is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.





















                    6












                    6








                    6







                    DHCP is a protocol for configuring hosts, and runs periodically to keep their addresses and other configuration up to date.
                    NAT a process is for rewriting packets as they are forwarded across a router. To be more specific it does translate the addresses and sometimes the ports.






                    share|improve this answer








                    New contributor



                    yahya is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                    Check out our Code of Conduct.









                    DHCP is a protocol for configuring hosts, and runs periodically to keep their addresses and other configuration up to date.
                    NAT a process is for rewriting packets as they are forwarded across a router. To be more specific it does translate the addresses and sometimes the ports.







                    share|improve this answer








                    New contributor



                    yahya is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                    Check out our Code of Conduct.








                    share|improve this answer



                    share|improve this answer






                    New contributor



                    yahya is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                    Check out our Code of Conduct.








                    answered Jun 10 at 12:25









                    yahyayahya

                    692




                    692




                    New contributor



                    yahya is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                    Check out our Code of Conduct.




                    New contributor




                    yahya is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                    Check out our Code of Conduct.























                        4














                        • DHCP takes a pool of IPs and assigns them upon request. Could be public or private


                        • NAT (typically) takes routable IP data and sends it through to a non-routable IP (like the ubiquitous 192.168.0.0 block)


                        In other words, they're not the same thing. It's like engines and tires: they both belong on a car and help make it run, but they do VERY different things.



                        What's probably tripping you up is that most of the Internet runs on NAT (and often IPv4 NAT). If you're using NAT, the default configuration there is you take a public IP and then DHCP your non-routing block to whatever devices connect behind the router. The trick there is you don't HAVE to DHCP NAT. You can actually assign all your devices a local, non-routing IP. In fact, most residential routers have some block they don't DHCP for that reason, so you can assign, say, a network printer a fixed IP.



                        It would be a pain to have someone come to your house and go "What's your Wifi password?" only to have you respond "Wait, let me assign your device an IP. What's your MAC address?" Not only will you get a blank stare (and your parents will disown you for asking them to tech), but this is a massive pain for you too. As such, nobody runs their network like this because DHCP is really convenient. I mean Adam Jacobs from Chef (DevOps company) told this story about a company that thought they couldn't use DHCP. Which immediately raised eyebrows among technology professionals.






                        share|improve this answer























                        • +1 for the engine and tires comparison. Simple, elegant and comprehensible to non tech people.

                          – dgnuff
                          Jun 11 at 20:17















                        4














                        • DHCP takes a pool of IPs and assigns them upon request. Could be public or private


                        • NAT (typically) takes routable IP data and sends it through to a non-routable IP (like the ubiquitous 192.168.0.0 block)


                        In other words, they're not the same thing. It's like engines and tires: they both belong on a car and help make it run, but they do VERY different things.



                        What's probably tripping you up is that most of the Internet runs on NAT (and often IPv4 NAT). If you're using NAT, the default configuration there is you take a public IP and then DHCP your non-routing block to whatever devices connect behind the router. The trick there is you don't HAVE to DHCP NAT. You can actually assign all your devices a local, non-routing IP. In fact, most residential routers have some block they don't DHCP for that reason, so you can assign, say, a network printer a fixed IP.



                        It would be a pain to have someone come to your house and go "What's your Wifi password?" only to have you respond "Wait, let me assign your device an IP. What's your MAC address?" Not only will you get a blank stare (and your parents will disown you for asking them to tech), but this is a massive pain for you too. As such, nobody runs their network like this because DHCP is really convenient. I mean Adam Jacobs from Chef (DevOps company) told this story about a company that thought they couldn't use DHCP. Which immediately raised eyebrows among technology professionals.






                        share|improve this answer























                        • +1 for the engine and tires comparison. Simple, elegant and comprehensible to non tech people.

                          – dgnuff
                          Jun 11 at 20:17













                        4












                        4








                        4







                        • DHCP takes a pool of IPs and assigns them upon request. Could be public or private


                        • NAT (typically) takes routable IP data and sends it through to a non-routable IP (like the ubiquitous 192.168.0.0 block)


                        In other words, they're not the same thing. It's like engines and tires: they both belong on a car and help make it run, but they do VERY different things.



                        What's probably tripping you up is that most of the Internet runs on NAT (and often IPv4 NAT). If you're using NAT, the default configuration there is you take a public IP and then DHCP your non-routing block to whatever devices connect behind the router. The trick there is you don't HAVE to DHCP NAT. You can actually assign all your devices a local, non-routing IP. In fact, most residential routers have some block they don't DHCP for that reason, so you can assign, say, a network printer a fixed IP.



                        It would be a pain to have someone come to your house and go "What's your Wifi password?" only to have you respond "Wait, let me assign your device an IP. What's your MAC address?" Not only will you get a blank stare (and your parents will disown you for asking them to tech), but this is a massive pain for you too. As such, nobody runs their network like this because DHCP is really convenient. I mean Adam Jacobs from Chef (DevOps company) told this story about a company that thought they couldn't use DHCP. Which immediately raised eyebrows among technology professionals.






                        share|improve this answer













                        • DHCP takes a pool of IPs and assigns them upon request. Could be public or private


                        • NAT (typically) takes routable IP data and sends it through to a non-routable IP (like the ubiquitous 192.168.0.0 block)


                        In other words, they're not the same thing. It's like engines and tires: they both belong on a car and help make it run, but they do VERY different things.



                        What's probably tripping you up is that most of the Internet runs on NAT (and often IPv4 NAT). If you're using NAT, the default configuration there is you take a public IP and then DHCP your non-routing block to whatever devices connect behind the router. The trick there is you don't HAVE to DHCP NAT. You can actually assign all your devices a local, non-routing IP. In fact, most residential routers have some block they don't DHCP for that reason, so you can assign, say, a network printer a fixed IP.



                        It would be a pain to have someone come to your house and go "What's your Wifi password?" only to have you respond "Wait, let me assign your device an IP. What's your MAC address?" Not only will you get a blank stare (and your parents will disown you for asking them to tech), but this is a massive pain for you too. As such, nobody runs their network like this because DHCP is really convenient. I mean Adam Jacobs from Chef (DevOps company) told this story about a company that thought they couldn't use DHCP. Which immediately raised eyebrows among technology professionals.







                        share|improve this answer












                        share|improve this answer



                        share|improve this answer










                        answered Jun 10 at 20:56









                        MachavityMachavity

                        404414




                        404414












                        • +1 for the engine and tires comparison. Simple, elegant and comprehensible to non tech people.

                          – dgnuff
                          Jun 11 at 20:17

















                        • +1 for the engine and tires comparison. Simple, elegant and comprehensible to non tech people.

                          – dgnuff
                          Jun 11 at 20:17
















                        +1 for the engine and tires comparison. Simple, elegant and comprehensible to non tech people.

                        – dgnuff
                        Jun 11 at 20:17





                        +1 for the engine and tires comparison. Simple, elegant and comprehensible to non tech people.

                        – dgnuff
                        Jun 11 at 20:17











                        1














                        All TCP/IP connections have 4 numbers. Suppose it is between Alice and Bob.



                        We have Alice_IP and Alice_Port, and we have Bob_IP and Bob_Port.



                        When there is a NAT between them (say, translating Alice-side requests), takes the Alice_IP and Alice_Port and replaces them with NAT_IP and NAT_Port.



                        So to Bob and all networks between the NAT and Bob, the connection is between NAT_IP and NAT_Port and Bob_IP and Bob_Port.



                        The NAT keeps a table saying "Packets from Bob_IP and Bob_Port targeting NAT_IP and NAT_Port gets translated to Alice_IP and Alice_Port".



                        While this is typically used so that private IP addresses can be used by Alice and her friends, and the NAT owns a NAT_IP that is a public IP valid on the entire internet.



                        But you can also have layers of NAT between Alice and Bob, some facing Alice some facing Bob. It could even be used to when the addresses translated-to are real public internet addresses (but I don't see much point).



                        DHCP solves a different problem. When you connect to a network, you may not have an IP address. DHCP is a way your computer can broadcast "Hello, this is me [ethernet hardware id], I need an IP address, can anyone help me?"



                        Often a router will be configured to respond with "Sure, here is an IP address", and the router remembers (a) your mac address has that IP address, and (b) the IP address is on that particular sub-network.



                        Where it gets those IP addresses is not something DHCP concerns itself about. On a typical consumer router, it grabs them from a pool of IP addresses reserved for private use, 10.xx.xx.xx, or 192.168.xx.xx.



                        The problem is then that the rest of the internet cannot route to those addresses. In fact, many routers on the internet are configured to just drop packets with those addresses.



                        Your consumer router connects to your ISP's router (or equivalent), which in turn distributes it an IP address. Your router typically does NAT, converting the DHCP-from-private-IP address connections of your household computers to its own DHCP-from-ISP provided IP address. Possibly your ISP then translates your router's IP address into a real internet IP address using yet another layer of NAT; or, maybe your ISP owns enough IP addresses that they can give your router a "real on the internet" IP address.



                        The downside to this NAT is that your computer doesn't have a unique identity. So when someone wants to connect to your computer, if they send a packet at what appears to be your computer's IP address, they instead send it to the router.



                        And the router may not have an entry in its NAT table for this new, unsolicited connection, so it drops the connection as nonsense.



                        There are hacks to get around this of varying effectiveness.






                        share|improve this answer























                        • NAT ins't exclusive to IPv4 (IP patter: ###.###.###.###), at all. You may have NAT in IPv6 too.

                          – Luciano
                          Jun 13 at 19:34











                        • @Luciano Yes? I'm uncertain if your comment is intended as a correction, random fact, something I should mention in addition to what I said above, or what? If it is a correction, which statement do you think I need to correct? I don't think I implied the opposite; I did mention IPv4 addresses, but only as a "typical consumer router", which indeed uses those IPv4 addresses (at this point)

                          – Yakk
                          Jun 13 at 20:13












                        • It's kinda late to edit my comment, sorry. Anyway... It's just an additional fact. Lots of people relate NAT to IPv4 stuff.

                          – Luciano
                          Jun 13 at 20:27















                        1














                        All TCP/IP connections have 4 numbers. Suppose it is between Alice and Bob.



                        We have Alice_IP and Alice_Port, and we have Bob_IP and Bob_Port.



                        When there is a NAT between them (say, translating Alice-side requests), takes the Alice_IP and Alice_Port and replaces them with NAT_IP and NAT_Port.



                        So to Bob and all networks between the NAT and Bob, the connection is between NAT_IP and NAT_Port and Bob_IP and Bob_Port.



                        The NAT keeps a table saying "Packets from Bob_IP and Bob_Port targeting NAT_IP and NAT_Port gets translated to Alice_IP and Alice_Port".



                        While this is typically used so that private IP addresses can be used by Alice and her friends, and the NAT owns a NAT_IP that is a public IP valid on the entire internet.



                        But you can also have layers of NAT between Alice and Bob, some facing Alice some facing Bob. It could even be used to when the addresses translated-to are real public internet addresses (but I don't see much point).



                        DHCP solves a different problem. When you connect to a network, you may not have an IP address. DHCP is a way your computer can broadcast "Hello, this is me [ethernet hardware id], I need an IP address, can anyone help me?"



                        Often a router will be configured to respond with "Sure, here is an IP address", and the router remembers (a) your mac address has that IP address, and (b) the IP address is on that particular sub-network.



                        Where it gets those IP addresses is not something DHCP concerns itself about. On a typical consumer router, it grabs them from a pool of IP addresses reserved for private use, 10.xx.xx.xx, or 192.168.xx.xx.



                        The problem is then that the rest of the internet cannot route to those addresses. In fact, many routers on the internet are configured to just drop packets with those addresses.



                        Your consumer router connects to your ISP's router (or equivalent), which in turn distributes it an IP address. Your router typically does NAT, converting the DHCP-from-private-IP address connections of your household computers to its own DHCP-from-ISP provided IP address. Possibly your ISP then translates your router's IP address into a real internet IP address using yet another layer of NAT; or, maybe your ISP owns enough IP addresses that they can give your router a "real on the internet" IP address.



                        The downside to this NAT is that your computer doesn't have a unique identity. So when someone wants to connect to your computer, if they send a packet at what appears to be your computer's IP address, they instead send it to the router.



                        And the router may not have an entry in its NAT table for this new, unsolicited connection, so it drops the connection as nonsense.



                        There are hacks to get around this of varying effectiveness.






                        share|improve this answer























                        • NAT ins't exclusive to IPv4 (IP patter: ###.###.###.###), at all. You may have NAT in IPv6 too.

                          – Luciano
                          Jun 13 at 19:34











                        • @Luciano Yes? I'm uncertain if your comment is intended as a correction, random fact, something I should mention in addition to what I said above, or what? If it is a correction, which statement do you think I need to correct? I don't think I implied the opposite; I did mention IPv4 addresses, but only as a "typical consumer router", which indeed uses those IPv4 addresses (at this point)

                          – Yakk
                          Jun 13 at 20:13












                        • It's kinda late to edit my comment, sorry. Anyway... It's just an additional fact. Lots of people relate NAT to IPv4 stuff.

                          – Luciano
                          Jun 13 at 20:27













                        1












                        1








                        1







                        All TCP/IP connections have 4 numbers. Suppose it is between Alice and Bob.



                        We have Alice_IP and Alice_Port, and we have Bob_IP and Bob_Port.



                        When there is a NAT between them (say, translating Alice-side requests), takes the Alice_IP and Alice_Port and replaces them with NAT_IP and NAT_Port.



                        So to Bob and all networks between the NAT and Bob, the connection is between NAT_IP and NAT_Port and Bob_IP and Bob_Port.



                        The NAT keeps a table saying "Packets from Bob_IP and Bob_Port targeting NAT_IP and NAT_Port gets translated to Alice_IP and Alice_Port".



                        While this is typically used so that private IP addresses can be used by Alice and her friends, and the NAT owns a NAT_IP that is a public IP valid on the entire internet.



                        But you can also have layers of NAT between Alice and Bob, some facing Alice some facing Bob. It could even be used to when the addresses translated-to are real public internet addresses (but I don't see much point).



                        DHCP solves a different problem. When you connect to a network, you may not have an IP address. DHCP is a way your computer can broadcast "Hello, this is me [ethernet hardware id], I need an IP address, can anyone help me?"



                        Often a router will be configured to respond with "Sure, here is an IP address", and the router remembers (a) your mac address has that IP address, and (b) the IP address is on that particular sub-network.



                        Where it gets those IP addresses is not something DHCP concerns itself about. On a typical consumer router, it grabs them from a pool of IP addresses reserved for private use, 10.xx.xx.xx, or 192.168.xx.xx.



                        The problem is then that the rest of the internet cannot route to those addresses. In fact, many routers on the internet are configured to just drop packets with those addresses.



                        Your consumer router connects to your ISP's router (or equivalent), which in turn distributes it an IP address. Your router typically does NAT, converting the DHCP-from-private-IP address connections of your household computers to its own DHCP-from-ISP provided IP address. Possibly your ISP then translates your router's IP address into a real internet IP address using yet another layer of NAT; or, maybe your ISP owns enough IP addresses that they can give your router a "real on the internet" IP address.



                        The downside to this NAT is that your computer doesn't have a unique identity. So when someone wants to connect to your computer, if they send a packet at what appears to be your computer's IP address, they instead send it to the router.



                        And the router may not have an entry in its NAT table for this new, unsolicited connection, so it drops the connection as nonsense.



                        There are hacks to get around this of varying effectiveness.






                        share|improve this answer













                        All TCP/IP connections have 4 numbers. Suppose it is between Alice and Bob.



                        We have Alice_IP and Alice_Port, and we have Bob_IP and Bob_Port.



                        When there is a NAT between them (say, translating Alice-side requests), takes the Alice_IP and Alice_Port and replaces them with NAT_IP and NAT_Port.



                        So to Bob and all networks between the NAT and Bob, the connection is between NAT_IP and NAT_Port and Bob_IP and Bob_Port.



                        The NAT keeps a table saying "Packets from Bob_IP and Bob_Port targeting NAT_IP and NAT_Port gets translated to Alice_IP and Alice_Port".



                        While this is typically used so that private IP addresses can be used by Alice and her friends, and the NAT owns a NAT_IP that is a public IP valid on the entire internet.



                        But you can also have layers of NAT between Alice and Bob, some facing Alice some facing Bob. It could even be used to when the addresses translated-to are real public internet addresses (but I don't see much point).



                        DHCP solves a different problem. When you connect to a network, you may not have an IP address. DHCP is a way your computer can broadcast "Hello, this is me [ethernet hardware id], I need an IP address, can anyone help me?"



                        Often a router will be configured to respond with "Sure, here is an IP address", and the router remembers (a) your mac address has that IP address, and (b) the IP address is on that particular sub-network.



                        Where it gets those IP addresses is not something DHCP concerns itself about. On a typical consumer router, it grabs them from a pool of IP addresses reserved for private use, 10.xx.xx.xx, or 192.168.xx.xx.



                        The problem is then that the rest of the internet cannot route to those addresses. In fact, many routers on the internet are configured to just drop packets with those addresses.



                        Your consumer router connects to your ISP's router (or equivalent), which in turn distributes it an IP address. Your router typically does NAT, converting the DHCP-from-private-IP address connections of your household computers to its own DHCP-from-ISP provided IP address. Possibly your ISP then translates your router's IP address into a real internet IP address using yet another layer of NAT; or, maybe your ISP owns enough IP addresses that they can give your router a "real on the internet" IP address.



                        The downside to this NAT is that your computer doesn't have a unique identity. So when someone wants to connect to your computer, if they send a packet at what appears to be your computer's IP address, they instead send it to the router.



                        And the router may not have an entry in its NAT table for this new, unsolicited connection, so it drops the connection as nonsense.



                        There are hacks to get around this of varying effectiveness.







                        share|improve this answer












                        share|improve this answer



                        share|improve this answer










                        answered Jun 11 at 14:40









                        YakkYakk

                        1535




                        1535












                        • NAT ins't exclusive to IPv4 (IP patter: ###.###.###.###), at all. You may have NAT in IPv6 too.

                          – Luciano
                          Jun 13 at 19:34











                        • @Luciano Yes? I'm uncertain if your comment is intended as a correction, random fact, something I should mention in addition to what I said above, or what? If it is a correction, which statement do you think I need to correct? I don't think I implied the opposite; I did mention IPv4 addresses, but only as a "typical consumer router", which indeed uses those IPv4 addresses (at this point)

                          – Yakk
                          Jun 13 at 20:13












                        • It's kinda late to edit my comment, sorry. Anyway... It's just an additional fact. Lots of people relate NAT to IPv4 stuff.

                          – Luciano
                          Jun 13 at 20:27

















                        • NAT ins't exclusive to IPv4 (IP patter: ###.###.###.###), at all. You may have NAT in IPv6 too.

                          – Luciano
                          Jun 13 at 19:34











                        • @Luciano Yes? I'm uncertain if your comment is intended as a correction, random fact, something I should mention in addition to what I said above, or what? If it is a correction, which statement do you think I need to correct? I don't think I implied the opposite; I did mention IPv4 addresses, but only as a "typical consumer router", which indeed uses those IPv4 addresses (at this point)

                          – Yakk
                          Jun 13 at 20:13












                        • It's kinda late to edit my comment, sorry. Anyway... It's just an additional fact. Lots of people relate NAT to IPv4 stuff.

                          – Luciano
                          Jun 13 at 20:27
















                        NAT ins't exclusive to IPv4 (IP patter: ###.###.###.###), at all. You may have NAT in IPv6 too.

                        – Luciano
                        Jun 13 at 19:34





                        NAT ins't exclusive to IPv4 (IP patter: ###.###.###.###), at all. You may have NAT in IPv6 too.

                        – Luciano
                        Jun 13 at 19:34













                        @Luciano Yes? I'm uncertain if your comment is intended as a correction, random fact, something I should mention in addition to what I said above, or what? If it is a correction, which statement do you think I need to correct? I don't think I implied the opposite; I did mention IPv4 addresses, but only as a "typical consumer router", which indeed uses those IPv4 addresses (at this point)

                        – Yakk
                        Jun 13 at 20:13






                        @Luciano Yes? I'm uncertain if your comment is intended as a correction, random fact, something I should mention in addition to what I said above, or what? If it is a correction, which statement do you think I need to correct? I don't think I implied the opposite; I did mention IPv4 addresses, but only as a "typical consumer router", which indeed uses those IPv4 addresses (at this point)

                        – Yakk
                        Jun 13 at 20:13














                        It's kinda late to edit my comment, sorry. Anyway... It's just an additional fact. Lots of people relate NAT to IPv4 stuff.

                        – Luciano
                        Jun 13 at 20:27





                        It's kinda late to edit my comment, sorry. Anyway... It's just an additional fact. Lots of people relate NAT to IPv4 stuff.

                        – Luciano
                        Jun 13 at 20:27











                        0














                        Nat is used to translate public to private ip address inside a network, dhcp is used for automatically giving the hosts in a network an ip, so that they can communicate with the router, and the outside world.






                        share|improve this answer








                        New contributor



                        Poiuyt is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                        Check out our Code of Conduct.























                          0














                          Nat is used to translate public to private ip address inside a network, dhcp is used for automatically giving the hosts in a network an ip, so that they can communicate with the router, and the outside world.






                          share|improve this answer








                          New contributor



                          Poiuyt is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.





















                            0












                            0








                            0







                            Nat is used to translate public to private ip address inside a network, dhcp is used for automatically giving the hosts in a network an ip, so that they can communicate with the router, and the outside world.






                            share|improve this answer








                            New contributor



                            Poiuyt is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                            Check out our Code of Conduct.









                            Nat is used to translate public to private ip address inside a network, dhcp is used for automatically giving the hosts in a network an ip, so that they can communicate with the router, and the outside world.







                            share|improve this answer








                            New contributor



                            Poiuyt is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                            Check out our Code of Conduct.








                            share|improve this answer



                            share|improve this answer






                            New contributor



                            Poiuyt is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                            Check out our Code of Conduct.








                            answered Jun 10 at 18:24









                            PoiuytPoiuyt

                            1




                            1




                            New contributor



                            Poiuyt is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                            Check out our Code of Conduct.




                            New contributor




                            Poiuyt is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                            Check out our Code of Conduct.























                                -1














                                You're confused about DHCP. Here's what's going on in simple terms:



                                • A router is a device that joins two networks, providing communication between them and their neighboring networks. This means that a router has two IP addresses, one for each network it's in. A "pure" router has only two network connectors, one for each network. Yours has more private-side connectors because it has an integrated switch (ie. a smart network splitter).


                                • NAT is when device's address in network 1 is exposed to network 2 under a different address. When the router receives data addressed to that address in network 2, it forwards it to network 1, changing recipient's address. Home networks use a one-to-many NAT, where all devices appear to have one public address in the Internet, but ports on that address are mapped to multiple devices in the private network.


                                • DHCP is a protocol for handing out IP addresses. When a device connects to a network, it shouts "hey, are there any DHCP servers around that would give me an IP address?" and the DHCP server responds with a free IP.


                                DHCP is not an alternative to NAT. It serves a completely different purpose. It doesn't cross the network border. In fact, your router is running a DHCP server to hand out addresses in the private network, but it's also getting its own public IP from your ISP's DHCP server. There's DHCP running in both networks!






                                share|improve this answer




















                                • 2





                                  That doesn't sound like NAT. Your description of routers seems incomplete and ignores routing packets for addresses behind a gateway.

                                  – Yakk
                                  Jun 11 at 14:26












                                • @Yakk Thanks for feedback, answer updated. I don't want to go into too much details in this answer, so pardon some simplifications.

                                  – gronostaj
                                  Jun 12 at 5:26















                                -1














                                You're confused about DHCP. Here's what's going on in simple terms:



                                • A router is a device that joins two networks, providing communication between them and their neighboring networks. This means that a router has two IP addresses, one for each network it's in. A "pure" router has only two network connectors, one for each network. Yours has more private-side connectors because it has an integrated switch (ie. a smart network splitter).


                                • NAT is when device's address in network 1 is exposed to network 2 under a different address. When the router receives data addressed to that address in network 2, it forwards it to network 1, changing recipient's address. Home networks use a one-to-many NAT, where all devices appear to have one public address in the Internet, but ports on that address are mapped to multiple devices in the private network.


                                • DHCP is a protocol for handing out IP addresses. When a device connects to a network, it shouts "hey, are there any DHCP servers around that would give me an IP address?" and the DHCP server responds with a free IP.


                                DHCP is not an alternative to NAT. It serves a completely different purpose. It doesn't cross the network border. In fact, your router is running a DHCP server to hand out addresses in the private network, but it's also getting its own public IP from your ISP's DHCP server. There's DHCP running in both networks!






                                share|improve this answer




















                                • 2





                                  That doesn't sound like NAT. Your description of routers seems incomplete and ignores routing packets for addresses behind a gateway.

                                  – Yakk
                                  Jun 11 at 14:26












                                • @Yakk Thanks for feedback, answer updated. I don't want to go into too much details in this answer, so pardon some simplifications.

                                  – gronostaj
                                  Jun 12 at 5:26













                                -1












                                -1








                                -1







                                You're confused about DHCP. Here's what's going on in simple terms:



                                • A router is a device that joins two networks, providing communication between them and their neighboring networks. This means that a router has two IP addresses, one for each network it's in. A "pure" router has only two network connectors, one for each network. Yours has more private-side connectors because it has an integrated switch (ie. a smart network splitter).


                                • NAT is when device's address in network 1 is exposed to network 2 under a different address. When the router receives data addressed to that address in network 2, it forwards it to network 1, changing recipient's address. Home networks use a one-to-many NAT, where all devices appear to have one public address in the Internet, but ports on that address are mapped to multiple devices in the private network.


                                • DHCP is a protocol for handing out IP addresses. When a device connects to a network, it shouts "hey, are there any DHCP servers around that would give me an IP address?" and the DHCP server responds with a free IP.


                                DHCP is not an alternative to NAT. It serves a completely different purpose. It doesn't cross the network border. In fact, your router is running a DHCP server to hand out addresses in the private network, but it's also getting its own public IP from your ISP's DHCP server. There's DHCP running in both networks!






                                share|improve this answer















                                You're confused about DHCP. Here's what's going on in simple terms:



                                • A router is a device that joins two networks, providing communication between them and their neighboring networks. This means that a router has two IP addresses, one for each network it's in. A "pure" router has only two network connectors, one for each network. Yours has more private-side connectors because it has an integrated switch (ie. a smart network splitter).


                                • NAT is when device's address in network 1 is exposed to network 2 under a different address. When the router receives data addressed to that address in network 2, it forwards it to network 1, changing recipient's address. Home networks use a one-to-many NAT, where all devices appear to have one public address in the Internet, but ports on that address are mapped to multiple devices in the private network.


                                • DHCP is a protocol for handing out IP addresses. When a device connects to a network, it shouts "hey, are there any DHCP servers around that would give me an IP address?" and the DHCP server responds with a free IP.


                                DHCP is not an alternative to NAT. It serves a completely different purpose. It doesn't cross the network border. In fact, your router is running a DHCP server to hand out addresses in the private network, but it's also getting its own public IP from your ISP's DHCP server. There's DHCP running in both networks!







                                share|improve this answer














                                share|improve this answer



                                share|improve this answer








                                edited Jun 12 at 5:25

























                                answered Jun 11 at 5:58









                                gronostajgronostaj

                                29.7k1472109




                                29.7k1472109







                                • 2





                                  That doesn't sound like NAT. Your description of routers seems incomplete and ignores routing packets for addresses behind a gateway.

                                  – Yakk
                                  Jun 11 at 14:26












                                • @Yakk Thanks for feedback, answer updated. I don't want to go into too much details in this answer, so pardon some simplifications.

                                  – gronostaj
                                  Jun 12 at 5:26












                                • 2





                                  That doesn't sound like NAT. Your description of routers seems incomplete and ignores routing packets for addresses behind a gateway.

                                  – Yakk
                                  Jun 11 at 14:26












                                • @Yakk Thanks for feedback, answer updated. I don't want to go into too much details in this answer, so pardon some simplifications.

                                  – gronostaj
                                  Jun 12 at 5:26







                                2




                                2





                                That doesn't sound like NAT. Your description of routers seems incomplete and ignores routing packets for addresses behind a gateway.

                                – Yakk
                                Jun 11 at 14:26






                                That doesn't sound like NAT. Your description of routers seems incomplete and ignores routing packets for addresses behind a gateway.

                                – Yakk
                                Jun 11 at 14:26














                                @Yakk Thanks for feedback, answer updated. I don't want to go into too much details in this answer, so pardon some simplifications.

                                – gronostaj
                                Jun 12 at 5:26





                                @Yakk Thanks for feedback, answer updated. I don't want to go into too much details in this answer, so pardon some simplifications.

                                – gronostaj
                                Jun 12 at 5:26










                                S. Dauncey is a new contributor. Be nice, and check out our Code of Conduct.









                                draft saved

                                draft discarded


















                                S. Dauncey is a new contributor. Be nice, and check out our Code of Conduct.












                                S. Dauncey is a new contributor. Be nice, and check out our Code of Conduct.











                                S. Dauncey is a new contributor. Be nice, and check out our Code of Conduct.














                                Thanks for contributing an answer to Super User!


                                • Please be sure to answer the question. Provide details and share your research!

                                But avoid


                                • Asking for help, clarification, or responding to other answers.

                                • Making statements based on opinion; back them up with references or personal experience.

                                To learn more, see our tips on writing great answers.




                                draft saved


                                draft discarded














                                StackExchange.ready(
                                function ()
                                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1446961%2fwhats-the-difference-between-dhcp-and-nat-are-they-mutually-exclusive%23new-answer', 'question_page');

                                );

                                Post as a guest















                                Required, but never shown





















































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown

































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown







                                Popular posts from this blog

                                Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

                                Circuit construction for execution of conditional statements using least significant bitHow are two different registers being used as “control”?How exactly is the stated composite state of the two registers being produced using the $R_zz$ controlled rotations?Efficiently performing controlled rotations in HHLWould this quantum algorithm implementation work?How to prepare a superposed states of odd integers from $1$ to $sqrtN$?Why is this implementation of the order finding algorithm not working?Circuit construction for Hamiltonian simulationHow can I invert the least significant bit of a certain term of a superposed state?Implementing an oracleImplementing a controlled sum operation

                                Magento 2 “No Payment Methods” in Admin New OrderHow to integrate Paypal Express Checkout with the Magento APIMagento 1.5 - Sales > Order > edit order and shipping methods disappearAuto Invoice Check/Money Order Payment methodAdd more simple payment methods?Shipping methods not showingWhat should I do to change payment methods if changing the configuration has no effects?1.9 - No Payment Methods showing upMy Payment Methods not Showing for downloadable/virtual product when checkout?Magento2 API to access internal payment methodHow to call an existing payment methods in the registration form?