úterý 23. září 2014

SSH based VPN for virtual machine

My virtual machine is hidden behind a host-based NAT.  It should work as a (headless) test server. I need to see and access all its ports. The virtual machine is a fresh system, accessible via ssh (VirtualBox port forwarding: host:2222 -> guest:22 ).

1. virtual (as root):
vi /etc/ssh/sshd_config 
PermitTunnel yes
:wq

systemctl restart sshd
systemctl stop firewalld

2. host (as root):
ssh -w5:5 -p 2222 root@localhost ifconfig tun5 10.0.1.1 netmask 255.255.255.252 up &
sleep 3
ifconfig tun5 10.0.1.2 netmask 255.255.255.252 up
ping 10.0.1.1

Links:
Thanks to: http://sleepyhead.de/howto/?href=vpn


Žádné komentáře:

Okomentovat