NAT 和 Proxy区别

在我学习LVS-NAT的时候突然意识到Reverse Proxy服务在Loadbalancing中的行为似乎是相同的。于是尝试理解这俩东西的相同点和不同点

Network Address Translation (NAT)Proxy Server
PurposeNAT is primarily used to enable multiple devices within a local network to share a single public IP address for communication with external networks, such as the internet. It allows private IP addresses used within the local network to be translated into a single public IP address when communicating externally.A proxy server acts as an intermediary between client devices (such as computers or smartphones) and external servers (e.g., web servers). It serves requests on behalf of clients and forwards the responses back to them.
LayerNAT operates at the network layer (Layer 3) of the OSI model. It deals with IP addresses and port numbers in packet headers.Proxy servers operate at the application layer (Layer 7) of the OSI model. They are application-aware and can inspect and manipulate data at the application level.
FunctionalityNAT modifies the source or destination IP address and/or port number of packets as they pass through a NAT device. It helps conserve IPv4 addresses, enhances network security by hiding internal IP addresses, and allows multiple devices to share a limited number of public IP addresses.Proxies can intercept, filter, cache, and modify requests and responses based on various criteria, including content type, URL, and user permissions. They are often used for content filtering, load balancing, security, and anonymity.
Typical Use CasesHome routers often use NAT to allow multiple devices in a home network to share a single internet connection. NAT is also used in corporate networks to provide internal users with internet access through a limited number of public IP addresses.Web proxies are commonly used to cache web content, filter out malicious websites, and improve network performance. Reverse proxies are used to distribute client requests across multiple backend servers, improve security, and provide SSL termination.

In summary:
NAT作为更低层的方法,在使用层面上更加直接,不用在software层面上进行更多的配置。
https://blog.51cto.com/u_13719714/2172665
这篇博客介绍了LVS-NAT的原理。

转载: https://support.huawei.com/enterprise/en/knowledge/KB1000081311/#:~:text=What%20Are%20Differences%20Between%20NAT%20and%20Proxy%3F&text=Both%20NAT%20and%20proxy%20provide,proxy%20at%20the%20application%20layer.

Both NAT and proxy provide Internet access through private IP
addresses.

These two technologies differ in their positions in the TCP/IP
protocol stack. NAT works at the network layer while proxy at the
application layer. NAT is transparent to various applications, whereas
proxy must resort to the IP address of the proxy server specified in
application programs. For example, to access a web page by using NAT,
no configuration is required in the browser. To access a web page by
using a proxy, you must specify the IP address of the proxy in the
browser. If the proxy supports only HTTP, only web servers can be
accessed through the proxy, but not FTP. In terms of Internet access,
NAT delivers higher scalability than proxy, because NAT is not
targeted at applications.

However, NAT cannot provide user name- and password-based
authentication. The proxy supports authentication. In this way, only
the users that are authenticated on the basis of their user names and
passwords are allowed to access the Internet.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值