Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I want to force the use of VPN using iptables, therefore while VPN is disabled no outgoing traffic shall be allowed (except maybe some DHCP stuff...). Now i guess I could just block everything not going to the address of the VPN server? But then I still want to do another thing: I don't want to allow all traffic for some application, e.g. some shall have no internet access, some shall have only access to specific IP addresses. Is something like "application level" possible using iptables? Does iptables recognize, from which application traffic originates? And I guess when using VPN I can't filter for the real destination that comes behind the vpn server as it is probably encrypted in the vpn packets?

share|improve this question

1 Answer 1

http://serverfault.com/questions/128357/routing-application-traffic-through-specific-interface

use iptables -m owner. This lets you setup OUTPUT chain rules based on UID, GID, PID, SID and command name.

share|improve this answer
    
Note that when you create a VPN connection, another interfaces is generally created and used. The traffic for the VPN can be routed to just that interface, as in the link. –  Arcege Apr 7 '12 at 1:34

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.