Linux Networking

Generic

The generic section will cover networking utilities that are platform agnostic.

systemd

The systemd init suite provides both “systemd-networkd” and systemd-resolved” to control networking devices. These services have been included in systemd since version 210. [1]

All systemd network settings should be configured in the directory “/etc/systemd/network/.” Network files should have the “.network” extension and NetDev files will use “.netdev.” Common options are listed below. [2][3]

Network Settings:

  • [Match] = Select the device to use.

    • Name = The device name.

    • MACAddress = The MAC address for the device.

  • [Network] = Network settings.

    • DHCP = Use DHCP.

      • yes (IPv4 and IPv6), no, ipv4, or ipv6 [29]

    • DHCPServer = Become a DHCP server.

      • yes, no

    • Address = The IP address to use on the interface.

    • Gateway = The default gateway.

    • DNS = A list of DNS servers.

    • NTP = A list of NTP servers.

    • IPForward = Allow IP addresses to be routed based on the netfilter routing table.

      • yes, no, ipv4, ipv6

    • IPMasquerade = Allow IPv4 addresses to be set up for source network address translation (SNAT).

      • yes, no, ipv4

    • Bond = The name of the bond interface to use.

    • VLAN = The name of the VLAN interface to use.

    • VXLAN = The name of the VXLAN interface to use.

    • Tunnel = The name of the tunnel interface to use.

  • [Link]

    • MACAddress = Override the MAC address with a custom address.

    • MTUBytes = The MTU size for packets.

  • [DHCPServer] = Configure DHCP server settings.

    • PoolOffset = The offset count (not including network or broadcast addresses) to start the IP allocation pool from.

    • PoolSize = The number of IP addresses that can be allocated.

    • DNS = A list of DNS servers to provide.

    • EmitRouter = The default gateway to provide.

    • NTP = The NTP server to provide.

    • Timezone = The timezone to provide. [2]

NetDev settings:

  • [NetDev] = Virtual network devices.

    • Name = Create a name for the device.

    • MACAddress = Create a MAC address for the device. A randomly generated address will be created if this option is not specified.

    • MTUBytes = The MTU size for packets.

    • Kind = The type of virtual network device.

      • bond = A combination of multiple NICs.

      • bridge = Allow guests to have full passthrough access to the NIC.

      • dummy = Drop all packets.

      • gretap = GRE layer 2 tunnel.

      • gre = GRE layer 3 tunnel.

      • tap = Layer 2 tunnel.

      • tun = Layer 3 tunnel.

      • vlan = VLAN tagging.

      • vxlan = VXLAN tunnel.

  • [Bond]

    • Mode = The bond mode to use for clustering NICs.

      • balance-rr

      • active-backup

      • balance-xor

      • broadcast

      • 802.3ad

      • balance-tlb

      • balance-alb

  • [Tunnel] = Tunnel configurations

    • Local = The static IP address that should already be configured on another NIC. This is used to connect to the remote tunnel IP address.

    • Remote = The remote IP address to create a tunnel connection between.

  • [VLAN]

    • Id = The VLAN ID.

  • [VLAN]

    • Id = The VXLAN ID. [3]

Static networking syntax:

[Match]
name=<NIC>

[Network]
Address=<IP_ADDRESS>/<CIDR>
Gateway=<GATEWAY_IP_ADDRESS>
DNS=<DNS_SERVER_IP_ADDRESS>

Static networking example:

[Match]
name=eth0

[Network]
Address=192.168.1.10/24
Address=10.0.0.2/30
Gateway=192.168.1.1
DNS=8.8.4.4

[2]

A Network configuration can be created for a Wi-Fi interface. Using the “wpa_supplicant” service, the Wi-Fi password can be securely saved in a different file and will automatically be used by systemd-network.

Wi-Fi syntax:

$ sudo wpa_passphrase <SSID> <PASSWORD> > /etc/wpa_supplicant/wpa_supplicant-<NIC>.conf
$ sudo systemctl enable wpa_supplicant@<NIC>.conf
$ sudo systemctl start wpa_supplicant@<NIC>.conf

Wi-Fi example:

