Skip to content

Latest commit

 

History

History
 
 

netdog

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

netdog

Current version: 0.1.0

Introduction

netdog is a small helper program for wicked, to apply network settings received from DHCP. It generates /etc/resolv.conf, generates and sets the hostname, and persists the current IP to a file.

It contains two subcommands meant for use as settings generators:

  • node-ip: returns the node's current IP address in JSON format
  • generate-hostname: returns the node's hostname in JSON format. If the lookup is unsuccessful, the IP of the node is used.

The subcommand set-hostname sets the hostname for the system.

The subcommand generate-net-config generates the network interface configuration for the host. If a net.toml file exists in /var/lib/bottlerocket, it is used to generate the configuration. If net.toml doesn't exist, the kernel command line /proc/cmdline is checked for the prefix netdog.default-interface. If an interface is defined with that prefix, it is used to generate an interface configuration. A single default interface may be defined on the kernel command line with the format: netdog.default-interface=interface-name:option1,option2. "interface-name" is the name of the interface, and valid options are "dhcp4" and "dhcp6". A "?" may be added to the option to signify that the lease for the protocol is optional and the system shouldn't wait for it. A valid example: netdog.default-interface=eno1:dhcp4,dhcp6?.

The subcommand prepare-primary-interface writes the default sysctls for the primary interface to file in /etc/sysctl.d, and then executes systemd-sysctl to apply them.

Colophon

This text was generated using cargo-readme, and includes the rustdoc from src/main.rs.