Find the answer to your Linux question:
Results 1 to 2 of 2
Hello Everybody! I need help to setup a simple firewall for my webserver. I have install httpd on my server make a index.html and so on. There are 2 pc's ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Mar 2013
    Posts
    1

    Simple firewall in CentOs


    Hello Everybody!

    I need help to setup a simple firewall for my webserver.

    I have install httpd on my server make a index.html and so on.
    There are 2 pc's
    PC 1: ip range 192.168.4.0-63 | 255.255.255.192
    PC 2: ip range 192.168.4.64-127 | 255.255.255.192

    My plan with the firewall on the webserver is:

    PC 1 can se the index.html or rather is allowed on the webserver.

    PC 2 will be block/locked out from the webserver, so PC 2 can't se the index.html.

    Can someone make just a simple firewall for that with iptables..?

    Please say if you need some more information for helping me, i will hand it to you.

    In advance thank you very much

  2. #2
    Just Joined!
    Join Date
    Sep 2012
    Location
    Nashville, TN
    Posts
    98
    quicker way may be to add the pc 2's hostname to hosts.deny the downfall to this would be that pc 2 would not have any access. If you are wanting to block just the ip range for http access only then you would need to use ip tables. the rule would look like this

    Code:
    iptables -A INPUT -p tcp --destination-port 80 -s {IP/SUBNET-HERE} -j DROP
    service iptables save
    service iptables restart
    So if my networking experience serves me correctly you would put in 192.168.4.64 / 26 I believe.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •