iptables openvpn forward selectively from eth to tun

Posted by Bryan Hunt on Super User See other posts from Super User or by Bryan Hunt
Published on 2011-06-15T13:22:15Z Indexed on 2012/06/12 4:42 UTC
Read the original article Hit count: 547

Filed under:
|
|

Simple for those who know, indecipherable for those who don't...

I'm running openVPN on (hypothetical) 66.66.66.66, I want to FORWARD incoming traffic, arriving on interface eth0 to interface tun0.

It would also be nice to filter - based on destination IP address. I'm doing the NAT later on, but like to lock down early wherever possible.

So onto the main course...

This works:

  #Enable forwarding from eth0 to tun0
  iptables -A FORWARD -i eth0 -o tun+ -j ACCEPT

But this doesn't pass any packets whatsoever:

 #Stricter version
 iptables -A FORWARD -i eth0 -o tun+ --dst 66.66.66.66  -j ACCEPT

Am I being unacceptably foolish?

© Super User or respective owner

Related posts about tunnel

Related posts about iptables