$ sudo wpa_passphrase Guest5G password123 > /etc/wpa_supplicant/wpa_supplicant-wlan0.conf
$ sudo systemctl enable wpa_supplicant@wlan0.conf
$ sudo systemctl start wpa_supplicant@wlan0.conf

[4]

Open vSwitch

Bridging

Any physical network interface can be turned into a bridge. This allows multiple devices to be able to utilize the bridge for straight connectivity to the physical network. In this example, eth0 is converted into the br0 bridge.

Example:

$ sudo ovs-vsctl add-br br0
$ sudo ovs-vsctl add-port br0 eth0

Syntax:

$ sudo ovs-vsctl add-br <NEW_BRIDGE>
$ sudo ovs-vsctl add-port <NEW_BRIDGE> <PHYSICAL_INTERFACE>

It is possible to create multiple bridges from one physical interface. This official example from the Open vSwitch documentation shows how to use the physical interface eth0 to create the virtual bridges br0 and br1. Patch ports are used to connect the tap interfaces.

Example:

$ sudo ovs-vsctl add-br br0
$ sudo ovs-vsctl add-port br0 eth0
$ sudo ovs-vsctl add-port br0 tap0
$ sudo ovs-vsctl add-br br1
$ sudo ovs-vsctl add-port br1 tap1
$ sudo ovs-vsctl \
       -- add-port br0 patch0 \
       -- set interface patch0 type=patch options:peer=patch1 \
       -- add-port br1 patch1 \
       -- set interface patch1 type=patch options:peer=patch0

Open vSwitch uses virtual tap interfaces to connect virtual machines to a bridge instead of providing straight access to a bridge device. This makes it easier to manage interfaces for many virtual machines and it helps to isolate and track down traffic. Tools such as tcpdump can be used to analyze specific tap traffic. [5]

Example:

$ sudo ovs-vsctl add-br br0
$ sudo ovs-vsctl add-port br0 eth0
$ sudo ovs-vsctl add-port br0 tap0
$ sudo ovs-vsctl add-port br0 tap1
$ sudo ovs-vsctl add-port br0 tap2

Syntax:

$ sudo ovs-vsctl add-br <NEW_BRIDGE>
$ sudo ovs-vsctl add-port <NEW_BRIDGE> <PHYSICAL_INTERFACE>
$ sudo ovs-vsctl add-port <NEW_BRIDGE> <NEW_TAP_INTERFACE>

ModemManager (Cellular Connectivity)

ModemManager is the primary service and tool to manage cellular connections. Optionally, NetworkManager can be used to make persistent configurations last with reboots.

Installation:

  • Arch Linux:

    $ sudo pacman -S modemmanager modem-manager-gui networkmanager usb_modeswitch
    $ sudo systemctl enable --now ModemManager NetworkManager
    
  • Fedora:

    $ sudo dnf install NetworkManager ModemManager modem-manager-gui
    $ sudo systemctl enable --now ModemManager NetworkManager
    

Use mmcli for ModemManager and nmcli for NetworkManager.

Manual connection [19][20]:

  • Find the index of the modem as denoted by the last number.

    $ sudo mmcli --list-modems
    
  • Enable the modem.

    $ sudo mmcli -m <MODEM_INDEX> --enable
    
  • A new network device starting with the letters ww will appear.

    • Example:

      $ ip link | grep ww
      5: wwp0s20f0u2i4: <POINTOPOINT,MULTICAST,NOARP> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
      
  • Connect the modem to an APN and enable both IPv4 and IPv6 support.

    • Syntax:

      $ sudo mmcli -m <MODEM_INDEX> --simple-connect="apn=<APN>,ip-type=ipv4v6"
      
    • Example (T-Mobile):

      $ sudo mmcli -m 0 --simple-connect="apn=fast.t-mobile.com,ip-type=ipv4v6"
      
    • Supported IP addressing types: ipv4, ipv6, or ipv4v6. ipv4v6 means that the network will use IPv4 and/or IPv6 based on what is available. [21]

  • Use DHCP to get an IP address.

    • Arch Linux:

      $ sudo pacman -S dhclient
      
    • Fedora = dhclient no longer works on Fedora and does not have a replacement. It is recommended to use another networking service such as NetworkManager or systemd-networkd to configure DHCP. [22]

    $ sudo dhclient -4 ww<NETWORK_DEVICE>
    $ sudo dhclient -6 ww<NETWORK_DEVICE>
    

