Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Trouble managing ports from the command line Post 302840219 by csorhand on Monday 5th of August 2013 03:05:25 AM
Old 08-05-2013
syregnar86,


is this more on firewall(opening ports/closing ports) or more into UNIX sockets ports? Are your question related to ports like (ftp / ssh / sftp)

You have to make it clear.

Ports are open and closed by applications ( like ftp / ssh / http). If you close the applicaiton it will also close the port.


To view what ports is intended to what application is it located in /etc/services that file specify some of the known ports. some applications are not there but those who are common are indicated in the mentioned file.

To view any existing ports ( ESTABLISHED / LISTENING ports on your unix machine. you can use the unix command NETSTAT

ex:
netstat -an | grep ESTAB

hope that helps.
 

7 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

trouble using mailx command

Hi. I have been trying to send mail using the mailx command. I also tryed to use the mail command. The thing is that when I try to send the email, i receive automatically to my mailbox a DAEMON response sayng that the mailhost is unknown... The syntax I am using is this: $mailx -s "this... (2 Replies)
Discussion started by: ldrojasm
2 Replies

2. UNIX for Dummies Questions & Answers

command to view ports being used

Is there a command that will show me all ports being used? I thought maybe the "lsof" command would show me, but I'm not seeing anything. Thanks, Jeff (2 Replies)
Discussion started by: lawadm1
2 Replies

3. Shell Programming and Scripting

Command to set ports

Hi to everyone here, I have wrote a script to install and set up parental controls with dansguardian and tinyproxy,(fedora) it works quite well except that i have to manually set http proxy to 127.0.0.1 and port 8080 in firefox, is there a way to do this by command line/script? Id appeciate any... (2 Replies)
Discussion started by: dave123
2 Replies

4. Shell Programming and Scripting

sed multiple line trouble

Hello, im writing a script that validates a URL (the parameter) using http://validator.w3.org first it downloads the site (the output line I want is stored in the h2 field of the site's html. wget http://validator.w3.org/check?url=$1 2> /dev/null sed -n '/<h2/p' check?uri=$1 | sed 's/... (5 Replies)
Discussion started by: drareeg
5 Replies

5. Shell Programming and Scripting

Managing awk return code over SSH command

Hello all, This bellow code works. I'm just trying to find a simplified way to achieve this. I'm sure there is an easier way and it must be to simple for me to find. Verify that the OS version is 6.1. If not exit the script. Of course if i just put a && exit 1 at the end of the ssh... (11 Replies)
Discussion started by: maverick72
11 Replies

6. Homework & Coursework Questions

trouble understanding file option and command line arguments

Hi, I am creating a program with the C language that simulates the WC command in Unix. My program needs to count lines, bytes and words. I have not added the code to count bytes and words yet. I am having trouble understanding what the file option/flag '-' does. I can not visualize how it moves... (1 Reply)
Discussion started by: heywoodfloyd
1 Replies

7. Shell Programming and Scripting

Trouble with awk command

Hi, I need to read a string with ; separated using loop one filed by one field and perform some operation. Can you please check and let me know how to print command parameterised. key=phani;ravi;kiran number_of_keys=`echo $key|awk '{print NF}' FS=';'` for (( i = 1; i <= $number_of_keys;... (4 Replies)
Discussion started by: Ravindra Swan
4 Replies
natutil(8)						    BSD System Manager's Manual 						natutil(8)

NAME
natutil -- Query and configure supported Network Address Translation (NAT) devices SYNOPSIS
natutil [-vx] [-a auth] [-n name] {-1 | -d | -m | -s | -i | -L} natutil [-vx] [-a auth] [-n name] {-t | -u} {-T | -U} -p ports DESCRIPTION
natutil uses the ACP protocol to detect, configure, and extract status information from Internet gateway devices (IGDs) (such as AirPort Base Stations) on the local network. Since most IGDs provide Network Address Translation (NAT) service, they are often interchangably referred to as "NAT devices" or simply "NATs". The first synopsis line (with the exception of -L) returns various information from NAT devices. The second invocation modifies settings on the device. After modifying settings, AirPort Base Stations must be rebooted for the changes to take effect. ( servermgrd(8) also reboots the AirPort Base Station when it modifies port mappings.) OPTIONS
The following options / commands are available: -1 Only return data if the IGD found is also our current gateway. [AirPort only] Will only return if this base station can be autocon- figured -a auth [AirPort only] The authentication string to use when communicating with a device protected with a password other than the default "public". Used mostly for scripted operation. Use -i to get the authentication string interactively. -i Get the authentication string interactively. This preferred over -a for security reasons. -d Reports the IGDs (Internet Gateway Devices) that were found during the discovery. -m Retrieves the port mapping table from the NAT. -n name The prefix of the targeted NAT device's name (useful in a LAN with multiple NAT devices). -p ports A comma-separated list of the ports to tap or untap. Must be used with -t or -u. -s Retrieves the WAN & LAN status and configuration from the IGD. -t Configures the NAT to forward the given ports to this machine. Requires -p and either -T or -U. -u Removes the given ports from the NAT's port forwarding rules. Requires -p and either -T or -U. -v Verbose output. Provides progress and status information on standard output. -x XML output. This option provides the most information. -L [AirPort only] Convert existing DHCP lease into a static reservation so the host will receive the same IP address after each reboot. -T Ports will be tapped / untapped for the TCP protocol. Must be used with -t or -u. -U Ports will be tapped / untapped for the UDP protocol. Must be used with -t or -u. SEE ALSO
ifconfig(8), ipconfig(8) Mac OS X Server 10.5 July 23, 2007 Mac OS X Server 10.5
All times are GMT -4. The time now is 01:51 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy