{"id":2501,"date":"2025-11-21T13:22:33","date_gmt":"2025-11-21T12:22:33","guid":{"rendered":"https:\/\/alessandromasciadri.com\/?p=2501"},"modified":"2026-02-04T21:32:24","modified_gmt":"2026-02-04T20:32:24","slug":"come-incapsulare-il-traffico-openvpn-dentro-un-proxy-socks","status":"publish","type":"post","link":"https:\/\/alessandromasciadri.com\/come-incapsulare-il-traffico-openvpn-dentro-un-proxy-socks\/","title":{"rendered":"Come incapsulare il traffico OpenVPN dentro un proxy SOCKS"},"content":{"rendered":"\t\t<div data-akihiro-type=\"ama-post\" data-akihiro-id=\"2501\" class=\"akihiro akihiro-2501\" data-akihiro-post-type=\"post\">\n\t\t\t\t<div class=\"akihiro-element akihiro-element-d0e15c7 e-flex e-con-boxed e-con e-parent\" data-id=\"d0e15c7\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"akihiro-element akihiro-element-8b5d467 akihiro-widget akihiro-widget-text-editor\" data-id=\"8b5d467\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"akihiro-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>In questo articolo abbiamo visto come configurare uno Shadowsocks server e come instradare il nostro traffico internet attraverso di esso.<\/p><p>In determinate circostanze, pu\u00f2 essere necessario incapsulare il traffico di OpenVPN dentro Shadowsocks. In questa guida vediamo come raggiungere questo obiettivo.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"akihiro-element akihiro-element-68f3632 akihiro-widget akihiro-widget-heading\" data-id=\"68f3632\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"akihiro-widget-container\">\n\t\t\t\t\t<h3 class=\"akihiro-heading-title akihiro-size-default\">Il necessario<\/h3>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"akihiro-element akihiro-element-e52cba8 akihiro-widget akihiro-widget-text-editor\" data-id=\"e52cba8\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"akihiro-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>Quello di cui abbiamo bisogno \u00e8:<\/p><ul><li>Server OpenVPN<\/li><li>VPS con Shadowsocks<\/li><li>Macchina con client Shadowsocks<\/li><li>Client OpenVPN<\/li><\/ul>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"akihiro-element akihiro-element-40a57b0 akihiro-widget akihiro-widget-text-editor\" data-id=\"40a57b0\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"akihiro-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>Per descrivere un caso tipico potremmo dire che il server OpenVPN si trova in azienda, la VPS con Shadowsocks si trova su un nostro cloud provider, la macchina con client Shadowsocks e client OpenVPN si trova nella nostra LAN di casa.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"akihiro-element akihiro-element-e14c42f akihiro-widget akihiro-widget-heading\" data-id=\"e14c42f\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"akihiro-widget-container\">\n\t\t\t\t\t<h3 class=\"akihiro-heading-title akihiro-size-default\">Modificare il file di configurazione OpenVPN<\/h3>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"akihiro-element akihiro-element-93e9deb akihiro-widget akihiro-widget-text-editor\" data-id=\"93e9deb\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"akihiro-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>Diamo per scontato che sia la VPN che il server Shadowsocks sono correttamente configurati e funzionanti. Come prima cosa aggiungiamo queste righe al nostro file di configurazione client.ovpn<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"akihiro-element akihiro-element-94f7d4c akihiro-widget akihiro-widget-code-highlight\" data-id=\"94f7d4c\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"akihiro-widget-container\">\n\t\t\t\t\t\t\t<div class=\"prismjs-tomorrow copy-to-clipboard \">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language- \">\n\t\t\t\t<code readonly=\"true\" class=\"language-\">\n\t\t\t\t\t<xmp>socks-proxy-retry\nsocks-proxy 192.168.1.155 1080<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"akihiro-element akihiro-element-a18f676 akihiro-widget akihiro-widget-text-editor\" data-id=\"a18f676\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"akihiro-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>L&#8217;indirizzo IP 192.168.1.155 corrisponde alla macchina su cui gira il client Shadowsocks.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"akihiro-element akihiro-element-519b5b3 akihiro-widget akihiro-widget-text-editor\" data-id=\"519b5b3\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"akihiro-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>Cerchiamo di capire cosa fanno esattamente queste due direttive.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"akihiro-element akihiro-element-5a3231a akihiro-widget akihiro-widget-text-editor\" data-id=\"5a3231a\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"akihiro-widget-container\">\n\t\t\t\t\t\t\t\t\t<p><strong>1. socks-proxy 192.168.1.155 1080<\/strong><\/p><p>Questa riga dice a OpenVPN client:<\/p><blockquote><p>\u201cNon collegarti direttamente al server OpenVPN, ma passa prima attraverso un proxy SOCKS all\u2019indirizzo 192.168.1.155:1080.\u201d<\/p><\/blockquote><p>In pratica:<\/p><p>client OpenVPN \u2192 SOCKS proxy (Shadowsocks client) \u2192 Internet \u2192 server OpenVPN<\/p><p>OpenVPN non &#8220;vede&#8221; pi\u00f9 Internet direttamente, ma solo il proxy<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"akihiro-element akihiro-element-3a13798 akihiro-widget akihiro-widget-text-editor\" data-id=\"3a13798\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"akihiro-widget-container\">\n\t\t\t\t\t\t\t\t\t<p><strong>2. socks-proxy-retry<\/strong><\/p><p>Questa opzione dice:<\/p><blockquote><p>\u201cSe il proxy SOCKS non \u00e8 subito disponibile, ritenta invece di fallire l\u2019avvio della VPN.\u201d<\/p><\/blockquote><p>Questa opzione \u00e8 particolarmente importante se il nostro client OpenVPN risiede sul router perch\u00e9:<\/p><ul><li>al boot il proxy pu\u00f2 partire dopo OpenVPN<\/li><li>evita che la VPN resti gi\u00f9 finch\u00e9 non riavvii manualmente<\/li><\/ul>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>In questo articolo abbiamo visto come configurare uno Shadowsocks server e come instradare il nostro traffico internet attraverso di esso. In determinate circostanze, pu\u00f2 essere necessario incapsulare il traffico di OpenVPN dentro Shadowsocks. In questa guida vediamo come raggiungere questo obiettivo. Il necessario Quello di cui abbiamo bisogno \u00e8: Server OpenVPN VPS con Shadowsocks Macchina [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[62,57],"class_list":["post-2501","post","type-post","status-publish","format-standard","hentry","category-sistemistica","tag-openvpn","tag-shadowsocks"],"_links":{"self":[{"href":"https:\/\/alessandromasciadri.com\/ama-json\/wp\/v2\/posts\/2501","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/alessandromasciadri.com\/ama-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/alessandromasciadri.com\/ama-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/alessandromasciadri.com\/ama-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/alessandromasciadri.com\/ama-json\/wp\/v2\/comments?post=2501"}],"version-history":[{"count":11,"href":"https:\/\/alessandromasciadri.com\/ama-json\/wp\/v2\/posts\/2501\/revisions"}],"predecessor-version":[{"id":2526,"href":"https:\/\/alessandromasciadri.com\/ama-json\/wp\/v2\/posts\/2501\/revisions\/2526"}],"wp:attachment":[{"href":"https:\/\/alessandromasciadri.com\/ama-json\/wp\/v2\/media?parent=2501"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/alessandromasciadri.com\/ama-json\/wp\/v2\/categories?post=2501"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/alessandromasciadri.com\/ama-json\/wp\/v2\/tags?post=2501"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}