Automatic connection:

  • Using NetworkManager [23]:

    • Syntax:

      $ nmcli connection add type [cdma|gsm] ifname '*' con-name "<NEW_CONNECTION_NAME> apn '<APN>' connection.autoconnect yes
      
    • Example with a SIM PIN unlock:

      $ nmcli connection add type gsm ifname '*' con-name 'tmobile' apn 'fast.tmobile.com' connection.autoconnect yes gsm.pin 0000
      

Some mobile network providers do not provide IPv4 support on newer networks. For example, T-Mobile is IPv6-only for 4G and 5G connections. This can cause issues with services that require IPv4 such as Steam. [24][28]

Change DNS Resolvers

Linux:

  • /etc/resolv.conf = This file handles DNS resolution on Linux. There will be a note in the file if it is managed by another service such as NetworkManager or systemd-resolved. If there is no note, it can be modified directly.

    $ sudo -E ${EDITOR} /etc/resolv.conf
    nameserver <DNS_RESOLVER_1_IP>
    nameserver <DNS_RESOLVER_2_IP>
    
  • systemd-resolved = Most modern Linux distributions use systemd-resolved for DNS resolution even if another network service such as NetworkManager is in-use. However, NetworkManager can also manage DNS resolvers.

    • View the list of current DNS resolvers.

      $ systemd-resolve --status
      
    • Define the DNS resolvers to use.

      • For static IP addresses [31]:

        $ sudo -E ${EDITOR} /etc/systemd/resolved.conf
        [Resolve]
        DNS=<DNS_RESOLVER_1_IP>
        FallbackDNS=<DNS_RESOLVER_2_IP>
        $ sudo systemctl restart systemd-resolved
        
      • For DHCP addresses when also using systemd-networkd [32]:

        $ sudo -E ${EDITOR} /etc/systemd/network/<NETWORK_INTERFACE>.network
        [Match]
        Name=<NETWORK_INTERFACE>
        
        [Network]
        DHCP=yes
        
        [DHCP]
        UseDNS=false
        $ sudo systemctl restart systemd-networkd
        
      • For DHCP addresses when also using NetworkManager [33]:

        $ sudo -E ${EDITOR} /etc/NetworkManager/conf.d/dns-servers.conf
        [global-dns-domain-*]
        servers=<DNS_RESOLVER_1_IP>,<DNS_RESOLVER_2_IP>
        $ sudo systemctl restart NetworkManager
        
    • Verify that the new DNS resolvers are in-use.

      $ systemd-resolve --status
      

macOS [34]:

  • View the list of current DNS resolvers.

    $ scutil --dns
    
  • View the list of network connections.

    $ networksetup -listallnetworkservices
    
  • Remove all of the current DNS resolvers.

    $ sudo networksetup -setdnsservers <NETWORK_CONNECTION> empty
    
  • Set new DNS resolvers.

    $ sudo networksetup -setdnsservers <NETWORK_CONNECTION> <DNS_RESOLVER_1_IP> <DNS_RESOLVER_2_IP>
    
  • Verify that the new DNS resolvers are in-use.

    $ scutil --dns
    

Disable IPv4 or IPv6

By default, IPv6 networks are prioritized over IPv4. This can be changed to prioritize IPv4 over IPv6. This helps with services that are not fully compatible with IPv6 such as the Steam client. [24][28] Create a default configuration for getaddrinfo but lower the priority of IPv6 traffic by setting precedence ::ffff:0:0/96 from a weight of 10 to 100. [29][30]

$ sudo -E ${EDITOR} /etc/gai.conf
label  ::1/128       0
label  ::/0          1
label  2002::/16     2
label ::/96          3
label ::ffff:0:0/96  4
precedence  ::1/128       50
precedence  ::/0          40
precedence  2002::/16     30
precedence ::/96          20
precedence ::ffff:0:0/96  100

