From this blog post I’m going to introduce you some of the most important network related commands in LINUX.
netstat : This will print network connections, routing tables, interface statistics, masquerade connections, and multi cast memberships. There are few parameters used with netstat which will help to get specific information.
- netstat : print network connections, routing tables, interface statistics, masquerade connections, and multi cast memberships.
- netstat -l : This will show only the listening ports.
- netstat -lt : Only the TCP listening ports.
- netstat -lu : Only the UDP listening ports.
- netstat -lx : UNIX listening ports.
- netstat -s : Only the statistics regarding the protocols.
tcpdump : tcpdump prints out a description of the contents of packets on a network interface that match the boolean expression.
- tcpdump -i eth0 : This will get the packet which was transfer via interface the eth0.
- tcpdump host 172.16.0.0 : Get the packet which was received from IP address 172.16.0.0.
- tcpdump port 8080 : Get the HTTP packet which was transfer via the port 8080.
- tcpdump -d : This will give the output in a human readable format.
ping : ping uses the ICMP protocol’s mandatory ECHO_REQUEST datagram to elicit an ICMP ECHO_RESPONSE from a host or gateway.
- ping url : This will send requests to the mentioned url and then try to get responses as well. So finally we can get information about the connection.
- ping -c 10 url : This will send the specific number of packets and then receive responses.
ifconfig : Ifconfig is used to configure the kernel-resident network interfaces. It is used at boot time to set up interfaces as necessary. After that, it is usually only needed when debugging or when system tuning is needed.
- ifconfig : list all the network settings.
- ifconfig -v : Be more verbose for some error conditions.
- ifconfig -a : Display all interfaces which are currently available, even if down.
- ifconfig -s : Display a short list.
telnet : The telnet command is used for interactive communication with another host using the TELNET protocol.
- telnet url : You can connect to the given url through telnet protocol.
These are the few basic commands used in LINUX to get an idea about the network related things. Also we can talk about some protocols here, which are used heavily in working with the networking.
- HTTP and HTTPS
From a previous blog I talked about the difference between the HTTP and HTTPS. So I’m not going to talk about it here.
SMPP is the acronym for the Short Message Peer to Peer protocol. It can be used in telecommunication industry to provide a flexible data communication interface for the transfer of short message data between different entities. This is an open industry standard protocol. Also this protocol enable third parties to submit messages in a bulk format too. Also this is used to sending SMS as well.
TCP stands for the Transmission Control Protocol. This provides reliable data transmission in a network. This works with the IP protocol to make the transmission more reliable. So the combination of these protocols are popular as TCP/IP protocol. Also TCP protocol provides the error checking mechanisms as well. If a packet is lost, then it can identify it using the mechanism and can ask the sender to retransmit that packet again. TCP is widely used with applications which requires reliable data transmission over fast data transmission. So TCP is not that much fast when comparing with UDP. As this is more reliable we can use TCP for file transferring. This is a connection oriented protocol.
SMTP stands for Simple Mail Transfer Protocol which used in sending emails. This is the standard protocol used for sending emails and define in RFC-5321. Default port for the SMTP is TCP port 25. When SMTP works with SSL, it’s known as SMTPS and uses the port 465. SMTP is a connection-oriented, text-based protocol in which a mail sender communicates with a mail receiver by issuing command strings and supplying necessary data over a reliable ordered data stream channel, typically a Transmission Control Protocol (TCP) connection.
Hope you got an idea about the network related commands used in LINUX and some of the mostly used protocols in industry. See you soon with another interesting topic. Thank You!