Network Commands
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Sure! Here are some commonly used Linux networking commands:
ifconfig
: This command displays the network interfaces and their configurations.ip
: This command displays and modifies network interfaces, routing tables, and other network settings.ping
: This command tests the connectivity to a remote host by sending ICMP echo requests and receiving replies.traceroute
: This command traces the route that packets take from the local host to a remote host, displaying the IP addresses of each hop along the way.netstat
: This command displays network connections, routing tables, and network interface statistics.ss
: This command provides similar functionality to netstat but with faster performance.route
: This command displays and modifies the routing table.dig
: This command performs DNS queries and displays the results.NSLOOKUP
nslookup
: This command performs DNS queries and displays the results.>>> To query a specific domain name:
nslookup example.com
>>> To query a specific DNS server:
nslookup example.com server_IP_address
>>> To query for a specific record type:nslookup -type=record_type example.com
>>> To perform a reverse DNS lookup (using an IP address to find the associated domain name):nslookup IP_address
>>> To perform a verbose query (showing additional information about the query):
nslookup -debug example.com
>>> To set the default query type (for subsequent queries in the same session):
nslookup
> set type=record_type
IPTABLES
iptables
: This command configures the Linux firewall and packet filtering rules.IP tables is a command-line utility in Linux-based operating systems that allows you to manage and configure the firewall rules for your system. The IP tables utility uses a set of tables and chains to filter and manipulate network traffic. Here are some basic IP tables commands:
>>> To view the current IP tables rules:
iptables -L
>>> To flush all the current IP tables rules:
iptables -F
>>> To block incoming traffic from a specific IP address:
iptables -A INPUT -s IP_address -j DROP
>>> To allow incoming traffic to a specific port:
iptables -A INPUT -p tcp --dport port_number -j ACCEPT
>>> To block outgoing traffic to a specific IP address or network:
iptables -A OUTPUT -d IP_address/network -j DROP
>>> To enable Network Address Translation (NAT) for your system:
iptables -t nat -A POSTROUTING -o interface_name -j MASQUERADE
>>> To save the current IP tables rules to a file:
iptables-save > /etc/iptables/rules.v4
hostname
: This command displays or sets the hostname of the system.ifup
andifdown
: These commands bring up or down a network interface, respectively.
These are just a few examples of the many Linux networking commands available. Knowing how to use these commands can be helpful for troubleshooting network issues, configuring network settings, and monitoring network traffic.
Comments
Post a Comment