问题原文
原帖链接 · devstructor · CC BY-SA 3.0
I have some problems with making ssh-based VPN.
Situation:
LOCAL -> GATE -> SERVICES
(ssh server) (Many other servers with some services)
192.168.0.10 10.1.0.154 172.26.106.0/24
255.255.255.0 255.255.0.0
From LOCAL I can login through the ssh to the GATE and then from here I have access to all of the SERVICES servers.
However i want to access services directly from my LOCAL computer. How can I acheive this?
Here is what i tried to do after reading ssh manual:
On LOCAL:
# ssh -f -w 1:2 root@GATE true
# ifconfig tun1 10.66.1.1 10.66.1.2 netmask 255.255.255.252
# route add -net 172.26.106.0 netmask 255.255.255.0 gw 10.66.1.2
On GATE:
# ifconfig tun2 10.66.1.2 10.66.1.1 netmask 255.255.255.252
It doesn't work. I get timeouts when i try to ssh to some SERVICE from LOCAL ;-(
已采纳解答
原帖链接 · devstructor · CC BY-SA 4.0
Two and half year left since I asked that question... Now I found another solution which is extremely simple. You can just use tool called sshuttle.
From sshuttle manual:
sshuttle allows you to create a VPN connection from your machine to any remote server that you can connect to via ssh, as long as that server has python 2.3 or higher.
i.e.:
sshuttle -r user@gate 172.26.100.0/24 172.26.106.0/24 172.26.103.0/24
Then in another terminal you can do ssh to any server from routed subnets directly:
i.e.:
ssh [email omitted]
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
