SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2015-06-08 21:19:01

Head_on_a_Stick
CatMod
From: A world of pure imagination
Registered: 2014-01-21
Posts: 4,797

Ethernet connection using systemd-networkd

For those with desktop set ups (ie, a single ethernet connection and no wireless) wishing to flee the NetworkManager hegemony there is an alternative: systemd-networkd smile

This brief guide is shamelessly copied from the ArchWiki in an attempt to make me look more clever than I really am.
https://wiki.archlinux.org/index.php/Systemd-networkd

Create the configuration file at /etc/systemd/network/wired.network first (you may need to change "eth0" to whichever interface you are using, `ip r` will show this as "dev").

For connection using DHCP:

[Match]
Name=eth0

[Network]
DHCP=ipv4

You will need to install a different DHCP client for this to work (thanks to @mzsade over at FDN for pointing this out):

sudo apt-get install dhcpcd5

For static IPs:

[Match]
Name=eth0

[Network]
DNS=8.8.8.8
DNS=8.8.4.4

[Address]
Address=192.168.1.23/24

[Route]
Gateway=192.168.1.254

I have used Google's DNS nameservers in this example.

Replace the "Address" numbers with the IP you wish to use (the number after the forward slash is the netmask) and replace "Gateway" numbers with the IP address of your router (`ip r` shows this as "default via").

Next, delete /etc/resolv.conf and create a symlink to the systemd version in it's place:

sudo rm /etc/resolv.conf
sudo ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf

Finally, enable the .services to start at the next boot:

sudo systemctl enable systemd-networkd.service
sudo systemctl enable systemd-resolved.service

You will also need to disable NetworkManager (or any other networking .services you are using):

sudo systemctl disable NetworkManager

If you are using ifupdown, make sure all the lines in /etc/network/interfaces are commented out (or deleted) except these two:

auto lo
iface lo inet loopback

Now reboot.

Thank you smile

Last edited by Head_on_a_Stick (2015-07-23 14:16:53)

Offline

Be excellent to each other!

#2 2015-06-08 21:25:17

damo
#! gimpbanger
From: N51.5 W002.8 (mostly)
Registered: 2011-11-24
Posts: 5,434

Re: Ethernet connection using systemd-networkd

Bookmarked smile

Keep 'em coming, this stuff is great!


BunsenLabs Group on deviantArt
damo's gallery on deviantArt
Openbox themes
Forum Moderator smile

Offline

#3 2015-06-09 01:49:18

KrunchTime
#! Die Hard
From: not where I belong
Registered: 2012-03-02
Posts: 3,264

Re: Ethernet connection using systemd-networkd

Don't think I'll use it as network-manager is my fave, but thank you for sharing.

damo wrote:

Bookmarked smile

Keep 'em coming, this stuff is great!

Yeah, he's a treasure trove of Linux knowledge.  I'm glad both of you are here in the forums.  wink

Last edited by KrunchTime (2015-06-09 01:51:19)


Linux User #586672
Come and Die -- Kyle Idleman

Offline

#4 2015-06-09 14:57:50

PackRat
#! Die Hard
From: USA
Registered: 2011-03-03
Posts: 1,572

Re: Ethernet connection using systemd-networkd

<snip>
sudo rm /etc/resolv.conf
sudo ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf
<snip>

Concerning this part. Does the -

/run/systemd/resolve/resolv.conf 

directory and file exist on a default Bunsen install? It is not on my recent clean install of Debian Testing.

Your referenced Arch Wiki page recommends -

See man systemd-resolved

concerning this step.

Last edited by PackRat (2015-06-09 15:02:06)


"It does not require many words to speak the truth." - Chief Joseph, Nez Perce tribe

Offline

#5 2015-06-09 16:49:00

Head_on_a_Stick
CatMod
From: A world of pure imagination
Registered: 2014-01-21
Posts: 4,797

Re: Ethernet connection using systemd-networkd

PackRat wrote:

Does the -

/run/systemd/resolve/resolv.conf 

directory and file exist on a default Bunsen install?

The directory and file is created by systemd-resolved.service -- once this is enabled, the symlink target will exist at the next boot.

I am using systemd-networkd in my BunsenLabs system at the moment so I know it works wink

Offline

#6 2015-06-20 15:34:11

Nili
#! Die Hard
From: 127.0.0.1
Registered: 2013-03-20
Posts: 811
Website

Re: Ethernet connection using systemd-networkd

Awesome Head_on_a_Stick, i am still on ifupdown satisfied, I shall have in mind if 'll change.
Thanks


# Debian GNU/Linux 8:8.2 (netinst/stable)
# Packages Installed: 541
# Linux debian 3.16.0-4-686-pae #1 SMP Debian 3.16.7-ckt11-1+deb8u4 (2015-09-19) i686 GNU/Linux
# Startup finished in 2.850s (kernel) + 6.473s (userspace) = 9.324s

Offline

#7 2015-06-20 16:28:23

Head_on_a_Stick
CatMod
From: A world of pure imagination
Registered: 2014-01-21
Posts: 4,797

Re: Ethernet connection using systemd-networkd

Nili wrote:

i am still on ifupdown

Using the slow method, eh?

If you ever get bored of waiting for the "LSB" message to time out during boot up, you know where to go...
wink

Offline

#8 2015-06-20 16:44:59

Nili
#! Die Hard
From: 127.0.0.1
Registered: 2013-03-20
Posts: 811
Website

Re: Ethernet connection using systemd-networkd

Guess what? i always thought ifupdown was waster. :8

While "LSB" message, been some days that i come around to stop the messages but i didn't take very seriously so stopped quickly tweaking.

Today I am a bit tired, tweak begin tomorrow on this thread smile

Kindly regards!!!


# Debian GNU/Linux 8:8.2 (netinst/stable)
# Packages Installed: 541
# Linux debian 3.16.0-4-686-pae #1 SMP Debian 3.16.7-ckt11-1+deb8u4 (2015-09-19) i686 GNU/Linux
# Startup finished in 2.850s (kernel) + 6.473s (userspace) = 9.324s

Offline

#9 2015-09-07 12:52:50

mzsade
#! Junkie
Registered: 2009-09-27
Posts: 276

Re: Ethernet connection using systemd-networkd

Sorry, bad form. Will ask for help elsewhere.

Last edited by mzsade (2015-09-07 14:26:43)

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.
Server: acrobat

Debian Logo