I would need help in this case:
I have a tap0 interface at my openvpn server with ip 10.22.8.1
My eth0 interface is 192.168.1.155
192.168.1.0 - 0.0.0.0 - 255.255.255.0 - eth0
10.22.8.0 - 10.22.8.1 - 255.255.255.0 - tap0
0.0.0.0 - 192.168.1.10 - 0.0.0.0 - eth0
With the following rules I can ping from my lan to the vpn clients:
iptables -v -t nat -A PREROUTING -i eth0 -d 192.168.10.0/24 -j NETMAP --to 10.22.8.0/24
iptables -t nat -A POSTROUTING -o tap0 -j MASQUERADE
I have a route 192.168.10.0 in the lan client to my vpn server. Tcpdump shows that packets redirect from eth0 to tap0 and the netmap works.
But when I try the opposite I can not ping from the vpn clients to my lan
iptables -v -t nat -A PREROUTING -i tap0 -d 10.22.8.0/24 -j NETMAP --to 192.168.1.0/24
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
The tcpdump shows that packets reach tap0 but does not go to the eth0. It is like the netmap rule would not work.
Could you help me? What am I doing wrong?