Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How to block a specific protocol using iptables firewall? For example block Yahoo messenger?

share|improve this question

Well, in this case you probably want to block the ports Yahoo Messenger uses, not the protocol (which is TCP/UDP, used by almost everything else).

Based on this list, I would start with port 5050 outbound and perhaps add more:

sudo iptables -A OUTPUT -p tcp --dport 5050 -j DROP

Once you have a set of rules that you have determined is sufficient, don't forget to save them with iptables-save (or they will be lost upon reboot).

share|improve this answer
it didn't work :/ – alsadi90 Jul 29 '12 at 10:14
I didn't say it would, you need to find out which ports are being used right now, and if there isn't a current list, use something like Wireshark. It's complicated, sorry... – izx Jul 29 '12 at 10:15

Your Answer


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.