[systemd-devel] [SPAM] Re: Custom options and passing options via command line.

Lennart Poettering lennart at poettering.net
Tue May 10 13:10:22 UTC 2022


On Di, 10.05.22 12:00, Kamil Jońca (kjonca at op.pl) wrote:

> > The engine is decided at build time, i.e. can be either iptables or
> > nftables.
>
> But there are two kind of "nat' in *tables suites: 1.masquerade or 2.snat.

It uses DNAT or MASQUERADE.

> Especially what wyould be equivalent of:
>
> --8<---------------cut here---------------start------------->8---
> iface qemu inet static
>         address 192.168.11.1
>         netmask 255.255.255.0
>         bridge_ports none
> --8<---------------cut here---------------end--------------->8---
> This creates "bridge" with assigned IP, without any ports (and with
> scripts it can create/drop some nftables rules ...)

A .netdev file with Kind=bridge to create the bridge + a .network file
that assigns an IP address to it?

> >> > Afaics RouteMetric= [DHCPv4] section already does all you need. just
> >> > give the iface whose default route you want to take precedence a lower
> >> > metric and you are done.
> >>
> >> How? By editing files? And what with other examples?
> >
> > I am not sure I follow? when do you intend to change the preference?
>
> When I manually up interface
> (ie. when, for example, issue comand networkctl up "interface name")

We don#t support any explicit logic with that. But you can add a
drop-in for the .network file to /run/ and then reload before upping
the iface.

networkd always wants a complete, declarative idea of what it is
supposed to configure, so that it can adjust things to that. by doing
callouts that modify state you lose that ability, since networkd never
has a complete idea of what is supposed to be in effect, and once you
reload config things will be very confusing.

Lennart

--
Lennart Poettering, Berlin


More information about the systemd-devel mailing list