Page 2 of 7 FirstFirst 1234 ... LastLast
Results 11 to 20 of 69

Thread: HOWTO: Set a custom firewall (iptables) and Tips [Advanced user only]

  1. #11
    Join Date
    Jun 2005
    Location
    France
    Beans
    7,100
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: HOWTO: Set a custom firewall (iptables) and Tips [Advanced user only]

    1) i can't explain you why but it seems that it is the case as i never needed any udp port for http neither saw any iptables rule opening an UDP port for http.

    2) You shouldn't need to open any input port for https, these rules are working fine for me. What https website give you problems with these rules ? Give me a link so i can test it on my computer since i use the same rules.

  2. #12
    Join Date
    May 2007
    Beans
    4

    Re: HOWTO: Set a custom firewall (iptables) and Tips [Advanced user only]

    Thank you for your reply.

    Quote Originally Posted by frodon View Post
    1) i can't explain you why but it seems that it is the case as i never needed any udp port for http neither saw any iptables rule opening an UDP port for http.
    I can't find the reference now but I think I saw yesterday that https needs udp for some kinds of negotiation - so I now assume that this means http doesn't require it, as you say.

    However, I still don't really understand why http has the bit '-m state --state NEW,ESTABLISHED' rather than '-m tcp'. What other states are being dropped in http that are not being dropped in https?

    Quote Originally Posted by frodon View Post
    2) You shouldn't need to open any input port for https, these rules are working fine for me. What https website give you problems with these rules ? Give me a link so i can test it on my computer since i use the same rules.
    I haven't got this on an external server yet, but I hope to do so in the next few days. I can confirm that I have had to make both http and https rules into -i rather than -o.

    Regards,
    Geoff

  3. #13
    Join Date
    Jun 2005
    Location
    France
    Beans
    7,100
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: HOWTO: Set a custom firewall (iptables) and Tips [Advanced user only]

    Quote Originally Posted by gegard View Post
    I haven't got this on an external server yet, but I hope to do so in the next few days. I can confirm that I have had to make both http and https rules into -i rather than -o.

    Regards,
    Geoff
    If you are not hosting webserver you shouldn't need to open anything on INPUT packets for http and https the less input ports you allow the better.
    You some things to test regarding this as these rules are pretty common and should work without any problem.

    Did you modify some parts of the script ?
    because the "iptables -A FIREWALL -i eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT" should already deal with all these input packets without the need of any additional rule at least for http and https.
    Last edited by frodon; February 28th, 2008 at 01:17 PM.

  4. #14
    Join Date
    Oct 2007
    Location
    Malaysia
    Beans
    37
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: HOWTO: Set a custom firewall (iptables) and Tips [Advanced user only]

    hi
    just wondering..how am i going to intergrate moblock to the script?

  5. #15
    Join Date
    Jun 2005
    Location
    France
    Beans
    7,100
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: HOWTO: Set a custom firewall (iptables) and Tips [Advanced user only]

    I don't know, it mainly depends how moblocks set rules. Depending of the apps which motivate you to run moblock you have some other alternatives, many apps have plugins to do blocks these IPs at the apps level like the "safepeer" azureus plugin do.
    If Moblock don't play well with this script you can still try ipblock :
    http://ubuntuforums.org/showthread.php?t=530183

    Anyway if i remember well what users told with my other iptable tutorial for beginners moblock should work if started after the firewall script :
    http://ubuntuforums.org/showpost.php...0&postcount=79

  6. #16
    Join Date
    Oct 2007
    Location
    Malaysia
    Beans
    37
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: HOWTO: Set a custom firewall (iptables) and Tips [Advanced user only]

    Hi,
    Let's say i would like to try another type of firewall for comparison how to completely disable / uninstall this firewall.. My intention just don't want any conflicts on my iptables.

  7. #17
    Join Date
    Jun 2005
    Location
    France
    Beans
    7,100
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: HOWTO: Set a custom firewall (iptables) and Tips [Advanced user only]

    If you want to uninstall the scripts you can just delete the created scripts or if you just want to disable it comment all the lines of the /etc/init.d/firewall script and reboot.

  8. #18
    Join Date
    May 2007
    Beans
    4

    Re: HOWTO: Set a custom firewall (iptables) and Tips [Advanced user only]

    My sceniario is a web server using both HTTP and HTTPS, with an SSL login. I've got a reverse proxy running and various other ports in use that I want to protect using iptables. The only inputs and outputs I want are on 22, 80 and 443. I don't want outputs from other ports to get outside, nor to receive traffic on other ports.

    Quote Originally Posted by frodon View Post
    Did you modify some parts of the script ?
    because the "iptables -A FIREWALL -i eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT" should already deal with all these input packets without the need of any additional rule at least for http and https.
    The more I think about it, the further from understanding I think I become! So I'll read other resources to get a wider view of iptables. Sorry for my increasing (awareness of) ignorance.

    Thank you for your replies.

    Regards,
    Geoff
    Last edited by gegard; March 3rd, 2008 at 01:21 PM.

  9. #19
    Join Date
    Jun 2005
    Location
    France
    Beans
    7,100
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: HOWTO: Set a custom firewall (iptables) and Tips [Advanced user only]

    Ha ok you should have told first that you are using http, https servers as in this case you need indeed to open the port as input too.

    You should only need to add a line per port to allow input traffic on the 3 ports you use for your server, for https it would be :
    Code:
    iptables -A TRUSTED -i eth0 -p udp -m udp --dport 443 -j ACCEPT

  10. #20
    Join Date
    May 2007
    Beans
    4

    Re: HOWTO: Set a custom firewall (iptables) and Tips [Advanced user only]

    Quote Originally Posted by frodon View Post
    Ha ok you should have told first that you are using http, https servers as in this case you need indeed to open the port as input too.
    That explains it! Thank you for your help.

    Regards,
    Geoff

Page 2 of 7 FirstFirst 1234 ... LastLast

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
  •