Forum Home
Press F1
 
Thread ID: 67668 2006-04-03 02:36:00 block all traffic from outside NZ Greven (91) Press F1
Post ID Timestamp Content User
443292 2006-04-03 02:36:00 Where can I find out what IP address ranges are used in NZ? I want to set up a linux box to block all ssh connection attempts from outside New Zealand. Greven (91)
443293 2006-04-03 06:04:00 Get the ip to country database it has a free version

ip-to-country.webhosting.info


thats the proper place, there are a few scam sites that are after money
Morgenmuffel (187)
443294 2006-04-03 06:07:00 from their forum

how do i block or allow a specific country using iptables
ip-to-country.webhosting.info
might be newer question but that was the first one i saw

and also try this

ip-to-country.webhosting.info

probably closest to what you want
Morgenmuffel (187)
443295 2006-04-18 23:08:00 Most security settings in *nix have two categories: "deny" and "allow". Surely all you have to do is "deny all", then "allow" NZ. That's the most secure way to do it: stop everything, then accept only what you explicitly specify. Graham L (2)
443296 2006-04-19 00:02:00 Where can I find out what IP address ranges are used in NZ? I want to set up a linux box to block all ssh connection attempts from outside New Zealand.

How about changing SSH port and blocking 22. Most brute force / script kiddies just find port 22 and go nuts on it...change it to something e.g. a port with 4 digits and you will be pretty safe.

SSH file will be somewhere around here:
/etc/ssh/sshd_config

and change

Port 22

to

Port XXXX (where XXXX is your new port

Then restart ssh

# /etc/init.d/ssh restart

Just make sure you allow connections on that port before changing SSH port.

:thumbs:
superuser (7693)
443297 2006-04-19 01:32:00 It might even be better just to use public/private key authentication, rather than passwords for ssh access. The script kiddies should have a real hard time trying to brute force that... gibler (49)
443298 2006-04-19 03:38:00 from their forum

how do i block or allow a specific country using iptables
ip-to-country.webhosting.info
might be newer question but that was the first one i saw

and also try this

ip-to-country.webhosting.info

probably closest to what you want
Thanks. I tested the scripts on a mandriva box & it survived.
The next challenge is upgrading the kernel on the gentoo box to 2.6 so I can use the scripts on the gentoo box.

If anything goes wrong with upgrading the kernel, will there be any way to revive the box without restoring a backup? The people I'm doing this for back up their files, but not the complete system, so restoring everything would be a major pain in the ass.
Greven (91)
443299 2006-04-19 03:50:00 Gentoo should do the same as other distributions . In the /lib/modules/ . . tree thre should be a separate 2 . x . yy/ . . . subtree for each kernel version's driver modules . The kernels itself will have full version information in their names .

The boot manager (grub or lilo) can have multiple sections for each kernel you have . One is the default . Some kernel upgrade scripts automatically set up the previous version as something like "oldlinux" . I think that the clever people might have had experieneces with new improved systems which don't work . :D

You can do that manually . . . just make sure you have a hard copy of the old grub . conf or lilo . conf so you can get back to the old system . (I doubt if a scriopt would be silly enough to remove the old kernel, but you could save a copy under a different name, and paranoioa would make you save a compressed version of the /lib/modules/ tree . ;)
Graham L (2)
1