Skip to content

Instantly share code, notes, and snippets.

@Manah7
Last active November 18, 2022 16:49
Show Gist options
  • Select an option

  • Save Manah7/ee8c1509a08a8b4a9157da9a652dc026 to your computer and use it in GitHub Desktop.

Select an option

Save Manah7/ee8c1509a08a8b4a9157da9a652dc026 to your computer and use it in GitHub Desktop.
Création d'un tunnel VPN avec SSH (option -w)

Tunnel VPN SSH (6.0)

Attention truc de barbu. L'utilisateur remote doit être root.

Local : Ajouter Tunnel yes et TunnelDevice any:any dans /etc/ssh/ssh_config, puis :

ssh root@172.20.2.3 -w 0:0 -N 
ifconfig tun0 10.2.2.1 netmask 255.255.255.252 

Remote : Ajouter PermitTunnel yes dans /etc/ssh/sshd_config puis :

ifconfig tun0 10.2.2.2 netmask 255.255.255.252

On teste l'infra complète :

$ ping 10.2.2.2
PING 10.2.2.2 (10.2.2.2) 56(84) bytes of data.
64 bytes from 10.2.2.2: icmp_seq=1 ttl=64 time=1.60 ms
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment