User Tools

Site Tools


linux:network:vpn

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
linux:network:vpn [2021/02/13 16:14]
tkilla
linux:network:vpn [2024/01/18 20:59] (current)
tkilla
Line 6: Line 6:
 TBD TBD
  
 +
 +===== Headscale / Tailscale =====
 +
 +Headscale is the open source variant of Tailscale.
 +
 +Install it on your Server: [[https://headscale.net/running-headscale-linux/]]
 +
 +Proxy it via nginx to get httpS. Nginx Example Config:
 +
 +  map $http_upgrade $connection_upgrade {                                                                                                                                                   
 +    default      keep-alive;                                                                                                                                                              
 +    'websocket'  upgrade;                                                                                                                                                                 
 +    ''           close;                                                                                                                                                                   
 +  }                                                                                                                                                                                         
 +                                                                                                                                                                                          
 +  server {                                                                                                                                                                                  
 +    listen 80;                                                                                                                                                                            
 +    listen [::]:80;                                                                                                                                                                       
 +                                                                                                                                                                                          
 +    listen 443      ssl http2;                                                                                                                                                            
 +    listen [::]:443 ssl http2;                                                                                                                                                            
 +                                                                                                                                                                                          
 +    server_name <YOUR DOMAIN>;                                                                                                                                                      
 +                                                                                                                                                                                          
 +    ssl_certificate /etc/letsencrypt/live/<YOUR DOMAIN>/fullchain.pem;                                                                                                              
 +    ssl_certificate_key /etc/letsencrypt/live/<YOUR DOMAIN>/privkey.pem;                                                                                                            
 +    ssl_protocols TLSv1.2 TLSv1.3;                                                                                                                                                        
 +                                                                                                                                                                                          
 +    location / {                                                                                                                                                                          
 +        proxy_pass https://<HEADSCALE SERVER IP>:8080;                                                                                                                                           
 +        proxy_http_version 1.1;                                                                                                                                                           
 +        proxy_set_header Upgrade $http_upgrade;                                                                                                                                           
 +        proxy_set_header Connection $connection_upgrade;                                                                                                                                  
 +        proxy_set_header Host $server_name;                                                                                                                                               
 +        proxy_redirect http:// https://;                                                                                                                                                  
 +        proxy_buffering off;                                                                                                                                                              
 +        proxy_set_header X-Real-IP $remote_addr;                                                                                                                                          
 +        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;                                                                                                                      
 +        proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;                                                                                                                       
 +        add_header Strict-Transport-Security "max-age=15552000; includeSubDomains" always;                                                                                                
 +    }                                                                                                                                                                                     
 +  }  
 +
 +
 +Install Tailscale Client on your Clients: [[https://tailscale.com/download/linux]]
 +
 +Then run:
 +
 +  tailscale up --login-server https://<YOUR DOMAIN>
 +
 +which will give you the server Add command in the browser. Mission complete :)
  
 ===== tinc ===== ===== tinc =====
linux/network/vpn.txt ยท Last modified: 2024/01/18 20:59 by tkilla