<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>olivetalks &#187; static route</title>
	<atom:link href="http://www.olivetalks.com/tag/static-route/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.olivetalks.com</link>
	<description>The Olive has arrived and it has things to say…</description>
	<lastBuildDate>Tue, 16 Nov 2010 19:25:45 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>OpenVPN and Linksys RVS4000</title>
		<link>http://www.olivetalks.com/2008/02/06/openvpn-and-linksys-rvs4000/</link>
		<comments>http://www.olivetalks.com/2008/02/06/openvpn-and-linksys-rvs4000/#comments</comments>
		<pubDate>Wed, 06 Feb 2008 07:28:20 +0000</pubDate>
		<dc:creator>ZoltarStark</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[inter-VLAN routing]]></category>
		<category><![CDATA[Linksys RVS4000]]></category>
		<category><![CDATA[OpenVPN]]></category>
		<category><![CDATA[port forwarding]]></category>
		<category><![CDATA[static route]]></category>
		<category><![CDATA[VPN]]></category>

		<guid isPermaLink="false">http://www.olivetalks.com/2008/02/06/openvpn-and-linksys-rvs4000/</guid>
		<description><![CDATA[I&#8217;ve been setting up a new router at work: Linksys RVS4000. The initial setup was quite simple: Connect to the network, power on, log on to the router using a web browser and configure. After a few minutes I had the office LAN connected to the Internet. The router has one annoying feature though &#8211; [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been setting up a new router at work: <a href="http://www.linksys.com/servlet/Satellite?c=L_Product_C2&amp;childpagename=US%2FLayout&amp;pagename=Linksys%2FCommon%2FVisitorWrapper&amp;cid=1150490915278" rel="external nofollow">Linksys RVS4000</a>. The initial setup was quite simple: Connect to the network, power on, log on to the router using a web browser and configure. After a few minutes I had the office LAN connected to the Internet. The router has one annoying feature though &#8211; a bit too many reboots. Often you change a tiny setting, press &#8220;Save Settings&#8221; and suddenly you need to wait a minute for the router to reinitialize itself. Weird, but anyway&#8230;</p>
<p>We&#8217;ve got OpenVPN server setup in the office to allow access to our internal network via Internet. I had to make the router allow this traffic in and out. Previously we were using <a href="http://www.swexpress.com/home.nsf/0/DA976BFA723A9AD185256FA2007BEF1D!opendocument&amp;title=Gateway+Security+Appliance+300+series" rel="external nofollow">Symantec SGS 300</a> which was working pretty well but recently started crashing from time to time. Anyway, I knew how to setup the new router to allow OpenVPN traffic. At least I thought I knew&#8230;</p>
<p>OpenVPN connections arrive to the router at TCP port 1194 (which is the standard OpenVPN port). The router would normally reject those packets but for OpenVPN to work it needs to forward them to the OpenVPN server within the network. So step one is to setup port forwarding for TCP port 1194 and direct this traffic to the IP address of OpenVPN server. The OpenVPN server is inside the LAN so the IP address is in the private range. Let&#8217;s say it&#8217;s <strong>192.168.0.10</strong> although you need to check your set up if you want to follow these instructions. In order to set up port forwarding on Linksys RVS4000 you need to log on to the router, then select Firewall followed by Single Port Forwarding. Scroll to the bottom of the page and add a new rule:</p>
<ul>
<li>Application:     OpenVPN</li>
<li>External Port:  1194</li>
<li>Internal Port:   1194</li>
<li>Protocol:          TCP</li>
<li>IP Address:     192.168.0.10 (this is the IP address of the OpenVPN server on the LAN)</li>
</ul>
<p>When you&#8217;re done press Save Settings.</p>
<p>So now we can start an OpenVPN client somewhere outside the office network and have it connect to the OpenVPN server within the LAN. If you try to connect to other machines on the LAN directly from the client you won&#8217;t be able to see them though. You can only do it by connecting first to the OpenVPN server and from there to the target computer. Why is that happening? You see, when the OpenVPN client connects to the OpenVPN server it gets an IP address on a different subnet than the office LAN. Depending on your OpenVPN configuration it could be for example <strong>192.168.22.20</strong>. Now, the OpenVPN server is connected to both the office LAN (<strong>192.68.0.0/24</strong> subnet) and the OpenVPN subnet (<strong>192.168.22.0/24</strong> subnet) and it acts as a router between these subnets. You could think that is enough &#8211; we&#8217;ve got two subnets and a router between them, so they should be connected. Well, there&#8217;s one thing missing.</p>
<p>All the other machines on the office LAN (beside the OpenVPN server) have no clue about talking to the IP addresses on the OpenVPN subnet where the client is connected. In fact they use the default route which points to the router, in my case Linksys RVS4000. And that makes sense &#8211; if the IP address is not on the LAN that means it&#8217;s outside and the traffic should go through the router. Unfortunately the router so far has no idea how to connect to the OpenVPN subnet. It&#8217;s a private subnet and the only way to connect to it is via the OpenVPN server. OK, so we need to tell the router to direct all the traffic destined for the OpenVPN subnet to the OpenVPN server. OpenVPN server will then nicely encapsulate those packets in OpenVPN packets and send them back to the router to be forwarded to the outside client over the Internet. The difference is that this time the destination IP address will be the public IP address of the client on the Internet (for example this could be the external IP address of you DSL connection). The router knows how to deal with the public IP addresses. But before that happens we need to setup a static route to tell the router that all traffic with destination IP address in the OpenVPN subnet (<strong>192.168.22.0/24</strong> subnet) should be forwarded to the OpenVPN server at address <strong>192.168.0.10</strong>. To add the static route on Linksys RVS4000 you need to log on to the router, then select Setup followed by Advanced Routing. Scroll to the lower half of the page and add a new entry in the <strong>Static Routing</strong> section:</p>
<ul>
<li>Select Set Number:              1 (or any other entry which is not in use)</li>
<li>Destination IP Address:      192.168.22.0 (IP address of the OpenVPN subnet)</li>
<li>Subnet Mask:                         255.255.255.0</li>
<li>Gateway:                              192.168.0.10 (this is the IP address of the OpenVPN server on the LAN)</li>
<li>Hop Count:                            2 (that&#8217;s the default value and changing it won&#8217;t make a difference in this setup)</li>
</ul>
<p>When you&#8217;re done press Save Settings.</p>
<p>After this you should be able to connect with your OpenVPN client to any machine on the office LAN. Unless like me you decided to be smart <img src='http://www.olivetalks.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>You see, on the Advanced Routing page where we&#8217;ve just configured the static route there&#8217;s also another configuration option: Inter-VLAN Routing. This option can be either enabled or disabled. If you access the online help on Linksys RVS4000 you can read that &#8220;When Inter-VLAN Routing is enabled, packets can be routed to the VLANs that are in different IP subnets.&#8221; If you&#8217;re like me after reading this you probably thought: &#8220;I&#8217;ve got no VLANs, I&#8217;m going to disable this option&#8221;. I did just that, I disabled the Inter-VLAN Routing. The result was that I lost VPN access to other machines than the OpenVPN server. For some reason Linksys RVS4000 needs this option to be enabled unless you want it to completely ignore the static route you&#8217;ve just configured. I don&#8217;t know why it works like that since as far as I know there&#8217;s no actual VLAN being used by the OpenVPN. The router is supposed to just forward the packets with the destination IP address in <strong>192.168.22.0/24</strong> subnet to the <strong>192.168.0.10</strong> IP address of the OpenVPN server. There&#8217;s no VLAN tagging or untagging involved. I don&#8217;t know enough about VLANs to tell you whether Cisco engineers had a good reason to design it this way or that&#8217;s a bug. It took me awhile to figure this out since I made some other changes at the same time&#8230; Hopefully these instructions will help other people.</p>
<hr align="left" width="20%" /> <a href="/category/computers/feed" title="rss feed to post"><img src="/wp-content/uploads/2008/01/feed-icon-14x14.png" alt="rss feed to post" /></a> Subscribe to the Computers posts of olivetalks, if you found this article interesting, thank you!</p>
<h3>Related post(s)</h3><ul class="related_post"><li><a href="http://www.olivetalks.com/2008/03/13/symantec-sgs-360r/" title="Experiences with Symantec SGS 360R">Experiences with Symantec SGS 360R (1)</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.olivetalks.com/2008/02/06/openvpn-and-linksys-rvs4000/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

