You are not logged in.

#1 2014-07-16 00:14:46

jenia
Member
Registered: 2014-07-12
Posts: 43

systemd-networkd configuration help [Solved]

Hello:

I want to use systemd-netword to setup my network.
Normally I use
   

 dhcpcd eht0 

to setup get my ip.

I thought that systemd-networkd is used to do that automatically. Here is my configuration file:

cat /etc/systemd/network/eth0.network
[Match]
Name=eth0
Host=localhost

[Network]
DHCPv4=true
DNS=14.25.36.9
DNS=41.52.63.8
DNS=47.58.60.7


[Address]
Address=1234:1234:1234:1234/64

[Route]
Gateway=fe80::1

If systemd-networkd is not used for this, then what is it used for?
Also, I need to setup a static ip for my Linode machine:

 https://library.linode.com/networking/configuring-static-ip-interfaces#sph_id2 

But i want to use networkd-systemd instead.

How do I achieve setting up a static ip using systemd-networkd? Is it this way:

 https://wiki.archlinux.org/index.php/Systemd-networkd#Static_IP_network 

or do I need to do something like this:

 https://wiki.archlinux.org/index.php/Network_configuration#Persistent_configuration_on_boot_using_systemd_and_udev_rules 

Thanks in advance for your kind help and time.

Last edited by jenia (2014-07-16 16:27:21)

Offline

#2 2014-07-16 15:39:38

pgoetz
Member
From: Austin, Texas
Registered: 2014-02-21
Posts: 355

Re: systemd-networkd configuration help [Solved]

I'm not sure about systemd-networkd, but there is a much simpler way of doing this.  First, determine your network device using

 

# ip link

Let's say it turns out to be enp101s0

Then you enable and start dhcpd as follows

 # systemctl enable dhcpcd@enp101s0.service
 # systemctl start dhcpcd@enp101s0.service

Please mark your subject with [SOLVED] if this answered your question.

Last edited by pgoetz (2014-07-16 15:42:14)

Offline

#3 2014-07-16 17:04:41

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: systemd-networkd configuration help [Solved]

Not sure where you got

[Network]
DHCPv4=true

from, but it's wrong. As per systemd.network(5), you need

DHCP=both|none|v4|v6

That man page also covers static addresses.

Offline

Board footer

Powered by FluxBB