View Full Version : [ubuntu] UFW blocking traffic over a specific interface
Oz0n3
May 9th, 2009, 07:37 PM
I recently installed Ubuntu for the first time and I am coming back to linux after spending the last few years exclusively using OS X. The box I built has a single purpose and that is to run and download bittorrents over a vpn connection. My question is, can ufw block traffic over a specific interface? I want to block all bittorrent traffic going over eth0 but allow bittorrent traffic going over ppp0. I am pretty sure I can do this in iptables, but thought I would see if ufw was capable of setting this up before figuring out the iptables command.
Thanks for any help
spasticfraggle
September 10th, 2009, 01:32 PM
Did you ever find a solution? I am looking for exactly the same thing
tryinghard
October 27th, 2009, 01:09 AM
so am I but since iptables and ufw works oin the same things there nust be a way. :) I hope.:)
The Cog
October 28th, 2009, 09:08 AM
I'm not familiar with ufw/gufw, but I do know they are just front-ends to simplify configuring iptables. It may well be that the stuff you want to do cannot be done in ufw, and that you may have to bite the bullet and use iptables commands directly with scripts. Trouble is, once you manually modify the iptables rules, you cannot go back to the higher-lever confgiuration utilities because they will overwrite all your work again.
If you google for linux iptables configuration script, you will find many examples.
nathan726
May 27th, 2011, 07:05 PM
I know this is an old topic, but just wanted to share a solution:
By default, ufw applies rules to all available interfaces. To
limit this, specify DIRECTION on INTERFACE (interface aliases
are not supported). For example:
sudo ufw allow in on eth0
sudo ufw deny out on eth0
sudo ufw deny in on eth0 to any from any port 80 proto tcp
vBulletin® v3.8.7, Copyright ©2000-2012, vBulletin Solutions, Inc.