Linux‎ > ‎Iptables‎ > ‎

Block Messengers

The information below sets up firewall rules to block outgoing connections on the default destination ports that particular instant messenger programs use.

Be aware that this is not a complete solution, as most instant messenger programs are designed to circumvent these sort of firewall rules, and as such can also use commonly open ports such as the http port, 80. As such, unless you also block these often essential ports such as 80, users will be able to still use these types of programs.

To block the default ports used by Instant Messenger programs from being able to get out through the firewall add the following rules to the Snapgear under

For firmware prior to version 3 Firewall -> Rules 'in addition to the built in rules':

For version 3 firmware Firewall 'Packet Filtering' -> 'Custom Firewall Rules'

MSN Messenger:

iptables -A Filter -p tcp --dport 1863 -j REJECT

Yahoo Messenger:

iptables -A Filter -p tcp --dport 5000:5001 -j REJECT iptables -A Filter -p udp --dport 5000:5001 -j REJECT iptables -A Filter -p tcp --dport 5050 -j REJECT

AIM:

iptables -A Filter --dport 5190 -j REJECT iptables -A Filter -d login.oscar.aol.com -j REJECT

ICQ:

iptables -A Filter -p tcp --dport 1024 -j REJECT iptables -A Filter -p udp --dport 4000 -j REJECT iptables -A Filter -d www.icqproxy.com -j REJECT

Other possibilities..

iptables -A Filter -d gateway.messenger.hotmail.com -j REJECT iptables -A Filter -p tcp --dport 5050 -j REJECT iptables -A Filter -p udp --dport 4000 -j REJECT iptables -A Filter -d 205.188.0.0/16 -j REJECT iptables -A Filter -d 64.12.0.0/16 -j REJECT iptables -A Filter -d 216.122.100.172/32 -j REJECT iptables -A Filter -d www.compute.info -j REJECT
Comments