netstat format question on Linux - networking

Seeing following output to netstat, what do (1)*:*, (2)*:8102, (3)*:ibm-db2 indicate respectively?
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 *:8102 *:* LISTEN
tcp 0 0 *:ibm-db2 *:* LISTEN
Thanks a lot.

This means that an application on your computer is listening on TCP ports 8102 and (I think) 446 or 523, which is the default port for IBM DB2 servers. Listening on a port allows the application to receive connections from other computers over the network.
The Foreign Address column indicates the IP address of who you're connected to. Right now, it appears that you are not connected to anyone which is why *.* appears.

Related

How to enable port for public access?

I have enabled 1 port [8081] and it's accessible from the remote computer. but the same for other port [7500] not working?
I would like to know the meaning of the below line?
TCP [::]:8081 [::]:0 LISTENING
And how to enable the same for port [7500]?
Attached listening port status:
netstat -na outputs 4 columns of data:
Proto, Local Address, Foreign Address, and State.
When looking for port 8081, you find 2 entries - one for TCP on 0.0.0.0:8081 for IPv4, and one for TCP [::]:8081 for IPv6.
When looking for port 7500, you find 1 entry - one for TCP 0.0.0.0:7500 for IPv4 only.
In both cases, you have local sockets listening via wildcard IPs to all local network adapters, and there is no "Foriegn Address" assigned because a listening socket is not connected to any remote party. TCP sockets in the ESTABLISHED state have remote parties.
You have not shown any code, or explained your network setup, so nobody can really explain why you have 2 entries for port 8081 but only 1 entry for port 7500, or why remote computers can connect to port 8081 but not to port 7500. Maybe those clients are only using IPv6? Maybe your listening computer is behind a router that doesn't forward port 7500? We don't know.

conncetion asterisk from outside network via sip

I have asterisk in a server having public ip. I am trying to asterisk from outside network from a sip phone(zoipar). I have opened the port 5060 on my router which is the default udp port for asterisk sip connection and i have also opened the 10000-20000 port for rtp defined in rtp.conf in asterisk.
When i m trying to connect my softphone to asterisk server from outside my network, it says Registration timeout and when i check if i got any hit on my port 5060, its doesnt show anything.
on my server 5060 is running
netstat -nlp | grep 5060
udp 0 0 0.0.0.0:5060 0.0.0.0:* 21768/asterisk
BTW I'm able to connect from local network without any problem .
You need to forward incoming traffic on your router from SIP and RTP to your asterisk server, it's not enough to open those ports, you need to explain your router where to send incoming traffic ton those ports
You need setup NAT.
This article will help you in your situation.
http://www.voip-info.org/wiki/view/Asterisk+sip+nat
You need to login to your router and forward the ports to your asterisk server internal IP.
You will also need to make sure your firewall on your server is setup correctly to allow the ports to go in and out of your server.
You can read more on iptables here: http://www.cyberciti.biz/tips/linux-iptables-examples.html

What's the meaning for '*' when using netstat command to check result?

What's the mean for * when using netstat command to check result?
udp 0 0 10.224.54.76:18253 10.224.2.253:* ESTABLISHED 30433/wbx
I noticed that there are two results, if there need to create two connections for udp?
udp 0 0 10.224.54.76:18252 10.224.2.253:37008 ESTABLISHED 30433/wbx
udp 0 0 10.224.54.76:18253 10.224.2.253:* ESTABLISHED 30433/wbx
* is a wildcard that means anything. So that socket is bound to the local address 10.224.54.76, local port 18253, remote address 10.224.2.253, and will accept packets from any remote port.
In your updated question, the first socket will only receive packets from remote port 37008 to local port 18252. The second socket will receive packets from any remote port to local port 18253.
Both of these come from calling connect() on a UDP socket. In the first case, port 37008 was specified in the remote address, in the second case port 0 was specified, which means any port.

Session Initiation Protocol

Does SIP v2.0 permit to have the protocol running over non-standard ports
(not 5060)? I've checked through the specification, but wasn't able to find
an answer. It looks like a port can be negotiated and determined during a
registration phase, but I could not confirm this with RFC.
Yes, port 5060/5061 are just the default ports if no other port is given. RFC3261 also only gives listening to port 5060/5061 as a recommendation;
It is also RECOMMENDED that a server
listen for requests on the default SIP ports (5060 for TCP and UDP,
5061 for TLS over TCP) on all public interfaces.
For example, if you use DNS lookup according to RFC3263, the port is looked up at the same time as the address;
That lookup would return:
;; Priority Weight Port Target
IN SRV 0 1 5060 server1.example.com
IN SRV 0 2 5060 server2.example.com
Well Yes you can use the other ports for sending Sip packets... Port Forwarding is a Hint...

netstat -na : udp and state established?

In an application (voip rtp media server), netstat -na on the server (172.16.226.3 bound to udp port 1286) gives the following line :
udp 0 0 172.16.226.3:1286 172.25.14.11:10000 ESTABLISHED
As an udp connection can not be really "established", it strikes me to see such a line. netstat documentation says that this field is used for tcp connection states, but I am sure that this really is an udp network flow. So : what does it means ? I know (wireshark dump) that my server sends back udp packets from 173.16.226.3:1286 to 172.25.14.11:10000, but I don't see why it should matter...
Os is debian 6.
A UDP socket can be connected via the connect(2) system call, so that the socket will only accept packets from the named peer.
I expect this is the source of the ESTABLISHED column.

Resources