A specific IP type can be disabled various ways:

  • Linux kernel [26]

    • IPv4 = The Linux kernel does not support disabling IPv4.

    • IPv6

      $ sudo -E ${EDITOR} /etc/sysctl.d/50-disable-ipv6.conf
      net.ipv6.conf.all.disable_ipv6 = 1
      net.ipv6.conf.default.disable_ipv6 = 1
      net.ipv6.conf.lo.disable_ipv6 = 1
      $ sudo sysctl --system
      
  • NetworkManager [27]

    $ nmcli connection
    $ nmcli connection modify "<CONNECTION_NAME>" ipv[4|6].method disabled
    $ sudo systemctl restart NetworkManager
    
  • systemd-networkd = Enable DHCP or static IP addressing only for the specified IP address type. [29]

    $ sudo -E ${EDITOR} /etc/systemd/network/<NETWORK_INTERFACE>.network
    [Match]
    Name=<NETWORK_INTERFACE>
    [Network]
    DHCP=ipv[4|6]
    $ sudo systemctl restart systemd-networkd
    

Operating System Specific

Debian

The Debian network configuration file is located at /etc/networks/interfaces. Run ifup or ifdown to add or remove the IP address configurations for a particular interface

Static example:

File: /etc/network/interfaces

auto eth0
iface eth0 inet static
    address 192.168.1.11
    netmask 255.255.255.0
    gateway 192.168.1.1
    dns-nameservers 192.168.3.45 192.168.8.10
iface eth0 inet static
    address 10.0.0.200
    netmask 255.255.0.0
$ sudo ifup eth0

DHCP example:

File: /etc/network/interfaces

auto eth0
iface eth0 inet dhcp
$ sudo ifup eth0

Common:

  • auto <INTERFACE> = Start the interface on boot.

  • iface <INTERFACE> inet {static|dhcp} = Specify if the IP address should be static or dynamic. Define this again for every IP address that will be used.

    • address = The IP address to add.

    • netmask = The subnet mask for the IP address.

    • gateway = The default gateway.

    • dns-nameservers = A list of DNS resolvers to use, separated by a space.

[6]

Bridging

Syntax for /etc/network/interfaces:

iface <BRIDGE_NAME> inet static
  bridge_ports <PORT1> <PORT2>
  address <IP_ADDRESS>
  netmask <NETMASK>
  gateway <DEFAULT_GATEWAY>
  <BRIDGE_OPTION_KEY> <BRIDGE_OPTION_VALUE>

Bridge options:

  • bridge_stp [on|off] = Turn the Spanning Tree Protocol (STP) on or off.

  • bridge_waitport <DELAY> = The number of seconds to delay before turning on the virtual interface.

  • bridge_fd <DELAY> = The number of seconds to delay before forwarding a packet.

  • bridge_ports <PORT1> <PORT2> = The ethernet port(s) to create a bridge on.

  • bridge_ports regex eth* = Define a regular expression of the the ethernet ports to create a bridge on.

Example of eth0 converted into a bridge br0 with a static IP address:

iface br0 inet static
  bridge_ports eth0
  address 192.168.1.123
  netmask 255.255.255.0
  gateway 192.168.1.1
  bridge_stp on
  brdige_waitport 30
  bridge_fd 1

[17]

RHEL (network-scripts)

As of Red Hat Enterprise Linux (RHEL) 8, the “network” service from the “network-scripts” package is deprecated. Use NetworkManager instead. [24]

There are two udev modules that manage new device naming schemes: “net.ifnames” and “biosdevname.” Only “net.ifnames” is installed by default on RHEL. Set these both to 0 in the kernel/boot options to revert back to eth* and wlan* naming. Otherwise, devices will be named based on their physical location and connection to the motherboard. [7]

Network configurations are saved in /etc/sysconfig/network-scripts/. The Ethernet device names start with “ifcfg-eth” when ifnames is disabled or “ifcfg-e” if not.

