← Documents Documentation/networking/ip_dynaddr.rst GitHub 원문 ↗

Linux 6.18.37 · Networking

IP dynamic address hack-port v0.03

자동 dial-up 링크의 주소가 뒤늦게 정해질 때 SYN 재전송과 masquerade packet의 source 주소를 갱신하는 legacy sysctl을 설명합니다.

Source pathDocumentation/networking/ip_dynaddr.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

요약·해설

ip_dynaddr.rst:1-40

링크를 깨운 최초 연결이 예전 또는 미정 source 주소 때문에 실패하지 않도록 재전송 시점에 실제 interface 주소로 보정하는 기능입니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 .. SPDX-License-Identifier: GPL-2.0
2
3 ==================================
4 IP dynamic address hack-port v0.03
5 ==================================
6
7 This stuff allows diald ONESHOT connections to get established by
8 dynamically changing packet source address (and socket's if local procs).
9 It is implemented for TCP diald-box connections(1) and IP_MASQuerading(2).
10
11 If enabled\ [#]_ and forwarding interface has changed:
12
13 1) Socket (and packet) source address is rewritten ON RETRANSMISSIONS
14 while in SYN_SENT state (diald-box processes).
15 2) Out-bounded MASQueraded source address changes ON OUTPUT (when
16 internal host does retransmission) until a packet from outside is
17 received by the tunnel.
18
19 This is specially helpful for auto dialup links (diald), where the
20 ``actual`` outgoing address is unknown at the moment the link is
21 going up. So, the *same* (local AND masqueraded) connections requests that
22 bring the link up will be able to get established.
23
24 .. [#] At boot, by default no address rewriting is attempted.
25
26 To enable::
27
28 # echo 1 > /proc/sys/net/ipv4/ip_dynaddr
29
30 To enable verbose mode::
31
32 # echo 2 > /proc/sys/net/ipv4/ip_dynaddr
33
34 To disable (default)::
35
36 # echo 0 > /proc/sys/net/ipv4/ip_dynaddr
37
38 Enjoy!
39
41

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

동적 주소 재작성

1-24

이 기능은 diald ONESHOT 연결이 올라오는 동안 packet source address와 로컬 프로세스 소켓 주소를 동적으로 바꿔 최초 연결 요청이 성립하도록 합니다. TCP diald box 연결과 IP masquerading에 구현되어 있습니다.

기능이 켜져 있고 forwarding interface 주소가 바뀌면 `SYN_SENT` 상태의 재전송에서 로컬 socket과 packet source address를 다시 씁니다. Masquerade된 outbound 연결은 내부 host가 재전송할 때마다 터널에서 외부 packet을 처음 받을 때까지 output source address를 새 값으로 바꿉니다.

자동 dial-up 링크는 연결을 올리는 순간 실제 outbound 주소를 모를 수 있습니다. 동적 재작성 덕분에 링크를 깨운 바로 그 로컬 또는 masquerade 연결 요청이 새 주소로 재전송되어 계속 성립할 수 있습니다. 부팅 기본값은 재작성 비활성화입니다.

Dial-up 주소 전환
최초 SYNdiald가 링크 시작outgoing 주소 확정SYN 재전송source 주소 재작성연결 성립

주소를 모르고 보낸 최초 SYN이 새 인터페이스 주소를 따라가는 과정입니다.

.. SPDX-License-Identifier: GPL-2.0

==================================
IP dynamic address hack-port v0.03
==================================

This stuff allows diald ONESHOT connections to get established by
dynamically changing packet source address (and socket's if local procs).
It is implemented for TCP diald-box connections(1) and IP_MASQuerading(2).

If enabled\ [#]_ and forwarding interface has changed:

  1)  Socket (and packet) source address is rewritten ON RETRANSMISSIONS
      while in SYN_SENT state (diald-box processes).
  2)  Out-bounded MASQueraded source address changes ON OUTPUT (when
      internal host does retransmission) until a packet from outside is
      received by the tunnel.

This is specially helpful for auto dialup links (diald), where the
``actual`` outgoing address is unknown at the moment the link is
going up. So, the *same* (local AND masqueraded) connections requests that
bring the link up will be able to get established.

.. [#] At boot, by default no address rewriting is attempted.

sysctl 제어

25-40

`/proc/sys/net/ipv4/ip_dynaddr`에 1을 쓰면 기능을 활성화하고, 2를 쓰면 verbose mode로 활성화합니다. 0을 쓰면 비활성화하며 이것이 기본값입니다. 문서는 Juanjo가 작성했습니다.

ip_dynaddr 값
동작
0비활성화(기본값)
1동적 source address 재작성
2재작성 + verbose logging

sysctl 값에 따른 동작입니다.


  To enable::

     # echo 1 > /proc/sys/net/ipv4/ip_dynaddr

  To enable verbose mode::

    # echo 2 > /proc/sys/net/ipv4/ip_dynaddr

  To disable (default)::

     # echo 0 > /proc/sys/net/ipv4/ip_dynaddr

Enjoy!

Juanjo  <[email protected]>