<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>SleepMap (Posts about TUN)</title><link>https://sleepmap.de/</link><description></description><atom:link href="https://sleepmap.de/categories/tun.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2022 &lt;a href="mailto:dave@sleepmap.de"&gt;David Runge&lt;/a&gt; 
&lt;a rel="license" href="https://creativecommons.org/licenses/by-nc-sa/4.0/"&gt;CC BY-NC-SA 4.0&lt;/a&gt;</copyright><lastBuildDate>Mon, 12 Dec 2022 10:30:50 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>SSH tunnel with single hop, using systemd-networkd and autossh</title><link>https://sleepmap.de/2015/ssh-tunnel-with-single-hop-using-systemd-networkd-and-autossh/</link><dc:creator>David Runge</dc:creator><description>&lt;div&gt;&lt;div class="line-block"&gt;
&lt;div class="line"&gt;Recently I had the pleasure of setting up a &lt;abbr title="Secure Shell"&gt;SSH&lt;/abbr&gt; tunnel between two virtual machines that share no route and are located in two different subnets.&lt;/div&gt;
&lt;div class="line"&gt;They can however reach each other via SSH, hopping their host.&lt;/div&gt;
&lt;div class="line"&gt;Let's assume the following setup:&lt;/div&gt;
&lt;/div&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;client1&lt;/strong&gt; (Arch Linux) has &lt;em&gt;10.0.5.2/24&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;client2&lt;/strong&gt; (Arch Linux) has &lt;em&gt;10.0.6.2/24&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;host&lt;/strong&gt; (Debian) is &lt;em&gt;10.0.5.1/24&lt;/em&gt; to &lt;strong&gt;client1&lt;/strong&gt; and &lt;em&gt;10.0.6.1/24&lt;/em&gt; to &lt;strong&gt;client2&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="line-block"&gt;
&lt;div class="line"&gt;As I needed the two clients to be able to send mail to each other and reach each others' services, I did some digging and opted for a SSH connection using &lt;abbr title="network TUNnel (virtual-network kernel devices)"&gt;TUN&lt;/abbr&gt; devices (aka. "poor man's &lt;abbr title="Virtual Private Network"&gt;VPN&lt;/abbr&gt;").&lt;/div&gt;
&lt;div class="line"&gt;The following is needed to set this up:&lt;/div&gt;
&lt;/div&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;&lt;p&gt;root access on both virtual machines (&lt;strong&gt;client1&lt;/strong&gt; &amp;amp; &lt;strong&gt;client2&lt;/strong&gt;)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;a user account on the &lt;strong&gt;host&lt;/strong&gt; system&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;SSH (&lt;a href="http://openssh.com" target="_blank"&gt;OpenSSH&lt;/a&gt; assumed) installed on all three machines&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href="https://sleepmap.de/2015/ssh-tunnel-with-single-hop-using-systemd-networkd-and-autossh/"&gt;Read more…&lt;/a&gt; (3 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>arch linux</category><category>autossh</category><category>postfix</category><category>ssh</category><category>systemd</category><category>systemd.network</category><category>TUN</category><category>tunnel</category><guid>https://sleepmap.de/2015/ssh-tunnel-with-single-hop-using-systemd-networkd-and-autossh/</guid><pubDate>Sun, 01 Feb 2015 18:00:00 GMT</pubDate></item></channel></rss>