Web Hosting Talk







View Full Version : iptables


clocker1996
01-24-2002, 06:59 PM

hypernatic.net
01-24-2002, 08:31 PM
Ehm are we talking apache here?

If so, make this:
a file called .htaccess

and put in:


order deny,allow
deny from all
allow from IP.IP.IP.IP

clocker1996
01-24-2002, 08:47 PM
I dont need this for apache....

RutRow
01-24-2002, 11:13 PM
You would need to reverse the order. Rules go top down until they meet the one that applies.

iptables -A INPUT -i eth0 -p tcp -s 216.18.0.178 --dport 50 -j ACCEPT
iptables -A INPUT -i eth0 -p tcp --dport 50 -j DROP

clocker1996
01-25-2002, 01:04 AM

RutRow
01-25-2002, 01:10 AM
Hmmm... I assure you that those rules will work. I use a similar setup. You must have other rules that conflict.

Try running

iptables -L -v -n

to see what other rules you have and what the default policy is. You will need to widen your terminal display to see it correctly. I set mine to 150 cols to get the right view.

clocker1996
01-25-2002, 02:05 PM

clocker1996
01-25-2002, 02:47 PM
Got it, thanks