guest@backslash:~/posts/linux/linux-network$

Linux Network

~1 mindns linux network

Linux Network

Commands to inspect network setup on Linux: addresses, routes, open ports and firewall rules.

IP addresses

List all interfaces with IPs

sh
ip a

Routing

show

sh
ip route show

show ipv6

sh
ip -6 route show

Trace route ipv4

sh
traceroute google.com

Trace route ipv6

sh
traceroute -6 google.com

Ports

See listening ports

sh
ss -l
netstat -ntlp

Check if port is open from another machine

sh
nc -zv 192.168.1.1 80

Firewall rules

See current iptables rules

sh
sudo iptables-save

See current nftables rules

sh
sudo nft list ruleset

BACKSLASH(1)                  User Commands

NAME
       backslash - keyboard navigation

KEYS
       j / k      scroll down / up
       n / p      next / previous post
       gg / G     top / bottom of the page
       /          filter posts
       ?          this help
       Esc        close