(sent previously from different address) Lennart Poettering <lennart@xxxxxxxxxxxxxx> writes: > On Mo, 09.05.22 18:12, Kamil Jońca (kjonca@xxxxx) wrote: > >> For now I do not know how handle multiple interface where: >> 1. set routing according to classles routes from dhcp on some >> interfaces. > > We don't do that anyway? I do not know. When I tried (but it was about year ago) I think it did not work, but later someone on list claims that systemd handle proper DHCP option. > >> 2. set NAT (ie call nftables sctipts) with multitple egress interfaces and bunch >> of VM-s inside host. > > we have native NAT support in .network files? what is missing there? Will try. When I find some time. > >> 3. decide where to resolve names based on domain and existence of ipsec >> or openvpn tunnel. > > Sounds like a job for the resolved domain routing logic, which already > exists? Not quite. When I asked previously I got response, that resolved is based on interfaces. But ipsec tunnel does not need dedicated interface. > > it appears you can use what's already there for these cases. And if > not, it seems like we could extend things. > maybe in the end things wouldn't work exactly the same as before, but > should deliver the same results? Yes. > >> 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. > > Start with the documentation? But take a step back, i.e. what is the > stuff you actually intend to do conceptually, instead of already > assuming the tech you want to do it with. > Let's see. from SYSTEMD.NETWORK(5) ... IPMasquerade= Configures IP masquerading for the network interface. If enabled, packets forwarded from the network interface will be appear as coming from the local host. .... I still do not know what mean "local host" here. I guess that this will be interface address. :) I still do not know if this is rather "snat" or rather "masquerade". How can I decide which to use. And what engine is used here. I know that networkd cannot handle bridge without ports (quite convenient when you use it as dummy interface with qemu machines) [...] >> 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]) > > 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? > Note anyway that networkd assumes it manages an interface in its > entirety: if you muck with what it sets up it likely will override > your changes sooner or later, when some event happens... you have a I do not want interfere with interfaces "per se" I simply want to get some info from systemd and pass it to dnsmasq (for DNS) or nftables (for filtering) . That's it. KJ -- http://stopstopnop.pl/stop_stopnop.pl_o_nas.html