From Hentschel
Jump to: navigation, search

HM server networking

418 bytes added, 09:58, 24 March 2017
/* Automating the login */
=== Automating the login ===
 
remote script on hentschel
<pre>
#!/bin/bash
 
/sbin/ip link set tun0 up
/sbin/ip addr add 10.0.0.100/24 peer 10.0.0.200 dev tun0
sleep 4
/sbin/ip route add 192.168.1.0/24 via 10.0.0.100
</pre>
 
local script on zm.home:
<pre>
#!/bin/bash
 
ssh -n -w 0:0 root@server.hentschel.net /bin/bash /root/bin/ssh-vpn-remote.sh &
sleep 1
/sbin/ip link set tun0 up
/sbin/ip addr add 10.0.0.200/24 peer 10.0.0.100 dev tun0
</pre>
 
Here a few tricks [http://stackoverflow.com/questions/11543720/how-to-use-ssh-to-run-a-local-command-after-connection-and-quit-after-this-local at this link]