[systemd-devel] The Bridge on the River PID EINS
Tom Gundersen
teg at jklm.no
Mon Mar 17 01:07:04 PDT 2014
On Mon, Mar 17, 2014 at 2:44 AM, poma <pomidorabelisima at gmail.com> wrote:
> On 17.03.2014 00:34, Kai Krakow wrote:
>> poma <pomidorabelisima at gmail.com> schrieb:
>>
>>> On 09.03.2014 11:39, Kai Krakow wrote:
>>>> poma <pomidorabelisima at gmail.com> schrieb:
>>>>
>>>>> BRIDGED !?
>>>>>
>>>>> $ ll /etc/systemd/network/
>>>>> ... bridge0.netdev
>>>>> ... enp3s0.network
>>>>>
>>>>> $ cat /etc/systemd/network/enp3s0.network
>>>>> [Match]
>>>>> Name=enp3s0
>>>>>
>>>>> [Network]
>>>>> Address=192.168.2.2/24
>>>>> Gateway=192.168.2.1
>>>>> DNS=192.168.2.1
>>>>> Bridge=bridge0
>>>>>
>>>>> $ cat /etc/systemd/network/bridge0.netdev
>>>>> [NetDev]
>>>>> Name=bridge0
>>>>> Kind=bridge
>>>>
>>>> I may be wrong here but I am pretty sure you shouldn't configure IP
>>>> addresses on the bridge members but on the bridge itself instead.
>>>>
>>>
>>> $ man 8 systemd-networkd
>>> ...
>>> Virtual Network Devices
>>> Virtual Network Device files must have the extension .netdev;
>>> other extensions are ignored. Virtual network devices are created as
>>> soon as networkd is started.
>>>
>>> A virtual network device is only created if the "[Match]" section
>>> matches the current environment, or if the section is empty. The
>>> following keys are accepted:
>>>
>>> Host=
>>> Matches against the hostname or machine ID of the host. See
>>> "ConditionHost=" in systemd.unit(5) for details.
>>>
>>> Virtualization=
>>> Checks whether the system is executed in a virtualized
>>> environment and optionally test whether it is a specific implementation.
>>> See "ConditionVirtualization=" in systemd.unit(5) for details.
>>>
>>> KernelCommandLine=
>>> Checks whether a specific kernel command line option is set
>>> (or if prefixed with the exclamation mark unset). See
>>> "ConditionKernelCommandLine=" in systemd.unit(5) for details.
>>>
>>> Architecture=
>>> Checks whether the system is running on a specific
>>> architecture. See "ConditionArchitecture=" in systemd.unit(5) for details.
>>>
>>> The "[NetDev]" section accepts the following keys:
>>>
>>> Name=
>>> The interface name used when creating the netdev. This option
>>> is compulsory.
>>>
>>> Kind=
>>> The netdev kind. Currently, "bridge", "bond" and "vlan" are
>>> supported. This option is compulsory.
>>>
>>> The "[VLAN]" section only applies for netdevs of kind "vlan", and
>>> accepts the following key:
>>>
>>> Id=
>>> The VLAN ID to use. An integer in the range 0–4094. This
>>> option is compulsory.
>>>
>>>
>>> systemd-networkd != NetworkManager
>>> systemd-networkd != system-config-network
>>> ;)
>>>
>>>
>>> poma
>>
>> I don't understand how quoting the man-page should help me. ;-)
>>
>> In my opinion, it is plain wrong to configure an IP address for a bridge
>> member... This is not how bridges are supposed to work.
>>
>> I'd expect to see a bridge0.network which would match "bridge0" and assign
>> an IP address to it. Then, match each physical interface to be enslaved to
>> the bridge with a proper systemd unit.
>>
>> A bridge device is a layer2 router (ethernet). You wouldn't assign IP
>> addresses to network switch ports, would you? Instead, if you had a smart-
>> switch, the IP address would be assigned to the bridge (the switch's
>> internal software bridge port).
>>
>
> Kai, I understand you very well, however I am not the author of the
> 'networkd'. :)
> Besides the manual is more than an excellent reference, of course, if it
> is correct.
> So let the theory go and give an example how to solve this, if you don't
> mind.
What you probably want is something like this:
$ ll /etc/systemd/network/
... bridge0.netdev
... bridge0.network
... enp3s0.network
$ cat /etc/systemd/network/enp3s0.network
[Match]
Name=enp3s0
[Network]
Bridge=bridge0
$ cat /etc/systemd/network/bridge0.netdev
[NetDev]
Name=bridge0
Kind=bridge
$ cat /etc/systemd/network/bridge0.network
[Match]
Name=bridge0
[Network]
Address=192.168.2.2/24
Gateway=192.168.2.1
DNS=192.168.2.1
Cheers,
Tom
More information about the systemd-devel
mailing list