Skip to contentSkip to conversation

wiered problem

DISCUSSION azeem ahmad 2 participants 3 messages May 20, 2004

lore
Share & tools
lore
#0 lore raw

i m running iptables, squid proxy, bind, and samba on same machine. it works as a server for my LAN
the script that i ran is as follow but when i stat these rules the browsing stops. the squid proxy is listening on port 8080. what can be the problem. while netbios sharing is doing okey.
------------------------------------------------------------------------------------------------------------------------------
iptables -P INPUT ACCEPT
iptables -A INPUT -i eth0 -p tcp --dport 8080 -j ACCEPT
iptables -A INPUT -i eth0 -p udp --dport 8080 -j ACCEPT

iptables -A INPUT -i eth0 -p tcp --dport 22   -j ACCEPT
iptables -A INPUT -i eth0 -p tcp --dport 53   -j ACCEPT
iptables -A INPUT -i eth0 -p udp --dport 53   -j ACCEPT
iptables -A INPUT -i eth0 -p tcp --dport 139  -j ACCEPT

---------------------------------------------------------------------------------------------------------------------------

Regards
Azeem

_________________________________________________________________
Add photos to your e-mail with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail

#1 lore raw
Quoted 2 lines · azeem ahmad

i m running iptables, squid proxy, bind, and samba on same machine. it works as a server for my LAN

Ugh! So much for the security rule that you shouldn't run applications
(which potentially have vulnerabilities) on a firewall :)

Quoted 11 lines

the script that i ran is as follow but when i stat these rules the browsing stops. the squid proxy is listening on port 8080. what can be the problem. while netbios sharing is doing okey.

iptables -P INPUT ACCEPT
iptables -A INPUT -i eth0 -p tcp --dport 8080 -j ACCEPT iptables -A INPUT -i eth0 -p udp --dport 8080 -j ACCEPT

iptables -A INPUT -i eth0 -p tcp --dport 22   -j ACCEPT
iptables -A INPUT -i eth0 -p tcp --dport 53   -j ACCEPT
iptables -A INPUT -i eth0 -p udp --dport 53   -j ACCEPT
iptables -A INPUT -i eth0 -p tcp --dport 139  -j ACCEPT

I cannot see the purpose of any of the above rules, once you have stated the first one.

The default policy is ACCEPT. That means all packets are going to be
ACCEPTed. There is no point in ACCEPTing specific packets after that,
unless you also have some DROP or REJECT rules which you haven't shown us.

Regards,

Antony

PS: What is UDP port 8080 for?

Signature · 7 lines
Your work is both good and original.  Unfortunately the parts that are good 
aren't original, and the parts that are original aren't good.

 - Samuel Johnson

                                                     Please reply to the list;
                                                           please don't CC me.
#2 lore raw
In reply to azeem ahmad
Quoted 5 lines · azeem ahmad

i m running iptables, squid proxy, bind, and samba on same machine. it works as a server for my LAN
the script that i ran is as follow but when i stat these rules the browsing stops. the squid proxy is listening on port 8080. what can be the problem.

Quoted 7 lines

iptables -P INPUT DROP [ correction from your later posting ]
iptables -A INPUT -i eth0 -p tcp --dport 8080 -j ACCEPT iptables -A INPUT -i eth0 -p udp --dport 8080 -j ACCEPT

iptables -A INPUT -i eth0 -p tcp --dport 22   -j ACCEPT
iptables -A INPUT -i eth0 -p tcp --dport 53   -j ACCEPT
iptables -A INPUT -i eth0 -p udp --dport 53   -j ACCEPT
iptables -A INPUT -i eth0 -p tcp --dport 139  -j ACCEPT

Squid may be listening on port 8080, but what about the replies it gets from remote web servers after it sends out a request on port 80?

I think you need a "reply packet" rule here:

iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

I recommend you put this rule at the top of the list.

Regards,

Antony.

Signature · 4 lines
Most people have more than the average number of legs.

                                                     Please reply to the list;
                                                           please don't CC me.