{"id":272,"date":"2025-12-01T01:17:45","date_gmt":"2025-11-30T17:17:45","guid":{"rendered":"https:\/\/gri.my\/blog\/?p=272"},"modified":"2025-12-01T01:17:45","modified_gmt":"2025-11-30T17:17:45","slug":"exposing-an-openvpn-tunnel-as-a-socks5-proxy","status":"publish","type":"post","link":"https:\/\/gri.my\/blog\/exposing-an-openvpn-tunnel-as-a-socks5-proxy\/","title":{"rendered":"Exposing an OpenVPN tunnel as a SOCKS5 proxy"},"content":{"rendered":"\n<p>This took me way too long to figure out. For a usecase that should be very common I couldn&#8217;t find any tutorial on how to do this simple thing. <\/p>\n\n\n\n<p>This tutorial assumes you have a Debian box and has a working and active <code><strong>tun0<\/strong><\/code>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Setup 3proxy<\/h2>\n\n\n\n<p>3proxy is a tiny (200Kbytes) standalone proxy server packing tons of protocols, including SOCKS. This software is as good as it gets, everything else either bloats the stack to oblivion or doesn&#8217;t work (dante-server).<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Download 3proxy<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\ncurl -L https:\/\/github.com\/3proxy\/3proxy\/releases\/download\/0.9.5\/3proxy-0.9.5.x86_64.deb -O\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\">Install 3proxy<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\napt install .\/3proxy-0.9.5.x86_64.deb\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\">Edit 3proxy config<\/h3>\n\n\n\n<p>Edit \/usr\/local\/3proxy\/conf\/3proxy.cfg<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nnscache 65536\nnserver 8.8.8.8\nnserver 8.8.4.4\n\nlog \/logs\/log D\nconfig \/conf\/3proxy.cfg\nmonitor \/conf\/3proxy.cfg\n\nrotate 60\ncounter \/count\/3proxy.3cf\n\ninclude \/conf\/counters\ninclude \/conf\/bandlimiters\n\nauth none\ndeny * * 127.0.0.1\nallow *\n\nsocks -u -p25344 -Dieth0 -Dotun0\n\nflush\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\">Run 3proxy<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nsystemctl enable 3proxy\nsystemctl restart 3proxy\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\">Test connection<\/h2>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\ncurl -L -ipv4 -x socks5:\/\/192.168.1.51:25344 gri.my\/ip\n<\/pre><\/div>\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This took me way too long to figure out. For a usecase that should be very common I couldn&#8217;t find any tutorial on how to do this simple thing. This tutorial assumes you have a&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-272","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/gri.my\/blog\/wp-json\/wp\/v2\/posts\/272","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gri.my\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gri.my\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gri.my\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gri.my\/blog\/wp-json\/wp\/v2\/comments?post=272"}],"version-history":[{"count":3,"href":"https:\/\/gri.my\/blog\/wp-json\/wp\/v2\/posts\/272\/revisions"}],"predecessor-version":[{"id":275,"href":"https:\/\/gri.my\/blog\/wp-json\/wp\/v2\/posts\/272\/revisions\/275"}],"wp:attachment":[{"href":"https:\/\/gri.my\/blog\/wp-json\/wp\/v2\/media?parent=272"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gri.my\/blog\/wp-json\/wp\/v2\/categories?post=272"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gri.my\/blog\/wp-json\/wp\/v2\/tags?post=272"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}