Networking 101

Important/Useful Commands

  1. Display all network interfaces - ip addr

  2. Display the routing table - ip route

  3. Display list of all the existing firewall rules - firewall-cmd --list-all

  4. To add rule to firewall, suppose to allow incoming TCP traffic on port 8285 - firewall-cmd --permanent --add-port=8285/tcp

  5. Display information about active network connections and the ports that are currently listening - netstat -tulpn

  6. Specify packet size to send during ping : ping -s 1300 <ip>

  7. Pipe grep output to vim dash to watch search results in vim file - grep -Hnri tree | vim -

  8. Scan entire network - nmap -sn <IP>

    1. Pass flag -V to do service discovery.

    2. Pass -Pn to get OS

    3. Pass -sL to do quick host name scanning on a network.

    4. Try --script malware or --script vuln

    5. Pass -A for everything

Last updated