Setting up a host on the network

A host's four settings (address, mask, gateway, DNS server), static or supplied by DHCP, where they live on Linux and Windows, temporary or persistent settings, and how to check them.

  • 24 cards
  • 4 topics
  • Free

The outline, topic by topic

Each topic is weighted the way the exam weighs it.

  1. Concepts
  2. Questions
  3. Sort and link
  4. Scenarios

A few cards from the deck

  • Default gateway: what is it?

    Show the answer

    The address of the router to which the host hands every packet bound for a network it does not reach directly.

    It must be inside the host's own network: the host can only send to a machine it reaches directly.

  • This host reaches its neighbours but not the Internet. Which setting is wrong?

    ```text
    auto eth0
    iface eth0 inet static
    address 192.168.1.20
    netmask 255.255.255.0
    gateway 192.168.2.1
    dns-nameservers 192.168.1.1
    `

    • gateway: 192.168.2.1 outside the network 192.168.1.0/24
    • netmask: 255.255.255.0 is an invalid mask for this network
    • address: an address ending in .20 is reserved for the network's router
    • dns-nameservers: a DNS server must necessarily be public
    Show the answer

    gateway: 192.168.2.1 outside the network 192.168.1.0/24

    With /24, the direct neighbours run from 192.168.1.1 to 192.168.1.254. A gateway at 192.168.2.1 is outside that network: the host cannot send it a frame, and the kernel refuses to install this default route.

  • To reach the Internet, a host needs four settings: an IP address, a …, a … and a DNS server.

    Show the answer

    To reach the Internet, a host needs four settings: an IP address, a mask, a gateway and a DNS server.

    The mask says which machines are neighbours, the gateway leads to the others, DNS turns names into addresses.

  • Static addressing: what is it?

    Show the answer

    A mode where the network settings are written by hand on the host, instead of being supplied by a DHCP server.

    It suits servers, whose address must stay the same. It requires avoiding duplicates and addresses the DHCP server hands out.

  • After a reboot, the server lost its address although it had been set with ip addr add. Probable cause, then fix?

    • The DHCP server took the address back: extend the server's lease
    • Non-persistent setting: write it into the system configuration
    • The network card is faulty: replace it with another one
    • The mask was too wide: narrow it in the configuration
    Show the answer

    Non-persistent setting: write it into the system configuration

    ip addr add changes kernel state, which is cleared at shutdown. For an address to come back on its own, it has to be declared in the interfaces file, Netplan or NetworkManager depending on the distribution.