Blog » Blog Entry

Eggdrop iptables firewall rules

December 6, 2006

Do you run a bunch of networked eggdrops on Linux? You realize they talk to each other over telnet which is unencrypted right? You didn't know that? Hmm.. Here's how you lock your hub bot down so it only talks to leaf bots from trusted hosts:

#!/bin/bash

LEAFS=("12.34.56.78" "21.43.65.87")

for LEAF in ${LEAFS[@]}; do
  iptables -A INPUT -s ${LEAF} -i eth0 -p tcp \
    --dport 3333 -j ACCEPT
  iptables -A INPUT -s ${LEAF} -i eth0 -p tcp \
    --dport 2010:2020 -j ACCEPT
done

iptables -A INPUT -i eth0 -p tcp --dport 3333 -j DROP
iptables -A INPUT -i eth0 -p tcp --dport 2010:2020 -j DROP
Tags: linux, firewall, eggdrop, iptables

« Multi-threaded OpenGL WoW on Intel Macs Debian rc.local howto »

Danger

By: Anticept <Anticept at anticeptsworld dot net>

Posted: 1 year ago

Be wary of the iptables -F command in this script. If you have no physical access to the box, you will block yourself out if your iptables default access is to drop packets.

No more danger..

By: destiney <webmaster at destiney dot com>

Posted: 9 months ago

I removed the `iptables -F` from the script.

Add a comment:

Title:

Comment:

Name:

Email: