netplan networkd network-manager
netplan networkd network-manager
https://ubuntu.com/server/docs/network-introduction
https://ubuntu.com/server/docs/network-configuration
https://netplan.io/reference
https://www.linux.com/topic/distributions/how-use-netplan-network-configuration-tool-linux/
https://vitux.com/how-to-configure-networking-with-netplan-on-ubuntu/
Install networkmanager with
sudo apt-get install network-manager
https://askubuntu.com/questions/1031439/am-i-running-networkmanager-or-networkd
# Let NetworkManager manage all devices on this system
network:
version: 2
renderer: NetworkManager
Static IP Address Assignment
To configure your system to use static address assignment, create a netplan configuration in the file /etc/netplan/99_config.yaml. The example below assumes you are configuring your first Ethernet interface identified as eth0. Change the addresses, gateway4, and nameservers values to meet the requirements of your network.
network:
version: 2
renderer: networkd
ethernets:
eth0:
addresses:
- 10.10.10.2/24
gateway4: 10.10.10.1
nameservers:
search: [mydomain, otherdomain]
addresses: [10.10.10.1, 1.1.1.1]
The configuration can then be applied using the netplan command.
sudo netplan apply
Dynamic IP Address Assignment (DHCP Client)
To configure your server to use DHCP for dynamic address assignment, create a netplan configuration in the file /etc/netplan/99_config.yaml. The example below assumes you are configuring your first Ethernet interface identified as enp3s0.
network:
version: 2
renderer: networkd
ethernets:
enp3s0:
dhcp4: true
Name Resolution
Name resolution as it relates to IP networking is the process of mapping IP addresses to hostnames, making it easier to identify resources on a network. The following section will explain how to properly configure your system for name resolution using DNS and static hostname records.
DNS Client Configuration
Traditionally, the file /etc/resolv.conf was a static configuration file that rarely needed to be changed or automatically changed via DCHP client hooks. Systemd-resolved handles name server configuration, and it should be interacted with through the systemd-resolve command. Netplan configures systemd-resolved to generate a list of nameservers and domains to put in /etc/resolv.conf, which is a symlink:
/etc/resolv.conf -> ../run/systemd/resolve/stub-resolv.conf
To configure the resolver, add the IP addresses of the nameservers that are appropriate for your network to the netplan configuration file. You can also add an optional DNS suffix search-lists to match your network domain names. The resulting file might look like the following:
network:
version: 2
renderer: networkd
ethernets:
enp0s25:
addresses:
- 192.168.0.100/24
gateway4: 192.168.0.1
nameservers:
search: [mydomain, otherdomain]
addresses: [1.1.1.1, 8.8.8.8, 4.4.4.4]
The search option can also be used with multiple domain names so that DNS queries will be appended in the order in which they are entered. For example, your network may have multiple sub-domains to search; a parent domain of example.com, and two sub-domains, sales.example.com and dev.example.com.
Comments
Post a Comment