[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: interface/network scripting - how to?



On Fri 04 Feb 2022 at 19:14:45 (+0100), Kamil Jońca wrote:
> 
> Current situation:
> debian laptop with interfaces defined in /etc/network/interfaces
> + resolvconf package and bunch of scripts wchich configures network
> (routes and name resolving) according to interfaces/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.

As you can see from Anssi Saari's reply, it sometimes helps
to give a bit more information than the above in order to
trigger more responses.

> 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 passed to home1 network
>       work1.tld DNS queries are passed to work1 network (via openvpn tunnel)
>       work2.tld DNS queries are passed to work2 network (via ipsec tunnel)
> 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.
> So I have two questions:
> 1. Should I prepare migration?

It's often worth having a second string just in case something ceases
to work. (But I've not seen deprecation mentioned either.) So, for
example, I've been chacking out iwd, since wicd has now gone.

> 2. 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.

I guess you've read things like   man systemd-networkd,
man   systemd.network   and   man systemd.netdev,   but the
numerous examples at the end of the latter two might yield
some good search terms to turn up further information.

There may be some extra info in the Arch wikis, but the Debian
ones seem to just regurgitate the man pages.

Cheers,
David.


Reply to: