<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>networkd &#8211; FU-BAR</title>
	<atom:link href="/tag/networkd/feed/" rel="self" type="application/rss+xml" />
	<link>/</link>
	<description>Fucked Up Beyond All Recognition</description>
	<lastBuildDate>Sat, 07 Jan 2017 21:07:47 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>/wp-content/uploads/2020/07/cropped-eu-header-20200715-2-32x32.png</url>
	<title>networkd &#8211; FU-BAR</title>
	<link>/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Simple experiment with systemd-networkd and systemd-resolved</title>
		<link>/2017/01/07/systemd-networkd-resolved/</link>
		
		<dc:creator><![CDATA[Rui Seabra]]></dc:creator>
		<pubDate>Sat, 07 Jan 2017 19:40:06 +0000</pubDate>
				<category><![CDATA[How-To]]></category>
		<category><![CDATA[Free Software]]></category>
		<category><![CDATA[networkd]]></category>
		<category><![CDATA[resolved]]></category>
		<category><![CDATA[systemd]]></category>
		<guid isPermaLink="false">/?p=2572</guid>

					<description><![CDATA[In my previous post, I wrote about how simple it was to create containers with systemd-nspawn. But what if you wanted to expose to the outside network to a container? The rest of the world can&#8217;t add mymachines to /etc/nsswitch.conf and expect it to work, right? And what if you were trying to reduce the &#8230; <p class="link-more"><a href="/2017/01/07/systemd-networkd-resolved/" class="more-link">Continue reading<span class="screen-reader-text"> "Simple experiment with systemd-networkd and systemd-resolved"</span></a></p>]]></description>
										<content:encoded><![CDATA[<p>In my previous post, I wrote about how simple it was to create <a href="/2017/01/07/systemd-nspawn-experiment/">containers with systemd-nspawn</a>.</p>
<p>But what if you wanted to expose to the outside network to a container? The rest of the world can&#8217;t add mymachines to /etc/nsswitch.conf and expect it to work, right?</p>
<p>And what if you were trying to reduce the installed dependencies in an operating system using systemd?</p>
<p>Enter <strong>systemd-networkd</strong> and <strong>systemd-resolved</strong>&#8230;</p>
<p><strong>Firstly</strong>, this Fedora 25 host is a kvm guest so I added a new network interface for &#8220;service&#8221; were I created the bridge (yes, with nmcli, why not learn it as well on the way?)</p>
<pre>nmcli con add type bridge con-name Containers ifname Containers
nmcli con add type ethernet con-name br-slave-1 ifname ens8 master Containers
nmcli con up Containers</pre>
<p><strong>Then</strong>, in container test, I configured a rule to use DHCP (and left in a modicum of a template for static addresses, no&#8230; that&#8217;s not my network) and replaced /etc/resolve.conf with a symlink to the file systemd-resolved manages:</p>
<pre>cat &lt;&lt;EOF &gt; /etc/systemd/network/20-default.network
[Match]
Name=host0

[Network]
DHCP=yes
# or swap the above line by the lines below:
#Address=192.168.10.100/24
#Gateway=192.168.10.1
#DNS=8.8.8.8
EOF

rm /etc/resolv.conf
ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf</pre>
<p><strong>Finally</strong>, I enabled and started networkd and resolved:</p>
<pre>systemctl enable systemd-networkd
systemctl enable systemd-resolved
systemctl start systemd-networkd
systemctl start systemd-resolved</pre>
<p>A few seconds later&#8230;</p>
<pre>-bash-4.3# ip addr list dev host0
2: host0@if29: &lt;NO-CARRIER,BROADCAST,MULTICAST,UP&gt; mtu 1500 qdisc noqueue state LOWERLAYERDOWN group default qlen 1000
 link/ether 06:14:9c:9e:ac:ca brd ff:ff:ff:ff:ff:ff link-netnsid 0
 inet 192.168.10.92/24 brd 192.168.10.255 scope global host0
 valid_lft forever preferred_lft forever

-bash-4.3# cat /etc/resolv.conf 
# This file is managed by systemd-resolved(8). Do not edit.
#
# This is a dynamic resolv.conf file for connecting local clients directly to
# all known DNS servers.
#
# Third party programs must not access this file directly, but only through the
# symlink at /etc/resolv.conf. To manage resolv.conf(5) in a different way,
# replace this symlink by a static file or a different symlink.
#
# See systemd-resolved.service(8) for details about the supported modes of
# operation for /etc/resolv.conf.

nameserver 192.168.10.1</pre>
<p>Happy hacking!</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
