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.
Re: interface/network scripting - how to?
Anssi Saari writes: > Kamil Jońca writes: > >> 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) > > So how have you setup this part? I always thought this needs a local > name server, such as systemd-networkd provides and which I switched to > once I heard it had been implemented. Before I had just wobbly > resolvconf which usually got the DNS setup wrong. I managed fix it so it > was mostly OK but it was never good. Point for you. :) I forgot to mention about dnsmasq, whose configuration is updated by scripts. KJ -- http://stopstopnop.pl/stop_stopnop.pl_o_nas.html
Re: interface/network scripting - how to?
Kamil Jońca writes: > 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) So how have you setup this part? I always thought this needs a local name server, such as systemd-networkd provides and which I switched to once I heard it had been implemented. Before I had just wobbly resolvconf which usually got the DNS setup wrong. I managed fix it so it was mostly OK but it was never good. > 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. I never heard that. > So I have two questions: > 1. Should I prepare migration? If you're happy with the setup, I don't see why. Well, if you like to learn new things, sure, go for it. I just find it a bit of pain to make major changes to my network. I did recently replace my router but since it was just a router for wired connections it was fairly easy to replace it once I had configured the new one. > 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 do have a similar if simpler setup, I just have a single VPN (openvpn) connection to the internet and have a local network of a few machines. DNS queries go either to my router or the VPN provider's DNS, depending on the interface. I can't remember how I got started with systemd-networkd, it's been a few years. Internet searches probably. systemd documentation is a decent reference but as such they don't usually tell you how to build something specific. I don't remember any particular difficulty in finding pages on how to get started.
Re: interface/network scripting - how to?
john doe writes: [..] > >> 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. >> > > The Systemd mailing lists! Thanks. Will try. KJ -- http://stopstopnop.pl/stop_stopnop.pl_o_nas.html
Re: interface/network scripting - how to?
On 2/4/2022 7:14 PM, 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. 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? I would not put that on the front burner but experimenting with Systemd might not be a bad idea. 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. The Systemd mailing lists! -- John Doe
Re: interface/network scripting - how to?
On Fri, Feb 04, 2022 at 01:33:54PM -0500, Greg Wooledge wrote: > On Fri, Feb 04, 2022 at 07:14:45PM +0100, Kamil Jońca wrote: > > 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. > > Where did you read this? Sounds like Red Hat or XDG or systemd propaganda. I wouldn't hope that either! That said, those things will stay alive as long as there are folks who care. Cheers -- t signature.asc Description: PGP signature
Re: interface/network scripting - how to?
On Fri, Feb 04, 2022 at 07:14:45PM +0100, Kamil Jońca wrote: > 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. Where did you read this? Sounds like Red Hat or XDG or systemd propaganda. > So I have two questions: > 1. Should I prepare migration? Given that you're happy with your current setup, I see no reason to do so.
interface/network scripting - how to?
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. 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? 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. KJ -- http://wolnelektury.pl/wesprzyj/teraz/