Odd problem with MIP
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I have the following script to generate a firewall. For some reason, when I have the rules ON, I can not send mail through the mail proxy running on port 8027 (anti-spam measure). With the rules disabled (service iptables stop on RH 7.3 box) I can send mail fine.
Any help is appreciated!
Thanks
- --- Dan Egli
!/bin/bash
IPT=/sbin/iptables
# step 1 - ensure iptables are loaded modprobe ip_conntrack_ftp # that should pull in all dependant modules #step 2 SET DEFAULT POLICY
$IPT -P INPUT DROP
$IPT -P OUTPUT ACCEPT
$IPT -P FORWARD DROP
# step 3 FLUSH THE TABLES $IPT -F INPUT $IPT -F OUTPUT $IPT -F FORWARD $IPT -t nat -F PREROUTING $IPT -t nat -F POSTROUTING $IPT -t nat -F OUTPUT
# setp 4 - setup rules # $IPT -A INPUT -p tcp -m multiport --dports smtp,ftp,telnet,ssh,137,138,139,111 -j ACCEPT $IPT -A INPUT -p tcp -i eth0 -m multiport --dports telnet,ssh,domain,nntp,ntp,printer,pop3,imap,http,https,netbios-ssn,netbios-dgm - - j ACCEPT $IPT -A INPUT -p tcp -m multiport --dports netbios-ssn,netbios-dgm,netbios-ns,4000,pgpkeyserver,mysql,sunrpc,rndc,8027 - -j ACCEPT $IPT -A INPUT -p udp -i eth0 -m multiport --dports domain,ntp,route,137,138,139 -j ACCEPT # $IPT -A INPUT -p udp -i eth1 -m multiport --dports 137,138,139,111 - -j ACCEPT $IPT -A INPUT -i lo -j ACCEPT # $IPT -A INPUT -p tcp -i eth1 -m multiport --dports 137,138,139,111 - -j ACCEPT # $IPT -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT # $IPT -A INPUT -j LOG --log-prefix "Blocked Packet!: "
$IPT -A FORWARD -i eth0 -j ACCEPT
$IPT -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT # $IPT -A FORWARD -j LOG
# step 5 - enable NAT # $IPT -t nat -A POSTROUTING -o eth0 -j MASQUERADE
(note some lines are commented out either because they were experiments, or because they are for configuration not present on the machine YET).
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (MingW32) - WinPT 0.7.93
iD8DBQE+GnbsxQEzeXtVwzoRAk51AJ9o95E3XN3md2DvkOommZTDZfLkPACdE7PY ZTyP8HuDLcbzVfwKUK7lOyo=
=dhIj
-----END PGP SIGNATURE-----