- Local variables for this post, adjust to fit your setup:
- OpenVPN client server IP
- 192.168.1.200
- Remote network
- 172.16.1.0/24
- Add this to the client server that is using OpenVPN to connect to the remote server:
- sudo iptables -A POSTROUTING -o tun0 -j MASQUERADE
- as root user, do
- echo 1 > /proc/sys/net/ipv4/ip_forward
- Add this to your local computer
- Linux:
- ip route add 172.16.1.0/24 via 192.168.1.200
- Mac:
- route -n add 172.16.1.0/24 192.168.1.200
NOTE: take a look at /etc/sysctl.conf if you want the ip_forward to last through reboots of client server: net.ipv4.ip_forward=1
No comments:
Post a Comment
Note: only a member of this blog may post a comment.