<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://www.marcelpost.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Vpn-gateway</id>
	<title>Vpn-gateway - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.marcelpost.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Vpn-gateway"/>
	<link rel="alternate" type="text/html" href="https://www.marcelpost.com/wiki/index.php?title=Vpn-gateway&amp;action=history"/>
	<updated>2026-05-28T15:40:52Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.17</generator>
	<entry>
		<id>https://www.marcelpost.com/wiki/index.php?title=Vpn-gateway&amp;diff=2074&amp;oldid=prev</id>
		<title>Admin at 03:35, 14 October 2015</title>
		<link rel="alternate" type="text/html" href="https://www.marcelpost.com/wiki/index.php?title=Vpn-gateway&amp;diff=2074&amp;oldid=prev"/>
		<updated>2015-10-14T03:35:22Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;You can use the OpenVPN server as the client&amp;#039;s default gateway. This method is used by commercial VPN as-a-service companies to offer overseas client &amp;#039;exit nodes&amp;#039; in order to bypass any local restrictions or traffic filtering. See [[openvpn-setup]] for setting up the vpn.&lt;br /&gt;
&lt;br /&gt;
The server must be instructed to route and forward any vpn traffic to its default gateway (wherever it is located).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* for a server that is connected with a public ip (e.g. 158.22.51.103)&lt;br /&gt;
&lt;br /&gt;
relevant section in /etc/rc.firewall&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# forward packets to and from vpn tunnel to local network&lt;br /&gt;
echo &amp;quot;1&amp;quot; &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
&lt;br /&gt;
# allow incoming OpenVPN traffic&lt;br /&gt;
$IPTABLES -A INPUT -p UDP -i $INT_IF --dport 655 -m state --state NEW -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
# vpn output rules&lt;br /&gt;
$IPTABLES -A OUTPUT -p ALL -s $VPN_IP -j ACCEPT&lt;br /&gt;
$IPTABLES -A OUTPUT -p ALL -s $VPN_NW -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
# Forwarding rules&lt;br /&gt;
# forward vpn packets to and from local lan&lt;br /&gt;
$IPTABLES -A FORWARD -i $VPN_IF -o $INT_IF -j ACCEPT&lt;br /&gt;
$IPTABLES -A FORWARD -i $INT_IF -o $VPN_IF -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
# Masquerading rules&lt;br /&gt;
# masquerade outgoing vpn traffic to local lan so we receive replies&lt;br /&gt;
$IPTABLES -t nat -A POSTROUTING -o $INT_IF -j MASQUERADE&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
add this to the client openvpn config file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
redirect-gateway def1 bypass-dhcp&lt;br /&gt;
dhcp-option DNS 10.8.9.1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
</feed>