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