<?xml version="1.0" encoding="utf-8" ?>

<rss version="2.0" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   >
<channel>
    
    <title>RND(tech) - Internet/Networking</title>
    <link>http://www.khanh.net/blog/</link>
    <description>My random co-existence with technology...</description>
    <dc:language>en</dc:language>
    <generator>Serendipity 1.5.5 - http://www.s9y.org/</generator>
    <pubDate>Sat, 15 Oct 2011 17:28:36 GMT</pubDate>

    <image>
        <url>http://www.khanh.net/blog/templates/bulletproof/img/s9y_banner_small.png</url>
        <title>RSS: RND(tech) - Internet/Networking - My random co-existence with technology...</title>
        <link>http://www.khanh.net/blog/</link>
        <width>100</width>
        <height>21</height>
    </image>

<item>
    <title>using openSSH as a layer-2 ethernet bridge (VPN)</title>
    <link>http://www.khanh.net/blog/archives/51-using-openSSH-as-a-layer-2-ethernet-bridge-VPN.html</link>
            <category>Internet/Networking</category>
            <category>Linux</category>
    
    <comments>http://www.khanh.net/blog/archives/51-using-openSSH-as-a-layer-2-ethernet-bridge-VPN.html#comments</comments>
    <wfw:comment>http://www.khanh.net/blog/wfwcomment.php?cid=51</wfw:comment>

    <slash:comments>4</slash:comments>
    <wfw:commentRss>http://www.khanh.net/blog/rss.php?version=2.0&amp;type=comments&amp;cid=51</wfw:commentRss>
    

    <author>nospam@example.com (Khanh Tran)</author>
    <content:encoded>
    Consider the following network setup (which I live with by the way):&lt;br /&gt;
&lt;br /&gt;
[main LAN] &amp;lt;-----------------------------------------------------&amp;gt; [remote datacenter LAN]&lt;br /&gt;
(192.168.0.0/16) &amp;lt;-------- leased point-to-point ------------&amp;gt; (192.168.0.0/16)&lt;br /&gt;
&lt;br /&gt;
Both locations also have separate connections to the public Internet with different public IP subnets.  However, for this discussion it&#039;s not necessary to have different public IP subnets.  Under normal circumstances the local LAN and the remote LAN are the same logical LAN via the magic of the leased point to point line.&lt;br /&gt;
&lt;br /&gt;
However, today that p2p connection broke (physically between the two locations, out of our control).  This outage lasted several hours, but brought out an interesting use of SSH tunneling for ethernet bridging aka Layer-2 VPN or tunneling.  For this to work, you&#039;ll need to have at least openSSH 4.3, a somewhat recent linux distro and the bridge-utils package for your distro.  This also assumes you have a basic knowledge of IP and the linux command line.  I use openSuSE 11.0, but this should work for almost any similar linux.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s say for example, the main location has a linux box (router1) with two NICs:&lt;br /&gt;
eth0: 1.1.1.1 (the public interface)&lt;br /&gt;
eth1: unassigned IP, but connected to your LAN (192.168.0.0/16 in my case)&lt;br /&gt;
&lt;br /&gt;
On the other box, at the remote location (router2) we also have two NICs:&lt;br /&gt;
eth0: 2.2.2.2 (the public interface)&lt;br /&gt;
eth1: unassigned IP, but connected to your LAN (192.168.0.0/16 in my case)&lt;br /&gt;
&lt;br /&gt;
Both routers should be set with it&#039;s public IP gateway as the default route, working DNS, etc.  You&#039;ll want to enable IP forwarding (consult your specific distro) and in my case, I disabled the distro&#039;s firewall.  On the remote side (consider it the &amp;quot;server&amp;quot;), you&#039;ll need to edit your sshd config to allow remote root logins and tunnels via SSH.&lt;br /&gt;
&lt;br /&gt;
/etc/ssh/sshd_config:&lt;br /&gt;
PermitRootLogin yes&lt;br /&gt;
PermitTunnel yes&lt;br /&gt;
&lt;br /&gt;
The root login is necessary to allow ssh to create the TAP devices for the bridge.  Because of that, you&#039;ll also want to add your local side&#039;s IPs to /etc/hosts.allow for the sshd process.  Now, on the local side (IP 1.1.1.1, which you might consider the client now) you&#039;ll want to &amp;quot;su root&amp;quot; and do the following:&lt;br /&gt;
&lt;br /&gt;
ssh -o Tunnel=ethernet -f  -w 0:0 2.2.2.2 true&lt;br /&gt;
&lt;br /&gt;
The -o switch sets client options on the command line.  We&#039;re specifying the tunnel type as ethernet (bridge) as opposed to point-to-point, which it&#039;ll do by default (for Layer-3 type VPN routing).  The -f switch just forks ssh in the background so we&#039;re returned to our &amp;quot;client&#039;s&amp;quot; command line and not remote&#039;s.  Since we&#039;ve done that, ssh will expect a remote command of some kind, so we&#039;ll just run &amp;quot;true&amp;quot;, effectively doing nothing.  The -w 0:0 switch actually sets up our tap devices on either side as tap0.  You can do -w 1:1 for tap1, -w 0:1 for tap0 on one side and tap1 on the other, etc.&lt;br /&gt;
&lt;br /&gt;
On both sides now, you should be able to see via ifconfig -a your eth0, eth1 and tap0 devices.  Make sure to call ifconfig with -a, or you&#039;ll only see interfaces with defined IPs.  Now that the two boxes are connected via the public Internet to each other via SSH, you can finally start to establish the bridge interface.  Now we&#039;ll use the bridge-utils binary to create a bridge interface called br0:&lt;br /&gt;
&lt;br /&gt;
brctl addbr br0&lt;br /&gt;
brctl addif br0 eth1&lt;br /&gt;
brctl addif br0 tap0&lt;br /&gt;
&lt;br /&gt;
Then you&#039;ll want to bring up all of your interfaces, if they aren&#039;t already:&lt;br /&gt;
&lt;br /&gt;
ifconfig eth1 up&lt;br /&gt;
ifconfig tap0 up&lt;br /&gt;
ifconfig br0 up&lt;br /&gt;
&lt;br /&gt;
Doing so will create the br0 interface, then bridge your eth1 and tap0 together and bring up the interfaces.  Don&#039;t forget, YOU MUST RUN THE brctl and ifconfig COMANDS ON BOTH SIDES!!!  Once you&#039;ve done this, you can check the remote side to see if it knows about the MAC addresses (from Layer-2) on the local side:&lt;br /&gt;
&lt;br /&gt;
brctl showmacs br0&lt;br /&gt;
&lt;br /&gt;
This will report on the known MAC address from the ARP protocol.  Depending on your network, you&#039;ll see a few or many.  Depending on your setup, you can get a DHCP address on the &amp;quot;other side&amp;quot; of the tunnel now or configure an appropriate IP and ping across as if you were on the same physical broadcast domain!&lt;br /&gt;
&lt;br /&gt;
As a final note, there&#039;s always a downside.  TCP encapsulated TCP is bad and will put a STRAIN on your hardware.  Make sure it&#039;s decent for the amount of anticipated traffic and use only as a quick and dirty solution or a temporary measure.  The following is good reading for why this is not a long-term, permanent solution:&lt;br /&gt;
&lt;a href=&quot;http://sites.inka.de/~W1011/devel/tcp-tcp.html&quot;&gt;http://sites.inka.de/~W1011/devel/tcp-tcp.html&lt;/a&gt; 
    </content:encoded>

    <pubDate>Tue, 18 Nov 2008 21:11:40 -0700</pubDate>
    <guid isPermaLink="false">http://www.khanh.net/blog/archives/51-guid.html</guid>
    
</item>
<item>
    <title>eh, wordle...</title>
    <link>http://www.khanh.net/blog/archives/54-eh,-wordle....html</link>
            <category>Internet/Networking</category>
    
    <comments>http://www.khanh.net/blog/archives/54-eh,-wordle....html#comments</comments>
    <wfw:comment>http://www.khanh.net/blog/wfwcomment.php?cid=54</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.khanh.net/blog/rss.php?version=2.0&amp;type=comments&amp;cid=54</wfw:commentRss>
    

    <author>nospam@example.com (Khanh Tran)</author>
    <content:encoded>
    Wordle generated and interesting graphic of the blog today...&lt;br /&gt;
&lt;br /&gt;
&lt;a title=&quot;Wordle: Untitled&quot; href=&quot;http://www.wordle.net/gallery/wrdl/504466/Untitled&quot;&gt; &lt;img style=&quot;padding: 4px; border: 1px solid #dddddd;&quot; alt=&quot;Wordle: Untitled&quot; src=&quot;http://www.wordle.net/thumb/wrdl/504466/Untitled&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
If you look at it hard enough, it&#039;s slightly 3D!&lt;br /&gt;
&lt;br /&gt;
Then there was this, more relaxed graphic:&lt;br /&gt;
&lt;br /&gt;
&lt;a title=&quot;Wordle: Untitled&quot; href=&quot;http://www.wordle.net/gallery/wrdl/504491/Untitled&quot;&gt; &lt;img style=&quot;padding: 4px; border: 1px solid #dddddd;&quot; alt=&quot;Wordle: Untitled&quot; src=&quot;http://www.wordle.net/thumb/wrdl/504491/Untitled&quot; /&gt;&lt;/a&gt; 
    </content:encoded>

    <pubDate>Wed, 04 Feb 2009 11:36:47 -0700</pubDate>
    <guid isPermaLink="false">http://www.khanh.net/blog/archives/54-guid.html</guid>
    
</item>
<item>
    <title>AT&amp;T 3G Speed tests</title>
    <link>http://www.khanh.net/blog/archives/56-ATT-3G-Speed-tests.html</link>
            <category>Hardware</category>
            <category>Internet/Networking</category>
    
    <comments>http://www.khanh.net/blog/archives/56-ATT-3G-Speed-tests.html#comments</comments>
    <wfw:comment>http://www.khanh.net/blog/wfwcomment.php?cid=56</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.khanh.net/blog/rss.php?version=2.0&amp;type=comments&amp;cid=56</wfw:commentRss>
    

    <author>nospam@example.com (Khanh Tran)</author>
    <content:encoded>
    I haven&#039;t been writing much lately due to a busy schedule!&lt;br /&gt;
&lt;br /&gt;
Anyway, I recently borrowed one of those AT&amp;amp;T 3G LaptopConnect cards.  It&#039;s a Sierra Wireless AirCard 881.  Compared to the speeds I&#039;ve been getting with my AT&amp;amp;T Tilt (tethered via USB), it didn&#039;t hold up as well as I expected:&lt;br /&gt;
&lt;br /&gt;
AT&amp;amp;T Tilt (HTC) tethered via USB:&lt;br /&gt;
&lt;a href=&quot;http://www.speedtest.net&quot;&gt;&lt;img src=&quot;http://www.speedtest.net/result/433778379.png&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
AT&amp;amp;T Sierra Wireless LaptopConnect Card (AirCard 881):&lt;br /&gt;
&lt;a href=&quot;http://www.speedtest.net&quot;&gt;&lt;img src=&quot;http://www.speedtest.net/result/434746909.png&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
And although this isn&#039;t really for comparison to the AT&amp;amp;T test, it seems Cablevision (Optimum Online) has been steadily increasing my bandwidth at home, even out in the middle of nowhere!&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.speedtest.net&quot;&gt;&lt;img src=&quot;http://www.speedtest.net/result/434751321.png&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://www.speedtest.net&quot;&gt;&lt;img src=&quot;http://www.speedtest.net/result/273097096.png&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://www.speedtest.net&quot;&gt;&lt;img src=&quot;http://www.speedtest.net/result/47552383.png&quot; /&gt;&lt;/a&gt; 
    </content:encoded>

    <pubDate>Sun, 22 Mar 2009 12:33:22 -0700</pubDate>
    <guid isPermaLink="false">http://www.khanh.net/blog/archives/56-guid.html</guid>
    
</item>
<item>
    <title>disabling NetBIOS over TCP/IP in Windows via BIND DHCPD</title>
    <link>http://www.khanh.net/blog/archives/59-disabling-NetBIOS-over-TCPIP-in-Windows-via-BIND-DHCPD.html</link>
            <category>Internet/Networking</category>
            <category>Linux</category>
            <category>Windows</category>
    
    <comments>http://www.khanh.net/blog/archives/59-disabling-NetBIOS-over-TCPIP-in-Windows-via-BIND-DHCPD.html#comments</comments>
    <wfw:comment>http://www.khanh.net/blog/wfwcomment.php?cid=59</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.khanh.net/blog/rss.php?version=2.0&amp;type=comments&amp;cid=59</wfw:commentRss>
    

    <author>nospam@example.com (Khanh Tran)</author>
    <content:encoded>
    This is scarce information on the Internet, so I&#039;m reposting!&lt;br /&gt;
&lt;br /&gt;
NetBIOS can be disabled now that it&#039;s fairly ancient networking.  You&#039;re using TCP/IP and DNS right?&lt;br /&gt;
I don&#039;t use Microsoft DHCP or DNS servers, so finding the information to set this is hard to come by.  To disable NetBIOS over TCP/IP in an ISC DHCP server, add the following to your dhcpd.conf:&lt;br /&gt;
&lt;br /&gt;
option vendor-encapsulated-options 01:04:00:00:00:02;&lt;br /&gt;
&lt;br /&gt;
It&#039;s that easy! 
    </content:encoded>

    <pubDate>Thu, 27 May 2010 08:31:40 -0700</pubDate>
    <guid isPermaLink="false">http://www.khanh.net/blog/archives/59-guid.html</guid>
    
</item>

</channel>
</rss>
