General discussion

  • Creator
    Topic
  • #2074328

    ipchains firewall

    Locked

    by cp409sd ·

    I have an ipchains firewall up and working. I would now like my box to sync its time up to a time server, about once a week. Problem is that I cannot figure out what port(s) it uses to communicate through.

    I figured an easy way to find out was to make a small script that allowed everything through and logged everything as well, so that I could just look at the log and see what ports it uses, and then make the proper entry in my firewall script. So that is what I did. Unfortunetely, the script I wrote lets all traffic through the firewall, but it does not seem to be logging any ports it is going through. Here is the small script I wrote:

    ipchains -F
    ipchains -P input ACCEPT
    ipchains -P output ACCEPT
    ipchains -P forward ACCEPT
    ipchains -A input -j ACCEPT -l
    ipchains -A output -j ACCEPT -l
    ipchains -A forward -j ACCEPT -l

    Please let me know if there if a better way to do what I am trying to do. Thanks.

All Comments

  • Author
    Replies
    • #3766521

      ipchains firewall

      by mckaytech ·

      In reply to ipchains firewall

      By convention, Network Time Protocol (NTP) uses the well-known port of 123.

      Most of the usual TCP and UDP services are associated with one of these known ports – the list is usually found in /etc/services and it’s a lot easier to just look at the list than to write a script to capture the packets red-handed.

      paul

      • #3789609

        ipchains firewall

        by cp409sd ·

        In reply to ipchains firewall

        Thank you for your help. I am interested in how to actually track down what ports are being used.

        This will help me for this situation, but I was hoping to find a way to figure out what ports a program uses if I did not have this information.

    • #3789619

      ipchains firewall

      by d’anno ·

      In reply to ipchains firewall

      Here’s a link to some common TCP/IP and UDP reserved port numbers:

      http://www.sockets.com/services.htm

Viewing 1 reply thread