[systemd-devel] network interface scripting

Kamil Jońca kjonca at o2.pl
Sat Feb 5 07:23:23 UTC 2022


Hello.

Current situation:
debian laptop with interfaces defined in /etc/network/interfaces
+ resolvconf + dnsmasq packages and bunch of scripts wchich configures network
(routes and name resolving) according to interfaces and vpn up down.
For example
1.  I am connected to  home1 network (connected by wifi, no default
    routing ), this network sets routing to some subnets with dhcp option
    121 (and dhclient scripts handles this)
2. I am connected via etch to router with default gateway
3. I am connected to work1 network via openvpn tunnel.
4. I am connected to work2 network via ipsec gateway.

I want to (and with my current config this is done)
that:
1. proper routes are established (especially these with option 121)
2. name resolving is properly configured:
  ie. home1.tld DNS queries are forwarded to home1 network
      work1.tld DNS queries are forwarded to work1 network (via openvpn tunnel)
      work2.tld DNS queries are forwarded to work2 network (via ipsec
      tunnel)
      rest DNS is forwarded to default gateway
      
I am quite happy with my current config but sometimes I can read that
/etc/network/interfaces is "deprecated" in favor of systemd-networkd or
netplan.

How these things can be achieved with systemd-networkd? I read the
manuals, but I was not able to find working examples and I am not sure
where can I start.
for example
1. can I use isc-dhcp-client instead of builtin one? how? If not: can
builtin client handle dhcp 121 option and how can I plug in script which
will be run during dhcp events?

2. how can I integrate wpa supplicant with networkd daemon? 

etc
KJ

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


More information about the systemd-devel mailing list