Results 1 to 4 of 4

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

  1. #1
    Join Date
    Feb 2008
    Posts
    324

    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?

  2. #2
    Join Date
    Jan 2006
    Posts
    3,792

    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.

  3. #3
    Join Date
    Jan 2006
    Posts
    4,221

    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

  4. #4
    Join Date
    May 2008
    Posts
    991

    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, ....

Similar Threads

  1. Block Yahoo Messenger Through Hosts File
    By Ian Wilson in forum Vista Help
    Replies: 1
    Last Post: 30-04-2013, 11:53 AM
  2. Multiple hosts with same IP address
    By TSAM in forum Windows Server Help
    Replies: 13
    Last Post: 09-08-2010, 11:55 PM
  3. How can I block or ban Ip address range?
    By Drogbaa in forum Windows Software
    Replies: 3
    Last Post: 18-06-2009, 11:12 AM
  4. DHCP deny mac address
    By HWhite in forum Windows Server Help
    Replies: 5
    Last Post: 28-03-2009, 12:26 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,605,872.70589 seconds with 17 queries