Linux Networking & TCP/IP for Developers · 강의

네트워크 주소 변환(NAT)

다양한 NAT 유형과 IPv4 주소를 절약하고 네트워크 보안을 제공하는 NAT의 역할을 살펴봅니다.

레슨 3/412개 단계

네트워크 주소 변환(NAT)은(는) CoddyKit의 무료 Linux Networking & TCP/IP for Developers 강의입니다. 이것은 4개 중 3번째 강의입니다. 아래에서 전체 강의를 무료로 읽을 수 있으며, 내장 코드 에디터와 24/7 AI 튜터와 함께 브라우저에서 직접 실습할 수 있습니다. 이 강의는 Linux Networking & TCP/IP for Developers 학습 경로의 일부이며, 진행 상황이 웹과 CoddyKit 앱에 동기화됩니다. Linux Networking & TCP/IP for Developers 강의에는 총 4개의 강의가 포함되어 있습니다.

이 강의의 일부는 아직 번역되지 않았으며 영어로 표시됩니다.

What is Network Address Translation?

Welcome to the lesson on Network Address Translation (NAT)! NAT is a crucial technique used in computer networking, especially with IPv4.

Think of NAT as a clever translator for network addresses. It allows devices on a private network to communicate with the internet using a single public IP address.

Why NAT is Essential for IPv4

The main reason NAT became so important is the limited supply of IPv4 addresses. There simply aren't enough unique public IPv4 addresses for every device in the world.

  • IPv4 Conservation: NAT helps conserve public IPv4 addresses by allowing many private devices to share one.
  • Network Isolation: It also adds a layer of security by hiding the internal network structure from the outside world.

Private vs. Public IP Addresses

To understand NAT, you need to know about private and public IP addresses:

  • Private IPs: Used within a local network (e.g., your home or office). They are not routable on the internet. Examples: 192.168.1.10, 10.0.0.5.
  • Public IPs: Unique, globally routable addresses used on the internet. Your home router gets one from your Internet Service Provider (ISP).

NAT bridges these two worlds.

How NAT Works: The Core Idea

Imagine your router as a post office. When a letter (data packet) leaves your house (private network) for the outside world (internet), the post office changes the return address to its own (public IP).

When a reply comes back, the post office knows which house (private IP) to send it to. This is the basic idea behind NAT: translating addresses at the network boundary.

Source NAT (SNAT): Outbound Traffic

Source NAT (SNAT) is used for outbound connections, meaning when devices inside your private network want to reach the internet.

When a packet leaves your private network, the router changes the packet's source IP address from a private one to the router's public IP address. This is often called IP Masquerading.

SNAT Example: Accessing the Web

Here's how SNAT works when your laptop browses a website:

  1. Your laptop (192.168.1.10) sends a request to a website.
  2. Your router intercepts it, changes the source IP to its public IP (e.g., 203.0.113.5), and sends it to the internet.
  3. The website replies to 203.0.113.5.
  4. Your router receives the reply and translates the destination IP back to 192.168.1.10, forwarding it to your laptop.

Destination NAT (DNAT): Inbound Traffic

Destination NAT (DNAT), also known as Port Forwarding, is used for inbound connections. It allows external devices to connect to specific services running on a private device.

When a packet arrives from the internet, the router changes the packet's destination IP address from its public IP to a specific private IP and port within the network.

DNAT Example: Hosting a Game Server

If you host a game server on your PC (192.168.1.100) and want friends to connect:

  1. Your friend connects to your router's public IP (e.g., 203.0.113.5) on a specific port (e.g., 25565).
  2. Your router has a DNAT rule: any traffic to 203.0.113.5:25565 should be forwarded to 192.168.1.100:25565.
  3. The router translates the destination and sends the packet to your game server.
  4. The server's replies are then SNAT'd back out to your friend.

PAT: Port Address Translation

Most home routers use a type of NAT called Port Address Translation (PAT), also known as NAPT or IP Masquerading.

