UDP 세션 용 일반 DTLS 래퍼. stunnel 처럼 UDP를위한 것입니다. Wireguard 또는 UDP OpenVPN 또는 기타 연결 지향 UDP 세션을 포장하는 데 적합합니다.
"클라이언트"는 가장 유명한 UDP 트래픽을 받고 암호화 된 DTLS 연결을 통해 "서버"로 전달합니다. "Server"는 UDP 포트를 듣고 암호화 된 DTLS 세션을 허용하고 각 세션에서 메시지를 일반 텍스트 UDP 포트에 별도의 UDP 연결로 전달합니다.
사전 제작 된 이진은 여기에서 제공됩니다.
또는 소스에서 dtlspipe를 설치할 수 있습니다. 소스 디렉토리에서 다음 명령을 실행하십시오.
make install
다음 설정이 있다고 가정 해 봅시다. Port 514에서 공개 IP 주소 203.0.113.11이있는 서버가 있으며,이 서비스에 안전하게 액세스 하고이 서비스간에 UDP 데이터 그램이 암호화되고 인증 된 상태에서 UDP 데이터 그램이 있습니다.
dtlspipe genpsk 로 사전 공유 키를 생성하십시오dtlspipe -psk xxxxxxxxxxxx server 0.0.0.0:2815 127.0.0.1:514dtlspipe -psk xxxxxxxxxxxx client 127.0.0.1:2816 203.0.113.11:2815203.0.113.11:514 대신 주소 127.0.0.1:2816 사용하십시오.몇 가지 메모 :
127.0.0.1 도 선택 사항이며 LocalHost의 포트 액세스를 제한하는 데 사용됩니다. 0.0.0.0 사용하여 외부에서 네트워크 액세스를 허용하십시오.DTLSPIPE_PSK 환경 변수를 통해 지정할 수도 있습니다.DTLSpipe 설정은 일반적인 케이스의 예제를 사용하여 수행 할 수 있지만보다 구체적으로 DTLSpipe 서버는 Wireguard Server 포트를 가리켜 야하며 Wireguard Client는 DTLSpipe 클라이언트의 포트와 통신해야합니다.
Wireguard 클라이언트 구성에 따라 다음을 조정해야합니다.
[Peer] 섹션에 MTU = 1280 추가하십시오.AllowedIPs 에서 DTLSpipe 서버 주소를 제외하십시오. 이 계산기가 도움이 될 수 있습니다. 서버 주소 예제 203.0.113.11 : AllowedIPs = 0.0.0.0/1, 128.0.0.0/2, 192.0.0.0/5, 200.0.0.0/7, 202.0.0.0/8, 203.0.0.0/18, 203.0.64.0/19, 203.0.96.0/20, 203.0.112.0/24, 203.0.113.0/29, 203.0.113.8/31, 203.0.113.10/32, 203.0.113.12/30, 203.0.113.16/28, 203.0.113.32/27, 203.0.113.64/26, 203.0.113.128/25, 203.0.114.0/23, 203.0.116.0/22, 203.0.120.0/21, 203.0.128.0/17, 203.1.0.0/16, 203.2.0.0/15, 203.4.0.0/14, 203.8.0.0/13, 203.16.0.0/12, 203.32.0.0/11, 203.64.0.0/10, 203.128.0.0/9, 204.0.0.0/6, 208.0.0.0/4, 224.0.0.0/3, ::/0
DTLSPIPE 서버는 일부 DPI 시스템을 해결하기 위해 기본적으로 메시지를 기본적으로 건너 뜁니다. 일부 DOS 보안 위험과 관련이 있습니다. 서버 옵션 -skip-hello-verify=false 추가하십시오. 그러한 동작이 바람직하지 않은 경우. 또는 이러한 위험은 방화벽으로 완화 될 수 있으며, 서버 포트에서 세션을 제한합니다.
$ dtlspipe -h
Usage:
dtlspipe [OPTION]... server <BIND ADDRESS> <REMOTE ADDRESS>
Run server listening on BIND ADDRESS for DTLS datagrams and forwarding decrypted UDP datagrams to REMOTE ADDRESS.
dtlspipe [OPTION]... client <BIND ADDRESS> <REMOTE ADDRESS>
Run client listening on BIND ADDRESS for UDP datagrams and forwarding encrypted DTLS datagrams to REMOTE ADDRESS.
dtlspipe [OPTION]... hoppingclient <BIND ADDRESS> <ENDPOINT GROUP> [ENDPOINT GROUP]...
Run client listening on BIND ADDRESS for UDP datagrams and forwarding encrypted DTLS datagrams to a random chosen endpoints.
Endpoints are specified by a list of one or more ENDPOINT GROUP. ENDPOINT GROUP syntax is defined by following ABNF:
ENDPOINT-GROUP = address-term *( "," address-term ) ":" Port
address-term = Domain / IP-range / IP-prefix / IP-address
Domain = <Defined in Section 4.1.2 of [RFC5321]>
IP-range = ( IPv4address ".." IPv4address ) / ( IPv6address ".." IPv6address )
IP-prefix = IP-address "/" 1*DIGIT
IP-address = IPv6address / IPv4address
IPv4address = <Defined in Section 4.1 of [RFC5954]>
IPv6address = <Defined in Section 4.1 of [RFC5954]>
Endpoint is chosen randomly as follows.
First, random ENDPOINT GROUP is chosen with equal probability.
Next, address is chosen from address sets specified by that group, with probability
proportional to size of that set. Domain names and single addresses condidered
as sets having size 1, ranges and prefixes have size as count of addresses in it.
Example: 'example.org:20000-50000' '192.168.0.0/16,10.0.0.0/8,172.16.0.0-172.31.255.255:50000-60000'
dtlspipe [OPTION]... genpsk
Generate and output PSK.
dtlspipe ciphers
Print list of supported ciphers and exit.
dtlspipe curves
Print list of supported elliptic curves and exit.
dtlspipe version
Print program version and exit.
Options:
-cid
enable connection_id extension (default true)
-ciphers value
colon-separated list of ciphers to use
-cpuprofile string
write cpu profile to file
-curves value
colon-separated list of curves to use
-identity string
client identity sent to server
-idle-time duration
max idle time for UDP session (default 30s)
-key-length uint
generate key with specified length (default 16)
-mtu int
MTU used for DTLS fragments (default 1400)
-psk string
hex-encoded pre-shared key. Can be generated with genpsk subcommand
-rate-limit value
limit for incoming connections rate. Format: <limit>/<time duration> or empty string to disable (default 20/1m0s)
-skip-hello-verify
(server only) skip hello verify request. Useful to workaround DPI (default true)
-stale-mode value
which stale side of connection makes whole session stale (both, either, left, right) (default either)
-time-limit duration
limit for each session duration. Use single value X for fixed limit or range X-Y for randomized limit
-timeout duration
network operation timeout (default 10s)