2

https://en.wikipedia.org/wiki/Virtual_private_network

A virtual private network (VPN) extends a private network across a public network, and enables users to send and receive data across shared or public networks as if their computing devices were directly connected to the private network.

Are both VPN and NAT alternative ways to provide access to a private network?

Does NAT provide access to only individual hosts in a private network instead of the private network itself?

2 Answers 2

5

Both VPN and (destination) NAT may be used in that way.

Usually, VPN is used when there's a need to access a network, secure all communication, and there's only a limited number of endpoints. VPN tunneling allows you to transparently use private IP addresses across a public IP route (by encapsulating the private IP packets in public IP packets).

Destination NAT is used to expose a service to the Internet for IPv4. Essentially, you map a public IP address to a private IP address, often limited to a single transport-layer port number, ie. service. It's possible to map a number of ports (or even all) to a single host but mapping to different private IP addresses is limited - you can only map each IP:L4proto:port tuple to one host.

4

Are both VPN and NAT alternative ways to provide access to a private network?

No. VPN is a technology to tunnel a private network over a insecure network. NAT is a technique that rewrites IP headers in some fashion. The use that is probably most familiar to most users is source translation, which lets multiple IPv4 computers share one public IP address on a router. Other variants rewrite other parts, such as destination or port.

Does NAT provide access to only individual hosts in a private network instead of the private network itself?

Depends. You can do translation for entire subnets if you want, and in some situations this may be desirable. But it has nothing to do with security or private networks; it's a network technology that lets you rewrite IP packets. VPN on the other hand transports (encapsulates) IP packets in another (commonly IP) packet, and sends it off, and unpacks it and injects it into the network stack on the other end of the tunnel.

1
  • 2
    "NAT is a technique to let multiple computers share a common IPv4 address via rewriting of IP headers by a router." That is only one version of NAT, called NAPT.
    – Ron Maupin
    Commented Mar 15, 2019 at 14:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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