cscadmin
Hello Everyone,
I am new to openvpn and have been trying to get it going so I bought the book, "OpenVPN 2 Cookbook" about 2 months ago. I found the recipe i am going to use for now, if anyone has the book it is on page 71 in chapter 3, I successfully set up the tap style connection with certificates and it worked fine other than 1 problem. I wanted to use iptables because I use it already for port forwarding (ps I run debian) to my lan behind it I want to be able to access thos machines from home and maybe add on a licence for more users in the future. I'm still pretty much a rookie at iptables to I use it to route the Internet and port forward but it still confuses me at times, so here's the problem.
Server running Openvpn internal network 192.168.70.0 one I want to use for VPN 192.168.71.0 the machine is connected to the Internet on eth0 and on the internal network with eth1. The example give this ip tables rule
"iptables -t nat -I POSTROUTING -i tap+ -o eth0 -s 192.168.99.0/24 -j MASQUERADE" I changed that network to 192.168.71.0
And the terminal returns a not so nice reply....
root@**:/etc/openvpn# iptables -t nat -I POSTROUTING -i tap+ -o eth0 -s 192.168.71.0/24 -j MASQUERADE
iptables v1.4.8: Can't use -i with POSTROUTING
Try `iptables -h' or 'iptables --help' for more information.
root@**:/etc/openvpn# iptables -t nat -I POSTROUTING -i tap+ -o eth0 -s 192.168.71.0/24 -j MASQUERADE
Anyone else run into this problem? I'm just not that iptables savy.
Thank You to anyone who responds.
janjust
Hi,
first of all, thanks for buying my book 🙂
second, thanks for finding a bug in my book :ugeek:
third, I've updated the 'errata' page.
Can you try the iptables rule without the '-i tap+' ? I have no clue how that ended up in there.
cscadmin
No problem, I like it, I like how it's set up were I live I can't find much places for schooling, I have to drive an hour from my home just anything related to opensource training so I gave up and filled up my book self but I'll try it today.
Thanks Again