Options:

  • {NAME|DEVICE} = The name of the network interface. The first device is generally “eth0” for Ethernet or “wlan0” for wireless devices.

  • ONBOOT = {yes|no}. Enable or disable this interface on startup of the system.

  • HWADDR = The MAC address of the device.

  • BOOTPROTO = The boot protocol to use for obtaining an IP address.

    • {none|static} = Static IP addressing. Do not use any protocol.

    • dhcp = Dynamic IP addressing. Use DHCP to obtain IP addressing information.

    • bootp = Dynamic IP addressing. Use BOOTP to obtain IP addressing information.

  • DHCP_HOSTNAME = If a DHCP server requires a hostname, specify the hostname for the system.

  • DHCPV6C = {yes|no}. Enable or disable the ability to obtain an IPv6 address via DHCP.

  • DHCPV6C = Specify DHCP options for IPv6.

    • -P = Prefix delegation.

    • -S = Obtain a stateless address.

    • -N = Revert to normal operation after using -P or -T.

    • -T = Temporarily obtain an IPv6 address.

    • -D = Specify a new value for the DHCP Unique Identifier (DUID).

  • IPV6_AUTOCONF = {yes|no}. Enable or disable autoconf configuration.

  • DNS{1,2} = The DNS nameservers to use for /etc/resolv.conf.

  • PEERDNS = {yes|no}. Enable or disable the ability to get DNS information for /etc/resolv.conf from DHCP or IPCP.

  • ETHTOOL_OPTS = Provide special ethtool options for the interface.

  • IPADDR = An IPv4 address. This option’s name can have a number appended to it (starting at 0) to specify multiple IP addresses.

  • NETMASK = The IPv4 address’s netmask.

  • PREFIX = Instead of specifying a netmask, the CIDR prefix can be used.

  • GATEWAY = The IPv4 default gateway to use. All IPv4 traffic will route out to this IP.

  • MTU = The size of packets to use, in bytes. The default is 1500 and the maximum is 9000.

  • IPV6INIT = {yes|no}. Enable or disable IPv6 on this interface.

  • IPV6ADDR6 = An IPv6 address with it’s CIDR prefix.

  • IPV6ADDR_SECONDARIES = Other IPv6 addresses, comma separated, to add tot his interface.

  • IPV6_PRIVACY=rfc3041 = Use the RFC 3041 standard to create a stateless IPv6 address using the interface’s MAC address. By default, if this option is not defined, it is turned off for security concerns.

  • IP6MTU = The size of packets to use, in bytes.

  • MASTER = The master device for bonds.

  • BONDING_OPTS = Additional bonding driver options.

  • HOTPLUG = Default: yes. Activate his device if it is hot plugged into the system.

  • LINKDELAY = The number of seconds to wait before loading up the network interface’s configuration.

  • SRCADDR = The primary source address for outgoing traffic.

  • USERCTL = Enable or disable the ability to allow non-privileged users to manage the interface.

  • NM_CONTROLLED = {yes|no}. Enable or disable Network Manager control over this interface.

[8]

Routes

In RHEL 7, static routes now use the iproute2 syntax. A new route-<INTERFACE> file defines the route. Only one default GATEWAY can be set in the original ifcfg- configuration files.

Syntax:

$ sudo vim /etc/sysconfig/network-scripts/route-<INTERFACE>
<DESTINATION_NETWORK_CIDR> via <SOURCE_IP> dev <INTERFACE>

Example:

$ sudo vim /etc/sysconfig/network-scripts/route-eth0
192.168.100.0/24 via 10.0.0.1 dev eth0

[9][10]

Bridging

A simple bridge using the Linux kernel can be configured using this basic template. The physical network interface should reference a bridge interface. The bridge interface will then contain the IP addressing information.

File: ifcfg-<NIC>

DEVICE="<NIC>"
TYPE=Ethernet
NM_CONTROLLED=no
BRIDGE=<BRIDGE>

File: ifcfg-<BRIDGE>

DEVICE="<BRIDGE>"
TYPE=Bridge
ONBOOT=yes
NM_CONTROLLED=no

[11]

Open vSwitch

Various bridge configurations can be made. It is common to use a normal bridge for allow virtual machines to have full access to the network or use an Open vSwitch bridge for OpenStack’s software defined networking (SDN).

Open vSwitch bridge syntax (CLI):

$ sudo ovs-vsctl add-port <OVS_BRIDGE> <NIC>
$ sudo ovs-vsctl add-br <OVS_BRIDGE>

[12]

Open vSwitch bridge syntax (configuration file):

File: ifcfg-<NIC>

DEVICE="<NIC>"
TYPE="OVSPort"
DEVICETYPE="ovs"
OVS_BRIDGE="<OVS_BRIDGE>"

File: ifcfg-<OVS_BRIDGE>

DEVICE="<OVS_BRIDGE>"
TYPE="OVSBridge"
DEVICETYPE="ovs"

Open vSwitch bridge example (configuration file):

File: ifcfg-eth1

DEVICE="eth1"
TYPE="OVSPort"
DEVICETYPE="ovs"
OVS_BRIDGE="br0-ovs"
BOOTPROTO="none"
ONBOOT="yes"

File: ifcfg-br0-ovs

DEVICE="br0-ovs"
TYPE="OVSBridge"
DEVICETYPE="ovs"
IPADDR0=10.10.10.201
PREFIX0=24
GATEWAY=10.10.10.1
BOOTPROTO="none"
ONBOOT="yes"

[13]

Bonding

Bonding allows for multiple devices to be used as a single virtual device. The physical NICs need to be configured as bond slaves. Then a new bond configuration can be created for the bond device.

Bond master syntax:

DEVICE=<BOND_DEVICE>
BONDING_MASTER=yes
BONDING_OPTS="mode=<BONDING_MODE>"

Bond master example:

DEVICE=bond0
BONDING_MASTER=yes
BONDING_OPTS="mode=balance-alb"

Bond slave syntax:

MASTER=<BOND_DEVICE>
SLAVE=yes

Bond slave example:

NAME=eth0
BOOTPROTO=none
MASTER=bond0
SLAVE=yes

[14]

A full list of bonding driver options for “bonding_opts” can be found here: https://wiki.linuxfoundation.org/networking/bonding#bonding-driver-options.

Common bonding_opts options:

  • mode = The bonding method to use.

    • {0|balance-rr} = Load balance using round robin. Every other request goes to/from a different interface.

    • {1|active-backup} = Only one interface is used. If it fails, then a slave device will take over.

    • {2|balancer-xor} = Load balance requests based on the source and destination MAC addresses.

    • {3|broadcast} = All traffic is sent out through all of the network interfaces.

    • {4|802.3ad} = All of the network devices use the same speed and duplex configuration to follow the 802.3ad bonding standard. This requires that the network interfaces are also connected to a switch that supports the IEEE 802.3ad Link Aggregation Control Protocol (LACP) standard. The switch must have LACP enabled on the relevant ports.

    • {5|balance-tlb} = Adaptive transmit load balancing. Load balance outgoing requests based on the slave usage.

    • {6|balance-alb} = Adaptive load balancing. Load balance incoming and outgoing requests based on slave usage.

[15]

SSH

Keys

SSH keys are the most common way to authenticate to a UNIX-like server. A public and private key-pair are generated on the client side. For a successful authentication, the server knows of a public key and then a connecting client offers a private key that must go through an algorithm to see if it matches with the public key.

Secure algorithms:

  1. Ed25519 = The most secure.

  2. ECDSA

  3. RSA >= 4096-bit = The most widely supported format.

Insecure algorithms:

  • DSA

  • RSA < 4096-bit

[16]

Generate a new SSH key using the following command:

$ ssh-keygen -t <ALGORITHM> -b <BIT_SIZE>

Troubleshooting

Errors

Error when starting the sshd service and trying to connect to it via a remote host:

