Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Kali 

Linux Network Commands

Hello Friends I have listed the most common network commands in linux systems.

-> harp > Show host and IP number. (harp = adress resolution protocol)
-> nslookup > DNS (domain name system) query
-> ping > Ping command is used to send ECHO_REQUEST over the ICMP protocol. The server receiving this request responds to the request
The -> ifconfig > command is used to adjust the IP settings of the network interface.

-> route > is the command used to make the machine's routing settings. This command creates the machine's routing table.

-> ip link > Command where you can see what interfaces are
-> ip address add 10.10.0.1 giant eth0 > Add ip address to Interfaces
-> ip addr del 10.10.0.1/24 giant eth0 > Deleting the ip address on interfaces
-> ip addr add 10.0.0.1/24 giant eth0 label eth0:1 > Add multiple ip addresses on interfaces
-> ip addr add 100.0.0.1/24 giant eth0 label eth0:2 > Add multiple ip addresses on to Interfaces
-> ip link show eth0 > Interfaces info
-> ip link set eth0 down | ip link set eth0 up > Turn ing and off interfaces
-> cat/sys/class/net/eth$/operstate > Check for problems with the connection of the Ethernet cable
-> ip addr > Addr information of Interfaces
-> ip -4 addr flush label 'eth0'> Cleaning of all ipv4 addresses of Interfaces
-> ip route show all ip > route list of addresses
-> ip route add 0.0.0.0/0 via 10.0.0.1 [giant eth0] > Adding a new route
-> ip route del 0.0.0.0/0 > Delete an added route
-> ip route get 72.122.134.209 > See the route of an ip address
-> ip neigh list > List of connected machines on the network
-> ip route show 192.168.0.2/24 > Route registration for a specific IP group
-> ip route show cache > Route information for addresses accessed recently
-> ip route flush > Delete all route records
-> ip -s neigh flush 192.168.0.23 > Deleting records for a specific rope from arp table

-> ip -s neigh flush all > empty arp table

-> netstat > command is a program that shows basic network information such as network connections, routing table, interface statistics, etc.
If no option is given, the netstat program will provide information about the sockets in use in the system.

+> The Netstat command is used with various parameters. These parameters and their meanings are:

-a : All TCP and UDP connections print on the screen.
-e : Displays statistics on the number of packages coming and going.
-n : Displays all links numerically.
-o : Lists all links by PID number and application name.
-p : Prints the application and PID numbers used by the links on the screen.
-s : Prints statistical data on the screen according to the rules.

-r : Displays the contents of the IP routing table.

+> Meanings of connection states in Netstat output
-> ESTABLISHED : Socket connection has been realized.
-> SYN_SENT : Socket is trying to connect.
-> SYN_RECV : A connection request has been received from the network.
-> FIN_WAIT1 : The socket is closed and the connection is about to be terminated.
-> FIN_WAIT2 : The connection has been terminated. The socket waits for the opposite end to end the connection.
-> TIME_WAIT : Waiting to receive packages that may come after the socket is closed.
-> CLOSED : Socket is not used.
-> CLOSE_WAIT : The opposite end has closed the connection. The socket is expected to close.
-> LAST_ACK : The opposite end has terminated the connection and closed the socket. Approval is pending.
-> LISTEN : The socket is in a listening position for possible connections.

-> CLOSING : Local and remote sockets have been closed but have not submitted all their data. Sockets won't close until all data has been sent.

+> Some sample commands to get netstat outputs via SSH
-> netstat -ntu > Lists all TCP and UDP Links
-> netstat -ntu | grep ESTABLISHED > Prints only ESTABLISHED links to the screen.


Possibly Related Threads...
Thread / Author Replies Views Last Post
by FatCatOct 6, 2026 06:07 PM 0 43 Oct 6, 2026 06:07 PM
Last Post: FatCat
by HackersSep 10, 2026 12:40 AM 6 319 Sep 10, 2026 12:40 AM
Last Post: Maxpro
by Biggy_AsianOct 16, 2024 06:21 PM 3 143 Oct 16, 2024 06:21 PM
Last Post: Mercury