systemd

/etc/systemd/network/wired.network

[Match]
Name=enp1s0

[Link]
RequiredForOnline=routable

[Network]
Address=192.168.122.123/24
Gateway=192.168.122.1
DNS=192.168.122.1

ifupdown

/etc/network/interfaces

Static

allow-hotplug enp1s0
iface enp1s0 inet static
        address 192.168.1.2
        netmask 255.255.255.0
        gateway 192.168.1.1

DHCP

allow-hotplug enp1s0
iface enp1s0 inet dhcp