Iptables mark incoming packet - vpn routing

Posted by Tom on Super User See other posts from Super User or by Tom
Published on 2014-06-02T11:32:59Z Indexed on 2014/06/06 9:29 UTC
Read the original article Hit count: 279

Filed under:
|
|
|
|

I have connected my home to my workplace for out of house backup reasons through openvpn. The connection is working nicely. At work I have 5 fixed IP addresses. Now I would like to assign one of these IP addresses to be forwarded to my home machine. I have confirmed packet arrival at my home machine with tcpdump. The problem is that my default route at home is NOT the tun0 (naturally), but eth0 to my own ISP. So I created a separate routing table to route my tun0 packets back to where they belong, but do not how to mark the incoming packet which arrive through tun0 with iptables, so I can drive them back.

I do not want any port restrictions, but only what comes from tun0 should leave through tun0

thanks tom

© Super User or respective owner

Related posts about linux

Related posts about routing