Go Back   TechArena Community > Technology > Networking & Security
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read SiteMap

Tags: , , ,

Sponsored Links



Block the entire range of IP address in Linux using hosts.deny

Networking & Security


Reply
 
Thread Tools Search this Thread
  #1  
Old 29-05-2009
Sonic's Avatar
Member
 
Join Date: Feb 2008
Posts: 326
Block the entire range of IP address in Linux using hosts.deny

I want to block some IP addresses on my Linux server from remote access. Is this possible? I want to block the entire range of 58.50.0.0. I think I need to put this information on hosts.deny file but how can I do that? Can you help me? Is there any simpler way to achieve this?
Reply With Quote
  #2  
Old 29-05-2009
Big Fish's Avatar
Member
 
Join Date: Jan 2006
Posts: 3,514
Re: Block the entire range of IP address in Linux using hosts.deny

I am not sure if sshd would respond to /etc/hosts.deny. However you can try installing apf firewall use "apf -d IP_address" to block IP address range.
__________________
Truly, if there is evil in this world, it lies within the heart of mankind. -Edward D. Morrison

Old soldiers never die- they just fade away.
Reply With Quote
  #3  
Old 29-05-2009
Zachary's Avatar
Member
 
Join Date: Jan 2006
Posts: 3,932
Re: Block the entire range of IP address in Linux using hosts.deny

hosts.deny file describes the names of the hosts which are not allowed to use the local INET services, as decided by the '/usr/sbin/tcpd' server. So add the IP address into hosts.deny file using:

Code:
ALL: ip_address
For example:

Code:
ALL: 58.50.0.0
__________________
90% of everything is crap...except for crap, because crap is 100% crap
Reply With Quote
  #4  
Old 29-05-2009
Aleksandra's Avatar
Member
 
Join Date: May 2008
Posts: 993
Re: Block the entire range of IP address in Linux using hosts.deny

You can even try droping all packets from that network in your firewall using something like:

Code:
# iptables -I INPUT -j DROP -s 58.50.0.0/16
However if you are using "ALL" statement just remember that you must use a comma separator after each /etc/hosts.deny entry:

Code:
ALL: ip_address1, ip_address2, ip_address3, ....
Reply With Quote
Reply

  TechArena Community > Technology > Networking & Security


Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Block the entire range of IP address in Linux using hosts.deny"
Thread Thread Starter Forum Replies Last Post
AMD announces availability of its entire range of products on The IT Depot Amd Athlon Web News & Trends 4 06-04-2010 01:27 PM
How can I block or ban Ip address range? Drogbaa Windows Software 3 18-06-2009 12:12 PM
DHCP deny mac address HWhite Windows Server Help 5 28-03-2009 01:26 AM
W2k and Wxp IE - How to allow only specific websites and block all others sites using hosts file? KS Teo Window 2000 Help 1 09-06-2008 04:37 AM
Block Yahoo Messenger Through Hosts File Khalid Naeem Vista Help 0 28-09-2007 10:46 PM


All times are GMT +5.5. The time now is 05:55 AM.