Discussion Locked

ipchains firewall

0 helpful
4 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

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.

4 replies

by mckaytech

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

by cp409sd

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.

This discussion is closed to new replies.