<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Blog blog("Baptiste Wicht"); (Posts about Network)</title><link>https://baptiste-wicht.com/</link><description></description><atom:link href="https://baptiste-wicht.com/categories/network.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><lastBuildDate>Sun, 15 Feb 2026 06:57:40 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Linux tip: Force systemd networkd to wait for DHCP</title><link>https://baptiste-wicht.com/posts/2014/10/linux-tip-force-systemd-networkd-to-wait-for-dhcp.html</link><dc:creator>Baptiste Wicht</dc:creator><description>&lt;p&gt;Recently, I started using systemd-networkd to manage my network. It works really
good for static address configuration, but I experienced some problem with DHCP.
There is DHCP client support integrated into systemd, so I wanted to use this
instead of using another DHCP client.&lt;/p&gt;
&lt;p&gt;(If you are not familiar with systemd-networkd, you can have a look at the last
section of this article)&lt;/p&gt;
&lt;p&gt;The problem with that is that services are not waiting for DHCP leases to be
obtained. Most services (sshd for instance), are waiting for network.target,
however, network.target does not wait for the DHCP lease to be obtained from the
server. If you configured ssh on a specific IP and this IP is obtained with
DHCP, it will fail at startup. The same is true for NFS mounts for instance.&lt;/p&gt;
&lt;section id="force-services-to-wait-for-the-network-to-be-configured"&gt;
&lt;h2&gt;Force services to wait for the network to be configured&lt;/h2&gt;
&lt;p&gt;The solution is to make services like sshd waits for network-online.target
instead of network.target. There is a simple way in systemd to override default
service files. For a X.service, systemd will also parse all the
/etc/systemd/X.service.d/*.conf files.&lt;/p&gt;
&lt;p&gt;For instance, to make sshd be started only after DHCP is finished&lt;/p&gt;
&lt;p&gt;/etc/systemd/system/sshd.service.d/network.conf:&lt;/p&gt;
&lt;pre class="literal-block"&gt;[Unit]
Wants=network-online.target
After=network-online.target&lt;/pre&gt;
&lt;p&gt;However, by default, network-online.target does not wait for anything. You'll
have to enable another service to make it work:&lt;/p&gt;
&lt;pre class="literal-block"&gt;systemctl enable systemd-networkd-wait-online&lt;/pre&gt;
&lt;p&gt;And another note, at least on Gentoo, I had to use systemd-216 for it to work:&lt;/p&gt;
&lt;pre class="literal-block"&gt;emerge -a "=sys-apps/systemd-216"&lt;/pre&gt;
&lt;p&gt;And after this, it worked like a charm at startup.&lt;/p&gt;
&lt;/section&gt;
&lt;section id="force-nfs-mounts-to-wait-for-the-network"&gt;
&lt;h2&gt;Force NFS mounts to wait for the network&lt;/h2&gt;
&lt;p&gt;There is no service file for nfs mounts, but there is a target remote-fs.target
that groups the remote file systems mounts. You can override its configuration
in the same as a service:&lt;/p&gt;
&lt;p&gt;/etc/systemd/system/remote-fs.target.d/network.conf:&lt;/p&gt;
&lt;pre class="literal-block"&gt;[Unit]
Wants=network-online.target
After=network-online.target&lt;/pre&gt;
&lt;/section&gt;
&lt;section id="conclusion"&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;Here we are, I hope this tip will be useful to some of you ;)&lt;/p&gt;
&lt;/section&gt;
&lt;section id="appendix-configure-interface-with-dhcp-with-systemd"&gt;
&lt;h2&gt;Appendix. Configure interface with DHCP with systemd&lt;/h2&gt;
&lt;p&gt;To configure an interface with DHCP, you have to create a .network file in
/etc/systemd/network/. For instance, here is my
/etc/systemd/network/local.network file:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code text"&gt;&lt;a id="rest_code_482ea518a17b4891a51e7db29e7dce3b-1" name="rest_code_482ea518a17b4891a51e7db29e7dce3b-1" href="https://baptiste-wicht.com/posts/2014/10/linux-tip-force-systemd-networkd-to-wait-for-dhcp.html#rest_code_482ea518a17b4891a51e7db29e7dce3b-1"&gt;&lt;/a&gt;[Match]
&lt;a id="rest_code_482ea518a17b4891a51e7db29e7dce3b-2" name="rest_code_482ea518a17b4891a51e7db29e7dce3b-2" href="https://baptiste-wicht.com/posts/2014/10/linux-tip-force-systemd-networkd-to-wait-for-dhcp.html#rest_code_482ea518a17b4891a51e7db29e7dce3b-2"&gt;&lt;/a&gt;Name=enp3s0
&lt;a id="rest_code_482ea518a17b4891a51e7db29e7dce3b-3" name="rest_code_482ea518a17b4891a51e7db29e7dce3b-3" href="https://baptiste-wicht.com/posts/2014/10/linux-tip-force-systemd-networkd-to-wait-for-dhcp.html#rest_code_482ea518a17b4891a51e7db29e7dce3b-3"&gt;&lt;/a&gt;
&lt;a id="rest_code_482ea518a17b4891a51e7db29e7dce3b-4" name="rest_code_482ea518a17b4891a51e7db29e7dce3b-4" href="https://baptiste-wicht.com/posts/2014/10/linux-tip-force-systemd-networkd-to-wait-for-dhcp.html#rest_code_482ea518a17b4891a51e7db29e7dce3b-4"&gt;&lt;/a&gt;[Network]
&lt;a id="rest_code_482ea518a17b4891a51e7db29e7dce3b-5" name="rest_code_482ea518a17b4891a51e7db29e7dce3b-5" href="https://baptiste-wicht.com/posts/2014/10/linux-tip-force-systemd-networkd-to-wait-for-dhcp.html#rest_code_482ea518a17b4891a51e7db29e7dce3b-5"&gt;&lt;/a&gt;DHCP=v4
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;and you have to enable systemd-networkd:&lt;/p&gt;
&lt;pre class="literal-block"&gt;systemctl enable systemd-networkd&lt;/pre&gt;
&lt;/section&gt;</description><category>Gentoo</category><category>Linux</category><category>Network</category><category>systemd</category><category>Tips</category><guid>https://baptiste-wicht.com/posts/2014/10/linux-tip-force-systemd-networkd-to-wait-for-dhcp.html</guid><pubDate>Wed, 01 Oct 2014 18:18:55 GMT</pubDate></item><item><title>ZyXEL GS1910-24 Managed Gigabit Switch Review</title><link>https://baptiste-wicht.com/posts/2013/07/zyxel-gs1910-managed-gigabit-switch-review.html</link><dc:creator>Baptiste Wicht</dc:creator><description>&lt;p&gt;A short time ago, &lt;a title="Home Server Adventure – Step 1" href="http://www.baptiste-wicht.com/2013/07/home-server-adventure-step-1/"&gt;I decided to install servers in a rack at my home&lt;/a&gt;. Although working very well, my 3Com managed was too much noisy for being at home. That is why I decided to change it for fanless switch. After some research, I finally chose a ZyXEL GS1910-24. It is a web-manageable gigabit switch. I chose the 24 ports version. This version has also 4 SFPs that replace 4 normal ports if enabled. I don't think I will ever need the SFPs, but it is nice to know that there are here if necessary. This switch has a lot of cool features, it supports IPV6, QoS, VLANs, filtering, RADIUS and so on.&lt;/p&gt;
&lt;h4&gt;The package&lt;/h4&gt;

&lt;p&gt;The package does not contains a lot of things, but does contain the essential:&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;span style="line-height: 13px;"&gt;The switch itself&lt;/span&gt;&lt;/li&gt;
    &lt;li&gt;A power code&lt;/li&gt;
    &lt;li&gt;Rack mounting brackets and screws&lt;/li&gt;
    &lt;li&gt;Manuals&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here is a picture on the package:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://baptiste-wicht.com/wp-content/uploads/2013/07/2013-07-11-16.51.47.jpg"&gt;&lt;img class="aligncenter size-medium wp-image-2574" alt="2013-07-11 16.51.47" src="https://baptiste-wicht.com/wp-content/uploads/2013/07/2013-07-11-16.51.47-300x168.jpg" width="300" height="168"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The switch is really small, twice narrower than my 3Com switch and more than twice lighter.&lt;/p&gt;
&lt;p&gt;Nothing special to say about the package, it is neatly done and has everything that is necessary.&lt;/p&gt;
&lt;h4&gt;Installation&lt;/h4&gt;

&lt;p&gt;The installation inside a rack is really easy. Each bracket is mounted with 4 screws onto the switch and then two screws are holding each bracket into place in the rack. Here is a picture of the rack:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://baptiste-wicht.com/wp-content/uploads/2013/07/2013-07-11-17.07.00.jpg"&gt;&lt;img class="aligncenter size-medium wp-image-2575" alt="2013-07-11 17.07.00" src="https://baptiste-wicht.com/wp-content/uploads/2013/07/2013-07-11-17.07.00-300x168.jpg" width="300" height="168"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Once you put the power cord, it directly starts up and everything already works fine. The state of each port is represented by a led. Orange indicates a 100Mbit/s connection while green indicates 1Gbit/s connection.&lt;/p&gt;
&lt;p&gt;The switch does not make a single noise and does not vibrate, it is really good&lt;/p&gt;
&lt;h4&gt;Configuration&lt;/h4&gt;

&lt;p&gt;The easiest way to configure the switch is to use the web configurator. By default, the switch IP is 192.168.1.1. As my router had the same IP, I had to disable it temporarily before changing the IP of the switch.&lt;/p&gt;
&lt;p&gt;The web configuration is very complete, you can change absolutely everything from here. You have also access to a lot of monitoring tools from here. The most useful being of course the port monitoring interface:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://baptiste-wicht.com/wp-content/uploads/2013/07/Screenshot-from-2013-07-11-172745.png"&gt;&lt;img class="aligncenter size-medium wp-image-2576" alt="Port Monitoring" src="https://baptiste-wicht.com/wp-content/uploads/2013/07/Screenshot-from-2013-07-11-172745-300x132.png" width="300" height="132"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I recommend changing the default IP address and the server password as first things on the switch.&lt;/p&gt;
&lt;p&gt;I won't make the list of everything that is configurable on this switch, but the list is pretty impressive.&lt;/p&gt;
&lt;h4&gt;Conclusion&lt;/h4&gt;

&lt;p&gt;I'm really impressed by this switch. The switch is highly configurable and seems to perfectly fit my need. I would totally recommend this switch for rack installation at home. You can also totally use it as a desktop switch if you needs for a big switch on your desktop too&lt;/p&gt;</description><category>Hardware</category><category>Home Server</category><category>Network</category><category>Review</category><category>Server</category><guid>https://baptiste-wicht.com/posts/2013/07/zyxel-gs1910-managed-gigabit-switch-review.html</guid><pubDate>Fri, 12 Jul 2013 06:38:17 GMT</pubDate></item><item><title>Home Server Adventure - Step 1</title><link>https://baptiste-wicht.com/posts/2013/07/home-server-adventure-step-1.html</link><dc:creator>Baptiste Wicht</dc:creator><description>&lt;p&gt;For years now, I've almost always had a server running at home. First it was an old desktop computer and then it was a QNAP NAS. The problem with the QNAP is that it is not fast at all and not as flexible as I would like it to be. Moreover, I was also running a Teamspeak server on my desktop for when my friends and I were playing together. So I decided to first install a simple server to replace my teamspeak server and I would services of my NAS with my new server. But this time, I decided to go for the complete option: A 19" rack :)&lt;/p&gt;
&lt;h4&gt;Hardware&lt;/h4&gt;

&lt;p&gt;So I bought all I needed to install my 19" rack at home. I bought everything already used on auctions on Ricardo/Anibis (Switzerland Ebay equivalents) and Ebay. Here is what I got:&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;span style="line-height: 13px;"&gt;A 19" inch rack with 40 HE of the mark GURTNER + SCHNIEPP AG&lt;/span&gt;&lt;/li&gt;
    &lt;li&gt;A old Dell Poweredge 1850 server&lt;/li&gt;
    &lt;li&gt;A 8-ports Compaq KVM switch&lt;/li&gt;
    &lt;li&gt;A monitor/keyboard console for administrating the servers&lt;/li&gt;
    &lt;li&gt;A 3Com managed Gigabit switch&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I got that for less than 500$. It is probably possible to get a similar configuration for less than that in the United States.&lt;/p&gt;
&lt;p&gt;Here are some pictures (sorry for the poor quality):&lt;/p&gt;
&lt;p&gt;&lt;a href="https://baptiste-wicht.com/wp-content/uploads/2013/07/2013-07-05-17.58.322.jpg"&gt;&lt;img class="aligncenter size-large wp-image-2568" alt="2013-07-05 17.58.32" src="https://baptiste-wicht.com/wp-content/uploads/2013/07/2013-07-05-17.58.322-576x1024.jpg" width="576" height="1024"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://baptiste-wicht.com/wp-content/uploads/2013/07/2013-07-05-17.59.232.jpg"&gt;&lt;img class="aligncenter size-large wp-image-2567" alt="2013-07-05 17.59.23" src="https://baptiste-wicht.com/wp-content/uploads/2013/07/2013-07-05-17.59.232-576x1024.jpg" width="576" height="1024"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;For now, it is kind of empty. I will also put my NAS and my internet provider router in the rack in the future.&lt;/p&gt;
&lt;p&gt;A this time, the cables are not very good organized, I will try to purchase some guides to make that look better and I will also try to find a rack PDU to distribute power without cables everywhere.&lt;/p&gt;
&lt;p&gt;I also need to find two 120mm fans for the top of my case to improve air circulation. Very quiet 120mm can be found, so noise won't be a problem I think.&lt;/p&gt;
&lt;p&gt;In the future, I also plan to find an UPS, but they are very expensive, so I will continue looking at auctions for them. The problem being that the battery should not be too old.&lt;/p&gt;
&lt;h4&gt;Software&lt;/h4&gt;

&lt;p&gt;Of course, I've installed Gentoo on the server. At first, I wanted to install a Gentoo Hardened distribution with Selinux, but it turned out that it was too much of a hassle. After more than 10 hours of trying to make it work, I started again and in less than two hours my Gentoo installation was working. I will probably try again in the future, at least to harden the server and I hope it will go with less problems. The server is of course gui-less, only console access is more than sufficient.&lt;/p&gt;
&lt;p&gt;For now on, I have only a Teamspeak server and a Mumble server installed on the server, but I plan to add new services on it, Sabnzb for instance.&lt;/p&gt;
&lt;p&gt;I also installed iptables to add some layer of protection, even if I don't think that it is necessary in my case.&lt;/p&gt;
&lt;p&gt;Finally, I used dyndns to map my public ip to a domain name to make it easier to reach. For now, I haven't installed an update client, but I plan to try ddclient.&lt;/p&gt;
&lt;h4&gt;Problems&lt;/h4&gt;

&lt;p&gt;I made some mistake when choosing the components for my installation. First of all, they are too noisy. The server and the switch are a real problem. They are both made for professional installations. Generally 1U server have very small fans (40mm generally) which are very noisy. So I decided to upgrade my configurations with two changes:&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;span style="line-height: 13px;"&gt;I will buy a fanless switch, probably unmanaged. They are plenty of very good fanless switches, even managed one for a reasonable price. I will try to first find a used one on auction, but I may consider buying a new one, as there exists some for about a hundred dollars. &lt;/span&gt;&lt;/li&gt;
    &lt;li&gt;I will replace the Dell server with a custom server. I found some very good cases made by Norco. I'll buy a Micro ATX motherboard and install my old computer configuration (&lt;a title="Why and how I completely left Windows for Linux" href="http://www.baptiste-wicht.com/2013/07/why-how-left-windows-for-linux/"&gt;the one I had before&lt;/a&gt;) on it. It won't cost too much I think, although much more than the 30$ Dell server I have now ;)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The other problem being that the Dell server is too deep for my rack, so I can't close the back part as you can see on the pictures, but replacing it with the Norco case will solve the problem :)&lt;/p&gt;
&lt;h4&gt;Conclusion&lt;/h4&gt;

&lt;p&gt;It might sound crazy to have a complete rack at home, but I thing that it is a great way to experience with servers and network. It is also quite practical if you plan to have several servers.&lt;/p&gt;
&lt;p&gt;I plan to post some posts on the subject on the future, so I hope  that it interests some people.&lt;/p&gt;</description><category>Gentoo</category><category>Hardware</category><category>Home Server</category><category>Network</category><category>Server</category><guid>https://baptiste-wicht.com/posts/2013/07/home-server-adventure-step-1.html</guid><pubDate>Mon, 08 Jul 2013 07:02:05 GMT</pubDate></item></channel></rss>