Linux Network and Process Management

 What is Process?

  • In Linux, a process is any active(running) instance of a program. 
  • Technically, a process is any execute file held in storage on your machine. Anytime you run a program, you  have created a process.
  • A process is task that your Lunix machine is currently working on.

For example, when you open a browser, your machine create a process for it. 

Process States

1. Running

The process is currently executing on the CPU.

2. Ready

3. Sleeping

The process is waiting for resource to become available.

4. Stopped

The process has been terminated by a user

6. Zombie

The process has completed execution but has not yet been cleaned by he system.



Process Management

1. ps - it will displays the currently-running processes.

  • ps
  • ps aux 
a-represent all user 

u-represent the user/owner

x-display process executed outside of the terminal

it also display some extra fields in results.

2. top - to track running processes on your machine.

It will displays a list of processes that are running in real-time along with their memory and CPU usage.

3. kill- to stop a process in Linux, 'kill' command is used. kill command sends a signal tot he process.

  • there are different types of signal to send. however, the command one is 'kill -9' which is 'SIGKILL'. This command is used in case the process ignores a normal kill request. 
  • kill -L will list all the signal.
  • kill <PID> syntax for killing a process




4. if some service installed in system, systemctl command is used

  • sudo systemctl status
  • sudo systemctl start
  • sudo systemctl stop
Network Configuration

Linux Networking command are used extensively to inspect, analyze, maintain, and troubleshoot the network/s connected tot he system.

list of networking command used in Linux:
  1. ifconfig 
  2. ip 
  3. traceroute
  4. tracepath
  5. ping
  6. netstat
  7. ss
  8. dig
  9. nslookup
  10. route
  11. host
  12. arp
  13. iwconfig
  14. hostname
  15. curl or wget
  16. mtr
  17. whois
  18. ifplugstatus
  19. iftop
  20. tcpdum
1. ifconfig
  • it stands for interface configuration. 
  • It is used to initialize an interface, configure it with an IP address, and enable or disable it. It is also used to display the route and the network interface.
2. ip
  • This is latest and updated version of ifconfig command
syntax:
  • ip i
  • ip addr
3. traceroute
  • It is one of the most useful command in networking. It is used to troubleshoot the network.
  • It detacts the delay and determine the pathway to your target
It helps in the following ways:
  • It provide the names and identifies every device on the path
  • It follow the route to the destination
  • It determine where the network latency comes form and reports it.
4. tracepath
  • It is similar to traceroute command. It is used to detect network delays. However, it doesn't required root privileges.
  • It is installed in Ubuntu by default
  • It traces the route to the specified destination and identifies each hop in it. 
  • If network is weak, it recognize the point where the network is weak.
5. ping
  • Is one one of the most used network troubleshooting commands. 
  • It checks for the network connectivity between two nodes.
  • ping stands for Packet Internet Groper
  • The ping command sends the ICMP echo request to check the network connectivity.
6. netsat
  • It refers to network statistics.
  • It provides statistical figure about different interface which include open sockets, routing tables, and connection information.
Firewall Configuration
  • UFW, or Uncomplicated Firewall, is designed to make iptables firewall configuration more user-friendly. Originating from Ubuntu, it has been adopted by many other distributions due to its simplicity and ease of use.
  • sudo ufw status
  • sudo ufw enable
To start the service and enable firewll on boot:
  • sudo systemctl start firewalld
  • sudo systemctl enable firewalld
To stop and disable it:
  • sudo systemctl stop firewalld
  • sudo systemctl disable firewalld

Comments