<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
    <channel>
      <title>~&#x2F;magostinelli - tunnel</title>
      <link>https://www.agostinelli.eu</link>
      <description>La casa delle mie passioni</description>
      <generator>Zola</generator>
      <language>it</language>
      <atom:link href="https://www.agostinelli.eu/tags/tunnel/rss.xml" rel="self" type="application/rss+xml"/>
      <lastBuildDate>Sun, 28 Jan 2024 00:00:00 +0000</lastBuildDate>
      <item>
          <title>Wireguard - VPN per tutti</title>
          <pubDate>Sun, 28 Jan 2024 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://www.agostinelli.eu/blog/wireguard-vpn-per-tutti/</link>
          <guid>https://www.agostinelli.eu/blog/wireguard-vpn-per-tutti/</guid>
          <description xml:base="https://www.agostinelli.eu/blog/wireguard-vpn-per-tutti/">&lt;h2 id=&quot;definizione&quot;&gt;&lt;a class=&quot;header-anchor no-hover-padding&quot; href=&quot;#definizione&quot; aria-label=&quot;Anchor link for: definizione&quot;&gt;&lt;span class=&quot;link-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;&#x2F;span&gt;&lt;&#x2F;a&gt;
Definizione&lt;&#x2F;h2&gt;
&lt;p&gt;WireGuard è un programma &lt;strong&gt;open source&lt;&#x2F;strong&gt; che implementa una connessione &lt;strong&gt;VPN&lt;&#x2F;strong&gt; per creare connessioni sicure punto-punto&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;https:&#x2F;&#x2F;img.agostinelli.eu&#x2F;2024&#x2F;Logo_of_WireGuard.svg&quot; alt=&quot;Wireguard Logo&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
&lt;h2 id=&quot;a-cosa-serve&quot;&gt;&lt;a class=&quot;header-anchor no-hover-padding&quot; href=&quot;#a-cosa-serve&quot; aria-label=&quot;Anchor link for: a-cosa-serve&quot;&gt;&lt;span class=&quot;link-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;&#x2F;span&gt;&lt;&#x2F;a&gt;
A cosa serve?&lt;&#x2F;h2&gt;
&lt;p&gt;Sicuramente avrete già sentito parlare di vpn, qualora ne siate a digiuno provo a scriverlo brevemente. Attivando questa connessione tra due dispositivi, collegati entrambi alla rete internet, permette loro, in modo &lt;strong&gt;sixuro&lt;&#x2F;strong&gt;,  di comunicare tra di loro.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;vantaggi&quot;&gt;&lt;a class=&quot;header-anchor no-hover-padding&quot; href=&quot;#vantaggi&quot; aria-label=&quot;Anchor link for: vantaggi&quot;&gt;&lt;span class=&quot;link-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;&#x2F;span&gt;&lt;&#x2F;a&gt;
Vantaggi&lt;&#x2F;h2&gt;
&lt;p&gt;Wireguard si distingue da altri programmi simili per la sua leggerezza, occupa pochissime risorse, e per le prestazioni.
Se lo provate, con una buona connessione da ambo i lati, vi sembrerà davvero di essere in rete locale.
La connessione tra i due punti è cifrata e quindi sicura.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;perche-usarlo&quot;&gt;&lt;a class=&quot;header-anchor no-hover-padding&quot; href=&quot;#perche-usarlo&quot; aria-label=&quot;Anchor link for: perche-usarlo&quot;&gt;&lt;span class=&quot;link-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;&#x2F;span&gt;&lt;&#x2F;a&gt;
Perché usarlo&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;Collegarsi alla propria rete domestica da fuori casa (senza esporre pubblicamente i servizi, ma solo la porta della vpn)&lt;&#x2F;li&gt;
&lt;li&gt;Amministrare &#x2F; gestire dispositivi di: amici &#x2F; parenti &#x2F; clienti&lt;&#x2F;li&gt;
&lt;li&gt;Condividere risorse locali solo con chi si vuole&lt;&#x2F;li&gt;
&lt;li&gt;Anonimato (navigare sul web come se fisicamente si ci trovasse nella rete del server vpn)&lt;&#x2F;li&gt;
&lt;li&gt;Sicurezza: se si è connessi ad una rete pubblica il nostro traffico sarà comunque cifrato&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;blocco pubblicità su smartphone&lt;&#x2F;strong&gt; se usato in accoppiata a #pihole (seguirà articolo dedicato)&lt;&#x2F;li&gt;
&lt;li&gt;Supporto dello &lt;strong&gt;split tunnel&lt;&#x2F;strong&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;caratteristiche&quot;&gt;&lt;a class=&quot;header-anchor no-hover-padding&quot; href=&quot;#caratteristiche&quot; aria-label=&quot;Anchor link for: caratteristiche&quot;&gt;&lt;span class=&quot;link-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;&#x2F;span&gt;&lt;&#x2F;a&gt;
Caratteristiche&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;Si basa su protocollo udp, e non tcp per avere prestazioni migliori&lt;&#x2F;li&gt;
&lt;li&gt;Disponibile per svariati sistemi operativi&lt;&#x2F;li&gt;
&lt;li&gt;Funziona su tutti i dispositivi mobili&lt;&#x2F;li&gt;
&lt;li&gt;Risorse richieste quasi nulle, funziona benissimo su vecchi pc o su #raspberrypi&lt;&#x2F;li&gt;
&lt;li&gt;Configurazione facile con un &lt;strong&gt;file unico&lt;&#x2F;strong&gt; (portatile)&lt;&#x2F;li&gt;
&lt;li&gt;Configurazione tramite &lt;strong&gt;qr code&lt;&#x2F;strong&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Possibilità di avere più &lt;strong&gt;vpn attive contemporaneamente&lt;&#x2F;strong&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;&lt;img src=&quot;https:&#x2F;&#x2F;img.agostinelli.eu&#x2F;2024&#x2F;wireguard-roadwarrior-splittunnel.png&quot; alt=&quot;Wireguard Connections&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
&lt;h2 id=&quot;creare-una-nuova-connessione&quot;&gt;&lt;a class=&quot;header-anchor no-hover-padding&quot; href=&quot;#creare-una-nuova-connessione&quot; aria-label=&quot;Anchor link for: creare-una-nuova-connessione&quot;&gt;&lt;span class=&quot;link-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;&#x2F;span&gt;&lt;&#x2F;a&gt;
Creare una nuova connessione&lt;&#x2F;h2&gt;
&lt;ol&gt;
&lt;li&gt;Installare il software&lt;&#x2F;li&gt;
&lt;li&gt;Scgliere una porta udp dedicata&lt;&#x2F;li&gt;
&lt;li&gt;Abllitare il forwarding della porta sul nostro router&lt;&#x2F;li&gt;
&lt;li&gt;Scelta di una subnet (dedicata)&lt;&#x2F;li&gt;
&lt;li&gt;Abilitare il forwarding dei pacchetti ip&lt;&#x2F;li&gt;
&lt;li&gt;Creare la configurazione&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h3 id=&quot;configurazione-manuale-da-riga-di-comando&quot;&gt;&lt;a class=&quot;header-anchor no-hover-padding&quot; href=&quot;#configurazione-manuale-da-riga-di-comando&quot; aria-label=&quot;Anchor link for: configurazione-manuale-da-riga-di-comando&quot;&gt;&lt;span class=&quot;link-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;&#x2F;span&gt;&lt;&#x2F;a&gt;
Configurazione manuale (da riga di comando)&lt;&#x2F;h3&gt;
&lt;p&gt;Di seguito vari comandi, divisi per argomento, che permettono di attivare la nostra prima vpn.
La preshared key &lt;strong&gt;non è obbligatoria&lt;&#x2F;strong&gt; ma se la si usa si renderà la connessione ancora piuù sicura.
Negli esempi sottostanti abbiamo scelto 92.168.20.0&#x2F;24 come subnet per la nostra vpn.&lt;&#x2F;p&gt;
&lt;h4 id=&quot;installazione-debian&quot;&gt;&lt;a class=&quot;header-anchor no-hover-padding&quot; href=&quot;#installazione-debian&quot; aria-label=&quot;Anchor link for: installazione-debian&quot;&gt;&lt;span class=&quot;link-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;&#x2F;span&gt;&lt;&#x2F;a&gt;
Installazione (debian)&lt;&#x2F;h4&gt;
&lt;pre class=&quot;z-code&quot;&gt;&lt;code&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;sudo apt update
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;sudo apt install wireguard
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;sudo vi &#x2F;etc&#x2F;sysctl.conf
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;	net.ipv4.ip_forward=1
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;sudo sysctl -p
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;h3 id=&quot;generazione-chiavi&quot;&gt;&lt;a class=&quot;header-anchor no-hover-padding&quot; href=&quot;#generazione-chiavi&quot; aria-label=&quot;Anchor link for: generazione-chiavi&quot;&gt;&lt;span class=&quot;link-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;&#x2F;span&gt;&lt;&#x2F;a&gt;
Generazione chiavi&lt;&#x2F;h3&gt;
&lt;p&gt;Le chiavi generate vanno sia per una configurazione come server che come client&lt;&#x2F;p&gt;
&lt;pre class=&quot;z-code&quot;&gt;&lt;code&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;umask 077
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;wg genkey &amp;gt; privatekey
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;wg pubkey &amp;lt; privatekey &amp;gt; publickey
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;wg genpsk &amp;gt; preshared.keys
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;h4 id=&quot;esempio-di-file-conf-del-server&quot;&gt;&lt;a class=&quot;header-anchor no-hover-padding&quot; href=&quot;#esempio-di-file-conf-del-server&quot; aria-label=&quot;Anchor link for: esempio-di-file-conf-del-server&quot;&gt;&lt;span class=&quot;link-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;&#x2F;span&gt;&lt;&#x2F;a&gt;
Esempio di file conf del server&lt;&#x2F;h4&gt;
&lt;pre class=&quot;z-code&quot;&gt;&lt;code&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;&#x2F;etc&#x2F;wireguard&#x2F;wg0.conf
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;[Interface]
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;PrivateKey = chiave_privata_server
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;Address = 192.168.20.1&#x2F;24
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;ListenPort = 52001
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;SaveConfig = true
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;PostUp = iptables -t nat -I POSTROUTING -o eth0 -j MASQUERADE
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;PreDown = iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;[Peer]
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;PublicKey = chiave_pub_client_1
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;PresharedKey = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;AllowedIPs = 192.168.20.2&#x2F;32
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;h4 id=&quot;esempio-di-file-conf-del-client&quot;&gt;&lt;a class=&quot;header-anchor no-hover-padding&quot; href=&quot;#esempio-di-file-conf-del-client&quot; aria-label=&quot;Anchor link for: esempio-di-file-conf-del-client&quot;&gt;&lt;span class=&quot;link-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;&#x2F;span&gt;&lt;&#x2F;a&gt;
Esempio di file conf del client&lt;&#x2F;h4&gt;
&lt;pre class=&quot;z-code&quot;&gt;&lt;code&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;[Interface]
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;PrivateKey = chiave_priv_client1
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;Address = 192.168.20.2&#x2F;24
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;[Peer]
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;PublicKey = chiave_pub_server
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;PresharedKey = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;AllowedIPs = 0.0.0.0&#x2F;0, ::&#x2F;0
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;Endpoint = hostname_pubblico_server:52001
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;h4 id=&quot;comandi-per-la-connessione&quot;&gt;&lt;a class=&quot;header-anchor no-hover-padding&quot; href=&quot;#comandi-per-la-connessione&quot; aria-label=&quot;Anchor link for: comandi-per-la-connessione&quot;&gt;&lt;span class=&quot;link-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;&#x2F;span&gt;&lt;&#x2F;a&gt;
Comandi per la connessione&lt;&#x2F;h4&gt;
&lt;pre class=&quot;z-code&quot;&gt;&lt;code&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;sudo wg-quick up wg1
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;sudo wg-quick down wg1
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;sudo wh show
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;h4 id=&quot;avvio-automatico-con-systemd&quot;&gt;&lt;a class=&quot;header-anchor no-hover-padding&quot; href=&quot;#avvio-automatico-con-systemd&quot; aria-label=&quot;Anchor link for: avvio-automatico-con-systemd&quot;&gt;&lt;span class=&quot;link-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;&#x2F;span&gt;&lt;&#x2F;a&gt;
Avvio automatico con systemd&lt;&#x2F;h4&gt;
&lt;pre class=&quot;z-code&quot;&gt;&lt;code&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;sudo systemctl enable wg-quick@wg0.service
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;sudo systemctl start wg-quick@wg0.service
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;sudo systemctl status wg-quick@wg0.service
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;h4 id=&quot;generare-qr-code&quot;&gt;&lt;a class=&quot;header-anchor no-hover-padding&quot; href=&quot;#generare-qr-code&quot; aria-label=&quot;Anchor link for: generare-qr-code&quot;&gt;&lt;span class=&quot;link-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;&#x2F;span&gt;&lt;&#x2F;a&gt;
Generare Qr code&lt;&#x2F;h4&gt;
&lt;p&gt;Installare il software qrencode&lt;&#x2F;p&gt;
&lt;pre class=&quot;z-code&quot;&gt;&lt;code&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;qrencode -t ansiutf8 &amp;lt; &#x2F;etc&#x2F;wireguard&#x2F;clients&#x2F;client1.conf
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;&lt;img src=&quot;https:&#x2F;&#x2F;img.agostinelli.eu&#x2F;2024&#x2F;wireguard_show.jpg&quot; alt=&quot;Wireguard Command Line&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
&lt;h2 id=&quot;aggiunta-nuovi-client&quot;&gt;&lt;a class=&quot;header-anchor no-hover-padding&quot; href=&quot;#aggiunta-nuovi-client&quot; aria-label=&quot;Anchor link for: aggiunta-nuovi-client&quot;&gt;&lt;span class=&quot;link-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;&#x2F;span&gt;&lt;&#x2F;a&gt;
Aggiunta nuovi client&lt;&#x2F;h2&gt;
&lt;p&gt;Per aggiungere un nuovo client, conviene spengere la vpn del server (wg down), aggiungere le nuove righe al file di configurazione, e riattivare la connessione (wg up)&lt;&#x2F;p&gt;
&lt;h3 id=&quot;configurazione-guidata&quot;&gt;&lt;a class=&quot;header-anchor no-hover-padding&quot; href=&quot;#configurazione-guidata&quot; aria-label=&quot;Anchor link for: configurazione-guidata&quot;&gt;&lt;span class=&quot;link-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;&#x2F;span&gt;&lt;&#x2F;a&gt;
Configurazione guidata&lt;&#x2F;h3&gt;
&lt;p&gt;Vedi i due frontend web  suggeriti sotto per la parte server.
Per la configurazione come client è sufficiente importare il file conf generato o in alternativa il qr code.
Per la connessione è sufficiente utilizzare un client;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Su linux è possibile usare li strumenti integrati nel desktop in uso attraverso NetworkManager (kde, gnome, ecc)&lt;&#x2F;li&gt;
&lt;li&gt;Su windows è sufficiente scaricare il client dal sito ufficiale (https:&#x2F;&#x2F;www.wireguard.com)&lt;&#x2F;li&gt;
&lt;li&gt;Android Play store: https:&#x2F;&#x2F;play.google.com&#x2F;store&#x2F;apps&#x2F;details?id=com.wireguard.android&lt;&#x2F;li&gt;
&lt;li&gt;Apple store: https:&#x2F;&#x2F;apps.apple.com&#x2F;it&#x2F;app&#x2F;wireguard&#x2F;id1441195209&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;programmi-accessori-frontend&quot;&gt;&lt;a class=&quot;header-anchor no-hover-padding&quot; href=&quot;#programmi-accessori-frontend&quot; aria-label=&quot;Anchor link for: programmi-accessori-frontend&quot;&gt;&lt;span class=&quot;link-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;&#x2F;span&gt;&lt;&#x2F;a&gt;
Programmi accessori (frontend)&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;https:&#x2F;&#x2F;github.com&#x2F;ngoduykhanh&#x2F;wireguard-ui&lt;&#x2F;li&gt;
&lt;li&gt;https:&#x2F;&#x2F;github.com&#x2F;wg-easy&#x2F;wg-easy&lt;&#x2F;li&gt;
&lt;li&gt;https:&#x2F;&#x2F;github.com&#x2F;subspacecloud&#x2F;subspace&lt;&#x2F;li&gt;
&lt;li&gt;https:&#x2F;&#x2F;www.wireguardconfig.com&#x2F;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;funzioni-avanzate&quot;&gt;&lt;a class=&quot;header-anchor no-hover-padding&quot; href=&quot;#funzioni-avanzate&quot; aria-label=&quot;Anchor link for: funzioni-avanzate&quot;&gt;&lt;span class=&quot;link-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;&#x2F;span&gt;&lt;&#x2F;a&gt;
Funzioni avanzate&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;dns&quot;&gt;&lt;a class=&quot;header-anchor no-hover-padding&quot; href=&quot;#dns&quot; aria-label=&quot;Anchor link for: dns&quot;&gt;&lt;span class=&quot;link-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;&#x2F;span&gt;&lt;&#x2F;a&gt;
Dns&lt;&#x2F;h3&gt;
&lt;p&gt;Nella configurazione del client è anche possibile indicare quale server dns utilizzare&lt;&#x2F;p&gt;
&lt;h3 id=&quot;firewall-per-i-client&quot;&gt;&lt;a class=&quot;header-anchor no-hover-padding&quot; href=&quot;#firewall-per-i-client&quot; aria-label=&quot;Anchor link for: firewall-per-i-client&quot;&gt;&lt;span class=&quot;link-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;&#x2F;span&gt;&lt;&#x2F;a&gt;
Firewall per i client&lt;&#x2F;h3&gt;
&lt;p&gt;Nalle configurazione server è possibile aggiungere più righe di PostUp con &lt;strong&gt;iptables&lt;&#x2F;strong&gt;, e quindi configurare il firewall con assoluta personalizzazione: è possibile, quindi, limitare la risorse da accedere a specifici indirizzi&lt;&#x2F;p&gt;
&lt;h3 id=&quot;limitare-la-banda&quot;&gt;&lt;a class=&quot;header-anchor no-hover-padding&quot; href=&quot;#limitare-la-banda&quot; aria-label=&quot;Anchor link for: limitare-la-banda&quot;&gt;&lt;span class=&quot;link-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;&#x2F;span&gt;&lt;&#x2F;a&gt;
Limitare la banda&lt;&#x2F;h3&gt;
&lt;p&gt;Sempre grazie ai comandi postup è possibile anche limitare, qualora si voglia, la banda passante per i client (sia in upload che ion download), ad esempio:&lt;&#x2F;p&gt;
&lt;pre class=&quot;z-code&quot;&gt;&lt;code&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;PostUp = tc qdisc add dev wg0 ingress; tc filter add dev wg1 protocol ip ingress prio 2 u32 match ip dst 0.0.0.0&#x2F;0 action police
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;rate 10mbit burst 10mbit; tc filter add dev wg0 protocol ip ingress prio 2 u32 match ip src 0.0.0.0&#x2F;0 action police rate 10mbit burst 10mbit
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;PostUp = tc qdisc add dev wg0 parent root handle 1: hfsc default 1; tc class add dev wg0 parent 1: classid 1:1 hfsc sc rate 10mbit ul rate 10mbit
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;&lt;img src=&quot;https:&#x2F;&#x2F;img.agostinelli.eu&#x2F;2024&#x2F;wireguard_network.png&quot; alt=&quot;Wireguard Network&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
</description>
      </item>
    </channel>
</rss>