$ sudo journalctl -u ssh
Nov 15 00:12:09 debian.example.com systemd[1]: Starting OpenBSD Secure Shell server...
Nov 15 00:12:09 debian.example.com sshd[324]: Could not load host key: /etc/ssh/ssh_host_rsa_key
Nov 15 00:12:09 debian.example.com sshd[324]: Could not load host key: /etc/ssh/ssh_host_ecdsa_key
Nov 15 00:12:09 debian.example.com sshd[324]: Could not load host key: /etc/ssh/ssh_host_ed25519_key
Nov 15 00:12:09 debian.example.com sshd[336]: Could not load host key: /etc/ssh/ssh_host_rsa_key
Nov 15 00:12:09 debian.example.com sshd[336]: Could not load host key: /etc/ssh/ssh_host_ecdsa_key
Nov 15 00:12:09 debian.example.com sshd[336]: Could not load host key: /etc/ssh/ssh_host_ed25519_key
Nov 15 00:12:09 debian.example.com sshd[336]: Server listening on 0.0.0.0 port 22.
Nov 15 00:12:09 debian.example.com sshd[336]: Server listening on :: port 22.
Nov 15 00:12:09 debian.example.com systemd[1]: Started OpenBSD Secure Shell server.
Nov 15 00:13:19 debian.example.com sshd[398]: error: Could not load host key: /etc/ssh/ssh_host_rsa_key
Nov 15 00:13:19 debian.example.com sshd[398]: error: Could not load host key: /etc/ssh/ssh_host_ecdsa_key
Nov 15 00:13:19 debian.example.com sshd[398]: error: Could not load host key: /etc/ssh/ssh_host_ed25519_key
Nov 15 00:13:19 debian.example.com sshd[398]: fatal: No supported key exchange algorithms [preauth]

Solution:

  • Create the host key files on the sshd server [18]:

    $ sudo ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key
    $ sudo ssh-keygen -t ecdsa -f /etc/ssh/ssh_host_ecdsa_key
    $ sudo ssh-keygen -t ed25519 -f /etc/ssh/ssh_host_ed25519_key
    

History


