S
S
Satisfied IT2020-12-12 23:17:08
linux
Satisfied IT, 2020-12-12 23:17:08

How to write this config in the systemd.network format correctly?

We have the following network config:

cat /etc/network/interfaces

iface ens3 inet static
address <Основной IP адрес машины>
netmask 255.255.255.255
gateway 10.0.0.1
pointopoint 10.0.0.1


It's in netplan format.
network:
   version: 2
   renderer: networkd
     ethernets:
        ens3:
            addresses: [ <Основной IP адрес машины>/32 ]
        routes:
            - to: 0.0.0.0/0
           via: 10.0.0.1
           on-link: true
       nameservers:
           addresses: [ 8.8.4.4, 8.8.8.8 ]


Or it is for centos
cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
BOOTPROTO="static"
IPADDR=<Основной IP адрес машины>
NETMASK=255.255.255.255
SCOPE="peer 10.0.0.1"
DNS1="188.120.247.2"

файл /etc/sysconfig/network-scripts/route-eth0:

ADDRESS0=0.0.0.0
NETMASK0=0.0.0.0
GATEWAY0=10.0.0.1


How to convert it to systemd.network format? I can not find an analogue of the pointopoint 10.0.0.1 instruction, and without this there is no network.

And let's skip the discussion of the reasons for choosing systemd.network and which systemd is generally not good.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question