Skip to content

Instantly share code, notes, and snippets.

@Remiii
Last active August 29, 2015 14:05
Show Gist options
  • Save Remiii/7d841f531f5b8e80fefc to your computer and use it in GitHub Desktop.
Save Remiii/7d841f531f5b8e80fefc to your computer and use it in GitHub Desktop.
VPN & PortForwarding SSH Noob

VPN & PortForwarding SSH Noob

Yo Noob, look at this Gist! 👊

Show OpenVPN status

$ sudo service openvpn status

Show Tun in ifconfig

$ sudo ifconfig

Output (something like that) >>

eth0      Link encap:Ethernet  HWaddr xx:xx:xx:xx
          inet adr:192.168.1.67  Bcast:192.168.1.255  Masque:255.255.255.0
          adr inet6: xxxx::xxxx:xxxx:xxxx:xxxx/64 Scope:Lien
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          Packets reçus:712710363 erreurs:0 :755866 overruns:0 frame:0
          TX packets:14313509 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 lg file transmission:1000
          Octets reçus:911940582439 (911.9 GB) Octets transmis:179681603445 (179.6 GB)
          Interruption:16

lo        Link encap:Boucle locale
          inet adr:127.0.0.1  Masque:255.0.0.0
          adr inet6: ::1/128 Scope:Hôte
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          Packets reçus:22990 erreurs:0 :0 overruns:0 frame:0
          TX packets:22990 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 lg file transmission:0
          Octets reçus:1364010 (1.3 MB) Octets transmis:1364010 (1.3 MB)

tun0      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
          inet adr:10.8.3.34  P-t-P:10.8.3.24  Masque:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
          Packets reçus:5010 erreurs:0 :0 overruns:0 frame:0
          TX packets:2309 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 lg file transmission:100
          Octets reçus:262426 (262.4 KB) Octets transmis:221825 (221.8 KB)

Start OpenVPN

$ sudo service openvpn start

Stop OpenVPN

$ sudo service openvpn stop

Restart OpenVPN

$ sudo service openvpn restart

SSH - Local Port Forwarding ssh -L

ssh -L localPort:IPTarget:distantPort myuser@IPServer

Sample:

ssh -L 2012:192.168.1.1:80 [email protected]

SSH - Dynamic Port Forwarding ssh -D

ssh -D proxyPort myuser@IPServer

Sample:

ssh -D 33333 [email protected]

Use Firefox for your Proxy SOCKS configuration.

Sources

Author

  • Rémi Barbe (aka Remiii)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment