0

I'm running Debian 6 32Bit I finally just setup my iptables, but I cannot seem to connect to any external server from my box

-A INPUT -i lo -j ACCEPT
-A INPUT -p tcp -m tcp --dport 443 -j ACCEPT
-A INPUT -p tcp -m tcp -m multiport -j ACCEPT --dports 80,22,53,47240,3306
-A INPUT -p udp -m udp -m multiport -j ACCEPT --dports 80,22,53,47240,3306
-A INPUT -s 127.0.0.1 -j ACCEPT
-A INPUT -j DROP

Also, is it necessary for me to allow 127.0.0.1?

1 Answer 1

2

Add

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

to the beginning to allow incoming answer packages.

4
  • im getting an error with that unknown "m"
    – Yusuf Ali
    Feb 11, 2014 at 11:55
  • I have edited my answer because the dash was missing before the m.
    – Stone
    Feb 11, 2014 at 11:56
  • thankyou, can you shed some light on why this needs to be added?
    – Yusuf Ali
    Feb 11, 2014 at 12:16
  • Because if you connect to an outer box it's OK that your packages can reach that box but if you filter out responses than you can't communicate. This rule says that all traffic for established connections and also related packages can get in.
    – Stone
    Feb 11, 2014 at 12:48

Not the answer you're looking for? Browse other questions tagged .