03 - Networking and Tools

Network verification and Troubleshooting

Hostnames vs IP addresses

Routing in Linux

Firewall

Debian and Ubuntu come with UFW (simplified firewall management utility) by default. UFW profiles are stored in /etc/ufw/applications.d/. You must use root (sudo) or a privileged user to make modifications to the firewall settings.

# UFW utility examples:
ufw allow 22/tcp
ufw allow profile
ufw app list
ufw app info
ufw enable
ufw disable
# UFW utility examples:
ufw allow 22/tcp
ufw allow profile
ufw app list
ufw app info
ufw enable
ufw disable

DHCP

DHCP stands for Dynamic Host Configuration Protocol. A DHCP server can send the following configuration information to clients for automatic configuration:

Please note that it is up to the DHCP client to configure the local settings. The DHCP server has no control over and cannot enforce which one of the provided configurations is used by the client.

DHCP Protocol Operation

  1. DHCP client broadcasts a DHCPdiscover packet to the network
  2. DHCP server responds with DHCPoffer packet
  3. Client sends DHCPrequest to server
  4. Server responds with DHCPACK
  5. The DHCP client is obligated to maintain communication with the DHCP server and renew its IP address as dictated by the IP address's lease time expiry
  6. The DHCP Client can use any of the information provided and will not need to let the server know what part of the configuration it is using

DHCP Server on Ubuntu Server

Example configuration file:

default-lease-time 600;
max-lease-time 7200;    # Global declarations apply to all subnets

subnet 10.1.1.0 netmask 255.255.255.0 {
  range 10.1.1.3 10.1.1.254;  # IP Range available to be assigned to clients       
  option domain-name-servers 10.1.1.1, 8.8.8.8;     # DNS Servers
  option routers 10.1.1.1;
  option domain-search  “testdomain.mytld";
}
subnet 192.168.0.0 netmask 255.255.0.0 {   # a known network, but not used by
}                                          #   the DHCP server

host printer {
  hardware ethernet 00:16:d3:b7:8f:86;  # Example of a reserved IP address
  fixed-address 10.1.1.100;             #   filtered by MAC Address
}

host web-server {
  hardware ethernet 00:17:a4:c2:44:22;
  fixed-address 10.1.1.200;
}
default-lease-time 600;
max-lease-time 7200;    # Global declarations apply to all subnets

subnet 10.1.1.0 netmask 255.255.255.0 {
  range 10.1.1.3 10.1.1.254;  # IP Range available to be assigned to clients       
  option domain-name-servers 10.1.1.1, 8.8.8.8;     # DNS Servers
  option routers 10.1.1.1;
  option domain-search  “testdomain.mytld";
}
subnet 192.168.0.0 netmask 255.255.0.0 {   # a known network, but not used by
}                                          #   the DHCP server

host printer {
  hardware ethernet 00:16:d3:b7:8f:86;  # Example of a reserved IP address
  fixed-address 10.1.1.100;             #   filtered by MAC Address
}

host web-server {
  hardware ethernet 00:17:a4:c2:44:22;
  fixed-address 10.1.1.200;
}

Interesting Files, Utilities, and Commands