Bibliography

  1. “How to switch from NetworkManager to systemd-networkd on Linux.” Xmodulo. August 31, 2015. Accessed November 27, 2016. http://xmodulo.com/switch-from-networkmanager-to-systemd-networkd.html

  2. “systemd.network — Network configuration.” freedesktop.org. Accessed November 27, 2016. https://www.freedesktop.org/software/systemd/man/systemd.network.html

  3. “systemd.netdev — Virtual Network Device configuration.” freedesktop.org. Accessed November 27, 2016. https://www.freedesktop.org/software/systemd/man/systemd.netdev.html

  4. “Managing WPA wireless with systemd-networkd ?” Arch Linux Wiki - Networking, Server, and Protection. March 13, 2014. Accessed November 27, 2016. https://bbs.archlinux.org/viewtopic.php?id=178625

  5. “Frequently Asked Questions Open vSwitch.” Open vSwitch Support. March 30, 2017. April 9, 2017. http://openvswitch.org/support/dist-docs-2.5/FAQ.md.html

  6. “[Ubuntu 16.04] Network Configuration.” Ubuntu Documentation. June 23, 2017. Accessed July 2, 2017. https://help.ubuntu.com/lts/serverguide/network-configuration.html

  7. “Disable consistent network device naming in RHEL7.” Red Hat Community Discussions. June 11, 2014. Accessed January 7, 2016. https://access.redhat.com/discussions/916973

  8. “Interface Configuration Files.” Accessed January 7, 2016. https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Deployment_Guide/s1-networkscripts-interfaces.html

  9. “How to add a new static route on RHEL7 Linux.” Linux Config. March 17, 2015. Accessed April 9, 2017. https://linuxconfig.org/how-to-add-new-static-route-on-rhel7-linux

  10. “Static Routes and the Default Gateway.” Red Hat Documentation. March 15, 2017. Accessed April 9, 2017. https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Deployment_Guide/s1-networkscripts-static-routes.html

  11. “Network Bridge.” Red Hat Documentation. May 29, 2016. Accessed February 24, 2017. https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Deployment_Guide/s2-networkscripts-interfaces_network-bridge.html

  12. Configuring Libvirt guests with an Open vSwitch bridge.” Kashyap Chamarthy. July 13, 2013. Accessed November 27, 2016. https://kashyapc.com/2013/07/13/configuring-libvirt-guests-with-an-open-vswitch-bridge/

  13. “Configure Fedora Server with Open vSwitch and Libvirt.” GitHub Gist - jdoss. October 31, 2015. Accessed November 27, 2016. https://gist.github.com/jdoss/64ecd24b74792efaa794

  14. “RHEL: Linux Bond / Team Multiple Network Interfaces (NIC) Into a Single Interface.” nixCraft. March 27, 2016. Accessed January 7, 2016. https://www.cyberciti.biz/tips/linux-bond-or-team-multiple-network-interfaces-nic-into-single-interface.html

  15. “Bonding Interfaces.” CentOS Tips and Tricks. January 22, 2013. Accessed January 7, 2016. https://wiki.centos.org/TipsAndTricks/BondingInterfaces

  16. “Upgrade Your SSH Key to Ed25519.” RISAN A journal of a passionate coder. January 9, 2018. Accessed January 12, 2021. https://medium.com/risan/upgrade-your-ssh-key-to-ed25519-c6e8d60d3c54

  17. “Bridging Network Connections.” Debian Wiki. April 24, 2020. Accessed November 10, 2020. https://wiki.debian.org/BridgeNetworkConnections

  18. “sshd shuts down with “No supported key exchange algorithms” error.” serverfault.com. August 8, 2019. Accessed November 14, 2020. https://serverfault.com/questions/158151/sshd-shuts-down-with-no-supported-key-exchange-algorithms-error

  19. “NetworkManager.” ArchWiki. January 14, 2024. Accessed January 20, 2024. https://wiki.archlinux.org/title/NetworkManager

  20. “Mobile broadband modem.” ArchWiki January 1, 2024. Accessed January 20, 2024. https://wiki.archlinux.org/title/Mobile_broadband_modem

  21. “IP connectivity setup in LTE modems.” ModemManager. Accessed January 20, 2024. https://modemmanager.org/docs/modemmanager/ip-connectivity-setup-in-lte-modems/

  22. “Changes/dhclient deprecation.” Fedora Project Wiki. November 27, 2023. Accessed January 20, 2024. https://fedoraproject.org/wiki/Changes/dhclient_deprecation

  23. “Using NetworkManager and ModemManager in Linux to automatically establish a connection and configure IP details.” Techship. Accessed January 20, 2024. https://techship.com/faq/using-network-manager-and-modem-manager-in-linux-to-automatically-establish-a-connection-and-configure-ip-details/

  24. “I can’t connect to Steam on my computer when using my phone as a hotspot.” Google Fi Wireless Help. March 16, 2023. Accessed January 20, 2024. https://support.google.com/fi/thread/206216082/i-can-t-connect-to-steam-on-my-computer-when-using-my-phone-as-a-hotspot?hl=en

  25. “Chapter 9. Networking.” Red Hat Customer Portal. Accessed January 23, 2024. https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/considerations_in_adopting_rhel_8/networking_considerations-in-adopting-rhel-8

  26. “How to disable IPv6 on Linux.” TechRepublic. October 31, 2022. Accessed January 24, 2024. https://www.techrepublic.com/article/how-to-disable-ipv6-on-linux/

  27. “ipv4.” NetworkManager Reference Manual. Accessed January 24, 2024. https://developer-old.gnome.org/NetworkManager/stable/settings-ipv4.html

  28. “Steam doesn’t work on IPv6-only (NAT64/DNS64) networks #3372.” GitHub ValveSoftware/steam-for-linux. November 16, 2023. Accessed January 23, 2024. https://github.com/ValveSoftware/steam-for-linux/issues/3372

  29. “IPv6.” ArchWiki. January 7, 2024. Accessed January 23, 2024. https://wiki.archlinux.org/title/IPv6

  30. “Make Linux Prefer IPv4.” lkiesow::weblog. March 11, 2022. Accessed January 23, 2024. https://weblog.lkiesow.de/20220311-make-linux-prefer-ipv4.html

  31. “Changing DNS with systemd-resolved.” Enovision Notes. September 13, 2022. Accessed January 25, 2024. https://notes.enovision.net/linux/changing-dns-with-resolve

  32. “[SOLVED] systemd-resolved – do not use DNS from DHCP.” Arch Linux Forums. August 26, 2023. Accessed January 25, 2024. https://bbs.archlinux.org/viewtopic.php?id=258865

  33. “Setting up custom DNS in NetworkManager.” Manjaro Linux Forum. April 21, 2021. Accessed January 25, 2024. https://forum.manjaro.org/t/setting-up-custom-dns-in-networkmanager/59249

  34. “Change Primary DNS server from CLI/terminal macos Monterey.” Super User. November 24, 2023. Accessed January 25, 2024. https://superuser.com/questions/1749552/change-primary-dns-server-from-cli-terminal-macos-monterey