ssh vpn

ssh vpn


Edit /etc/ssh/sshd_config & add this string:

PermitTunnel point-to-point

And restart sshd

Connect & setup network:

# run as root or over sudo & connect to root
ssh -w 14:14 root@host

# 14 is number of tun interface

# on remote server
ip addr add 192.168.252.1/30 dev tun14
ip link set up tun14

# on local pc
ip addr add 192.168.252.2/30 dev tun14
ip link set up tun14

Now you can work with this network just like with any other (add routes, do NAT, limit with a firewall).

If there is a need to wrap the route 0.0.0.0/0 in this tun interface, then you should first add a higher priority route to the host through the previous gateway (to maintain the operation of the ssh session)

Содержание