2

I'm a little confused about the meaning of DHCP and NAT in Internet.

I know NAT is used to translate local IP address and ports to a public IP and port. So your local network has IP looking like 192.168.212/24 for example.

But then I found that DHCP is used to give IP address and configurations to hosts connected to a router, and that our home routers have a DHCP server to assign IPs to the hosts. Isn't that already done by NAT?

Other strange thing, if I access websites that give me my IP, from two computers in the same local network, these sites will give me different IPs, shouldn't it be the IP of my router?

4

NAT and DHCP are two totally different things. DHCP assigns IP addresses, DNS servers and gateways, NAT translates adresses between two networks, typically between a private network using RFC1918 (local) addresses and a public network, so multiple local devices can share one public IP address.

To answer your second question: there can be many reasons why those two computers have different IPs, they all depend on your network. One very obvious reason would be that there's no NAT involved and those two computers use different routable IP's, another explanation could be the use of a proxy farm which uses different IP's for its outbound connections. Without any more details on the local IPs, the IPs shown in these tests and the actual network configuration it's mostly guessing though.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.