Skip to content

Instantly share code, notes, and snippets.

@amalc
Created December 19, 2012 00:30
Show Gist options
  • Save amalc/4333390 to your computer and use it in GitHub Desktop.
Save amalc/4333390 to your computer and use it in GitHub Desktop.
Setting up forwarding on client for OpenVPN for client to reach each other on CentOS 6.xx
service openvpn start
# Now we need to enable IP forwarding. So open the file /etc/sysctl.conf and set ‘net.ipv4.ip_forward’ to 1.
net.ipv4.ip_forward = 1
# To make the changes to sysctl.conf take effect, use the following command.
sysctl -p
# Route Iptables:
# The rule below will work fine on xen and KVM based VPS’s but for OpenVZ use the OpenVZ iptable rule instead:
# iptables -t nat -A POSTROUTING -s youropenvpnendpointaddress/yournetmask -o eth0 -j MASQUERADE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment