[systemd-devel] Systems-nspawn host-only networking?

Samuel Taylor sam at tailornetworks.com
Tue Jun 20 16:07:30 UTC 2017


Hello to all,
 
I'm new to the scene here so forgive me if this is not the most appropriate place to post this. I have posed this question to Freenet IRC a couple of times but I've not had any takers.
 
At the moment I am in the process of deploying a couple of nspawn containers, one utilizing a VirtualEthernet config and the other sharing the network adapter of the host, which I believe is typically, outside of the nspawn universe, referred to as host-only networking? (please correct me if I am wrong).
 
At present I have omitted --network-veth from the default systemd-nspawn .service unit file for containers, to enable the use of host-only networking within one of my containers. For the second container which utilizes a VirtualEthernet I have configured this parameter using the .nspawn file. Is there a way of avoiding having to modify the default systemd-nspawn unit file and instead configuring host-only networking within the .nspawn file? I have noted from the documentation that a network interface can be specified i.e 
 
[Network]
Interface=eth0
 
However, from the documentation this would appear to remove the adapter from the calling namespace, and it would only be available within my container, which is not the case when removing --network-veth from the equation and not setting anything at all.
 
If this is considered a bad practice I will instead use the VirtualEthernet and Port parameters on my container currently utilising host-only networking.
 
I've been really enjoying getting my hands dirty with systemd the last few days, so if you could shed some light on where I'm going wrong here, that would be greatly appreciated!
 
Many thanks,
 
Sam


Sent from my iPhone


More information about the systemd-devel mailing list