PAT allows multiple devices on a private network to share a single public IP address simultaneously. It does this by using different source port numbers for each outgoing connection to keep track of which internal device gets which incoming reply.

NAT's Security and Limitations

While NAT is great for address conservation and offers a basic security layer by hiding internal IPs, it's not a firewall:

  • Security: Hides internal network topology, making direct attacks harder.
  • Limitations: Can complicate peer-to-peer applications and some VPNs, as it breaks end-to-end connectivity. IPv6 aims to solve address scarcity without NAT.

Quick Check: Understanding NAT

Which type of NAT is primarily used to allow multiple internal devices to share a single public IP address when accessing the internet, often by modifying port numbers?

Recap: NAT's Role in Networking

We've explored Network Address Translation (NAT) and its vital role in modern networking. You now understand:

  • Why NAT is crucial for conserving IPv4 addresses.
  • The difference between private and public IP addresses.
  • How Source NAT (SNAT) handles outbound traffic.
  • How Destination NAT (DNAT) enables inbound access (port forwarding).
  • The common use of Port Address Translation (PAT) to share a single public IP.

NAT is a fundamental concept that enables the internet as we know it today!

무료로 시작

AI 튜터와 함께 Linux Networking & TCP/IP for Developers을(를) 배우세요 — 무료

브라우저에서 실제 코드를 작성하고 실행하며, 24/7 AI 튜터로부터 즉각적인 도움을 받고, 웹이나 앱에서 중단한 부분부터 계속 학습하세요.

코스
12
레슨
48

자주 묻는 질문

“네트워크 주소 변환(NAT)” 강의는 무료인가요?

네 — “네트워크 주소 변환(NAT)” 전체 내용을 이 웹사이트에서 무료로 읽을 수 있습니다. 인터랙티브하게 실습하려면(내장 코드 에디터와 24/7 AI 튜터), CoddyKit PRO로 업그레이드하면 Linux Networking & TCP/IP for Developers 강의 전체를 잠금 해제할 수 있습니다. Linux Networking & TCP/IP for Developers 강의에는 총 4개의 강의가 포함되어 있습니다.

“네트워크 주소 변환(NAT)”에서 뭘 배우나요?

다양한 NAT 유형과 IPv4 주소를 절약하고 네트워크 보안을 제공하는 NAT의 역할을 살펴봅니다. 브라우저에서 직접 실행하는 실습 코드로 Linux Networking & TCP/IP for Developers을(를) 배우며, 24/7 AI 튜터가 강의를 진행하면서 질문에 답변해줍니다.

Linux Networking & TCP/IP for Developers을(를) 시작하는 데 경험이 필요한가요?

사전 경험은 필요하지 않습니다. CoddyKit의 Linux Networking & TCP/IP for Developers은(는) 초급자부터 고급 학습자까지를 위해 구성되어 있으므로, 여기서 시작하거나 처음부터 시작할 수 있으며 자신의 속도대로 진행할 수 있습니다. 이것은 4개 중 3번째 강의입니다.

“네트워크 주소 변환(NAT)” 강의는 얼마나 걸리나요?

대부분의 CoddyKit 강의는 약 5~10분이 소요됩니다. 각 강의는 간결하고 인터랙티브하여 꾸준한 진행이 가능하며, 웹과 앱에서 중단한 부분부터 바로 시작할 수 있습니다.

이 Linux Networking & TCP/IP for Developers 강의에서 코드를 작성하고 실행할 수 있나요?

네. 모든 Linux Networking & TCP/IP for Developers 강의에는 내장 코드 에디터가 포함되어 있으므로, 브라우저에서 바로 실제 코드를 작성하고 실행한 후 즉시 AI 피드백을 받을 수 있습니다 — 로컬 설정이 필요 없습니다.

이 강의의 모든 강의

  1. IPv6 주소 지정 및 개념
  2. 고급 라우팅 프로토콜(RIP/OSPF)
  3. 네트워크 주소 변환(NAT)
  4. 서브넷 분할 및 CIDR 심화
← Linux Networking & TCP/IP for Developers(으)로 돌아가기