# Automatic network configuration
**What's very likely the case if the system's network was configured automatically?**
If the system's network was configured automatically, it is likely that *the system is connected to an Ethernet network with an IPv6 router or DHCP server.*
# Using DHCP
**What does DHCP stand for?**
DHCP stands for *Dynamic Host Configuration Protocol.*
> **What does Dynamic Host Configuration Protocol (DHCP) assist with?**
> DHCP assists with *network configuration for a variety of parameters.*
>
> **What parameters can Dynamic Host Configuration Protocol (DHCP) automatically configure?**
> The parameters that DHCP can automatically configure include:
> * IP address.
> * Network mask.
> * Routes.
> * DNS servers.
> * NTP servers.
**What does Dynamic Host Configuration Protocol (DHCP) require?**
DHCP requires *the server to run on the same Layer 2 (Ethernet) segment as the client requesting a lease.*
> **On what type of network is Dynamic Host Configuration Protocol (DHCP) often used?**
> The types of network that DHCP is often used on is *RFC1918 (private).*
> > **What is Dynamic Host Configuration Protocol (DHCP) also often used to acquire?**
> > DHCP is also often used to acquire *public information from ISPs.*
**Does the Gentoo boot media run `dhcpcd` automatically?**
*Yes*, the Gentoo boot media runs `dhcpcd` automatically.
> **How do you disable `dhcpcd` from running on the Gentoo boot media?**
> To disable `dhcpcd` from running automatically on the Gentoo boot media, *add the `nodhcp` argument to the boot media kernel commandline.*
**How do you start `dhcpcd` on a particular network interface?**
To start `dhcpcd` on a particular network interface, run:
```sh
dhcpcd interface_name
```
> **How do you start `dhcpcd` so that the system uses the hostname and domain name provided by the DHCP server?**
> To start `dhcpcd` so that the system uses the hostname and domain name provided by the DHCP server, run:
> ```sh
> dhcpcd -HD interface_name
> ```
> **How do you stop `dhcpcd`?**
> To stop `dhcpcd`, run:
> ```sh
> dhcpcd -x
> ```
# Testing the network
**How can you check if the default route has been properly configured?**
To check if the default route has been properly configured, run:
```sh
ip route
```
> **What does it mean if there's no default route defined?**
> If there's no default route defined, that means *internet connectivity is unavailable and additional configuration is required.*
**How can basic internet connectivity be confirmed?**
Basic internet connectivity can be confirmed by running:
```sh
ping -c 3 1.1.1.1
```
> **What should you start pinging instead of a hostname and why?**
> Instead of a hostname, you should start pinging *known IP addresses because this can isolate DNS issues from basic internet connectivity issues.*
**How can you confirm outbound HTTPS access and DNS resolution?**
To confirm outbound HTTPS access and DNS resolution, run:
```sh
curl --location gentoo.org --output /dev/null
```
> **Unless `curl` reports an error, or other tests fail, the installation process can ... ... with ... ...**
> Unless `curl` reports an error, or other tests fail, the installation process can *be continued* with *disk preparation.*
>
> **What may need configuration if `curl` reports an error but internet-bound pings work?**
> If `curl` reports an error, but internet-bound pings work, *DNS* may need configuration.
**What should you do first if internet connectivity hasn't been established?**
If internet connectivity hasn't been established, you should first *verify interface information.*
> **What three things should you do after verifying interface information?**
> The three things you should do after verifying interface information are:
> 1. Using net-setup to assist in network configuration.
> 2. Application specific configuration.
> 3. Attempting manual network configuration.
# Obtaining interface info
**What is the first step to getting networking to work if it doesn't already work out of the box?**
If networking doesn't already working out of the box, the first step is to *enumerate host network interfaces.*
> **What command, belonging to what package, can be used to query and configure system networking?**
The command that can query and configure system networking is *the `ip` command belonging to the `sys-apps/iproute2` package.*
> > **What does the `link` argument do when used with the `ip` command?**
> > When used with the `ip` command, the `link` argument *displays network interface links.*
> > > [!example] Example of `ip link` output
> > > ```sh
> > > 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
> > > link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
> > > 4: enp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
> > > link/ether e8:40:f2:ac:25:7a brd ff:ff:ff:ff:ff:ff
> > > ```
> >
> > **What does the `address` argument do when used with the `ip` command?**
When used with the `ip` command, the `address` argument *queries device address information.*
> > > [!example] Example of `ip address` output
> > > ```sh
> > > 2: enp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
> > > link/ether e8:40:f2:ac:25:7a brd ff:ff:ff:ff:ff:ff
> > > inet 10.0.20.77/22 brd 10.0.23.255 scope global enp1s0
> > > valid_lft forever preferred_lft forever
> > > inet6 fe80::ea40:f2ff:feac:257a/64 scope link
> > > valid_lft forever preferred_lft forever
> > > ```
> >
> > **What two things could be happening if no interfaces other than the `lo` (loopback) are displayed?**
> > If no interfaces other than the `lo` are displayed, the two things that could be happening are:
> > 1. The networking hardware is faulty.
> > 2. The driver for the interface hasn't been loaded into the kernel.