From Hentschel
Jump to: navigation, search

HM server networking

521 bytes added, 07:15, 24 March 2017
/* Setting up VPN via SSHD */
+-------+-------+ point to point connection +-------+-------+
eth0 | creates a bridge | eth0
198.57.187xxx.185 xxx | that plugs machine B | 192.168.1.100
Routable | into network A |
address | |
</pre>
To add route from hentschel to Network B, <pre>ip route add 192.168.1.0/24 via 10.0.0.200</pre> on 'hentschel'On zm. home, the following needs to happen:# On zm.home, ensure IP forwarding is enabled via <pre>sysctl net.ipv4.ip_forward</pre>, and set it to enabled in ''/etc/sysctl.config'' if not.# start ssh with ''-w0:0'' (creates tun0 interfaces on both ends), both sides need to be logged in as root# set tun0 to up# assign ip address to tun 0<pre>> ssh -w0:0 root@198.57.xxx.xxx # this blocks, need another terminal> ip link set tun0 up> ip addr add 10.0.0.100/32 peer 10.0.0.200 dev tun0</pre> once logged in on hentschel, the following needs to happen on that end# set tun0 to up# assign ip address to tun 0# add route to network B<pre>> ip link set tun0 up> ip addr add 10.0.0.200/32 peer 10.0.0.100 dev tun0> ip route add 192.168.1.0/24 via 10.0.0.200</pre> 
The gateway on network B needs to be modified to redirect traffic destined for host hentschel via eth0 on host zm.home. We don't redirect all internet traffic via the tunnel, just what is destined for zm.home. On the Asus router, that looks like this:
[[File:asus-static-route.png|400px|thumb|left|Under ''LAN''->''Route'']]<br clear=both>
At this point, a request for any host on network B that originates on host hentschel will be answered. At the same time, traffic for hentschel from network B will be directed there via zm.home. Note that the web server on hentschel does '''not''' answer since it's interface is only set to the public interface.