Skip to main content

Networking on My Servers


Overview

This document details the network setup and configuration for both Ubuntu Server and CentOS Server, including how to find network information, changes made, and scripts used for diagnostics and reporting.


Ubuntu Server

  • Default Networking: Uses DHCP via Hyper-V Default Switch for automatic IP assignment.
  • How to Find Network Info:
    • ip a or ifconfig for IP addresses
    • cat /etc/netplan/*.yaml for network config
    • nmcli for NetworkManager status
    • cat /etc/resolv.conf for DNS
  • Network Files:
    • /etc/netplan/ (main config)
    • /etc/hosts, /etc/hostname, /etc/resolv.conf
  • Installed Tools:
    • net-tools, iproute2, curl, ping, traceroute
  • Last Update: March 15, 2025
  • Changes Made:
    • Set static IP for lab testing (see /etc/netplan/01-netcfg.yaml)
    • Enabled SSH for remote access

CentOS Server

  • Default Networking: Uses DHCP via Hyper-V Default Switch for automatic IP assignment.
  • How to Find Network Info:
    • ip a or ifconfig for IP addresses
    • cat /etc/sysconfig/network-scripts/ifcfg-* for config
    • nmcli for NetworkManager status
    • cat /etc/resolv.conf for DNS
  • Network Files:
    • /etc/sysconfig/network-scripts/, /etc/hosts, /etc/hostname, /etc/resolv.conf
  • Installed Tools:
    • net-tools, iproute, curl, ping, traceroute
  • Last Update: March 15, 2025
  • Changes Made:
    • Set static IP for lab testing (see /etc/sysconfig/network-scripts/ifcfg-eth0)
    • Enabled SSH for remote access

Network Diagnostic Script

A Bash script was created to output network info to the terminal and a file. It includes:

  • IP address
  • DNS info
  • Open ports (ss -tuln)
  • Hostname
  • Date-stamped output file (e.g., network-info-2025-03-15.txt)

Sample Command:

bash network-info.sh

Research & Rationale

  • Chose to include IP, DNS, open ports, and hostname for a complete snapshot.
  • Useful for troubleshooting, documentation, and security audits.
  • Sources: Ubuntu/CentOS official docs, DigitalOcean tutorials, Stack Overflow.

Scripts and documentation are available at: github.com/raphael-adeshiyan