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

Kamil Jońca kjonca at op.pl
Mon May 9 16:12:29 UTC 2022


Lennart Poettering <lennart at poettering.net> writes:

[...]
>>
>> I am afraid you will not cover all cases with networking.
>
> Well, I am not sure. I am pretty sure there are almost always better
> ways to fix the issues that people address with network callout stuff.

I cannot discuss with your conviction.

For now I do not know how handle multiple interface where:
1. set routing according to classles routes from dhcp on some interfaces.
2. set NAT (ie call nftables sctipts) with multitple egress interfaces and bunch
of VM-s inside host.
3. decide where to resolve names based on domain and existence of ipsec
or openvpn tunnel.

With current config there is some scritps (and dnsmasq), pretty simple
to write. (When you have some knowledge about networking)

With systemd-networkd I even do not know where to start. And when I try
to test somenthig, almost immediately I see that I systemd cannot do
something I need.


>> > In networkd you can configure the route metric via Metric= in the
>> > [Route] section. If the routes are acquired through dhcp, you can set
>> > the metric to use in the [DHCPv4] section in the RouteMetric= setting,
>> > and so on.
>>
>> But sometimes I want to "override" default route, i.e. I have two
>> interfaces configured by DHCP and I want to "force" use particular
>> interface. Is this possible via cli? Or I have to deal with creating
>> and removing files and "daemon-reload"ing?
>
> You can use RouteMetric= in the [DHCPv4] section if one of the two
> interfaces shall always be the preferred one over the other.
>
> or are you saying that you intend to change which one is preferred
> dynamically? but the network callouts à la networkd-dispatcher run at
> configuration time, not on request iiuc...

I simply want to pass  option during disposinng interface up, and expect
this option will be honored. (IE. interface will be default or not.[1])
>


KJ
[1] - but please treat this as an example only. This also can be
additional domain to search. Or additional DNS to use, or ...
something.


-- 
http://stopstopnop.pl/stop_stopnop.pl_o_nas.html


More information about the systemd-devel mailing list