All solution credit goes to above blog.
(below is copy and paste from blog)
- Enable IPv4 forwarding in the kernel. You can do this by the following statement:
Enable IPv4 forwarding in the kernel. You can do this by the following statement:
echo 1 > /proc/sys/net/ipv4/ip_forward
However, to make it persistent, ie do it automatically on reboot, modify /etc/sysctl.conf and uncomment the equivalent line.
echo 1 > /proc/sys/net/ipv4/ip_forward
However, to make it persistent, ie do it automatically on reboot, modify /etc/sysctl.conf and uncomment the equivalent line.
- Next, enable the NAT. Replace the placeholder with the actual IP address of the VPN server.
Next, enable the NAT. Replace the placeholder with the actual IP address of the VPN server.
iptables -A POSTROUTING -t NAT -j SNAT --to-source <VPN IP Address>
This line tells netfilter to rewrite packets so the source IP is replaced with the VPN’s IP address.
iptables -A POSTROUTING -t NAT -j SNAT --to-source <VPN IP Address>
This line tells netfilter to rewrite packets so the source IP is replaced with the VPN’s IP address.
In my case, <VPN IP Address>
= 192.168.0.50