Search code examples
linuxnetwork-programmingiptables

Redirect traffic over interface for specific destination


I´m new on stackoverflow and couldn´t find an answer for my question so far by searching on Google so I thought you guys could maybe help me.

What I´m currently trying to do is the following: I want to redirect network traffic over a VPN interface (for example: tun0) but only if I want to surf to a specific destination. For example: If I want to watch a video on YouTube the traffic should not get redirected but if I want to watch a video on hulu.com the traffic should get forwarded through the VPN interface. (I´m not an American so without a VPN connection I do not have access to hulus videos.) Is something like that possible with iptables or some other way? Please help.

Thank you in advance for your efforts and I´m sorry if a similar question has already been asked but I couldn´t find it.


Solution

  • I think you can give a try with the commands Described Here. Ask for more if not solved.