On Fri, 2009-11-06 at 13:13 +0000, Marco Savo wrote:
> Hello,
> configuring iptables rules,
> how I can find out if one port number I want to use is already in
> use?
> example:
>
> $IPTABLES -t nat -I zone_wan_prerouting 1 -j ACCEPT --protocol udp
> --dport ${UDP_PORT} --destination localhost
> $IPTABLES -t nat -I zone_wan_prerouting 1 -j ACCEPT --protocol tcp
> --dport ${TCP_PORT} --destination localhost
> $IPTABLES -t nat -I zone_wan_prerouting 1 -j ACCEPT --protocol tcp
> --dport ${TCP_HOST_PORT} --destination localhost
>
> How I can check if these ports (UDP_PORT TCP_PORT TCP_HOST_PORT) are
> in use from another application?
----
you can use netstat - for example, I might check for port 10000...
# netstat -an|grep 10000
tcp 0 0 0.0.0.0:10000 0.0.0.0:* LISTEN
udp 0 0 0.0.0.0:10000 0.0.0.0:*
Craig
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
---------------------------------------------------
PLUG-discuss mailing list -
PLUG-discuss@lists.plug.phoenix.az.us
To subscribe, unsubscribe, or to change your mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss