Click to See Complete Forum and Search --> : Connection Refusal


Sasquash
06-28-2003, 01:45 AM
I'm on Mandrake Linux 8.2

I want to select a particular IP Address to refuse all connection to and from.

How do I do this?

Thanks

Sasquash

seabass55
06-28-2003, 02:25 PM
iptables -A INPUT -s ipaddress -j DROP
iptables -A OUTPUT -d ipaddress -j DROP

sploo22
06-28-2003, 02:32 PM
If iptables doesn't work (that is, if you're using a 2.2 kernel) try using ipchains. Also, bear in mind that these settings will not be preserved once you shut down or reboot your computer.

nemesiox
06-28-2003, 02:47 PM
the easy way to do it is to edit

hosts.allow and hosts.deny

bwkaz
06-28-2003, 03:41 PM
Originally posted by nemesiox
the easy way to do it is to edit

hosts.allow and hosts.deny I'm not positive, though, that all services that you run will necessarily check these files. The kernel, for one, will not enforce them, so it's up to each individual user-space process (each service). If your (for example) ssh server doesn't honor the settings in these files, then the IP address that you want to block won't be blocked off from your ssh server.

iptables (or ipchains, but only use ipchains if you have to) would be a better way to go, IMHO. With a firewall, rather than just a config file, all user-space programs are forced to comply, whether they want to or not. Well, not really (the internal behavior of the userspace code is the same), but the kernel won't let connections through to these programs in the first place.