NETWORK RELATED COMMANDS IN LINUX

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.

1.png

  • netstat -l : This will show only the listening ports.

20.png

  • netstat -lt : Only the TCP listening ports.

21.png

  • netstat -lu : Only the UDP listening ports.

22.png

  • netstat -lx : UNIX listening ports.

23.png

  • netstat -s : Only the statistics regarding the protocols.

24.png

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.

25.png

26.png

  • tcpdump host 172.16.0.0 : Get the packet which was received from IP address 172.16.0.0.

28.png

  • tcpdump port 8080 : Get the HTTP packet which was transfer via the port 8080.

29.png

  • tcpdump -d : This will give the output in a human readable format.

30.png

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.

3.png

  • ping -c 10 url : This will send the specific number of packets and then receive responses.

1.png

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.

4.png

  • ifconfig -v :  Be more verbose for some error conditions.

5.png

  • ifconfig -a : Display all interfaces which are currently available, even if down.

6.png

  • ifconfig -s :  Display a short list.

7.png

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.

8

9

10

11

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.

  1. HTTP and HTTPS
  2. SMPP
  3. TCP
  4. SMTP

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

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

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

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!

Advertisements

One thought on “NETWORK RELATED COMMANDS IN LINUX

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s