I long ago created my own shell scripts that permanently connect to my own NAS on my private local area network (LAN) via SSH.
Create a simple example of a new script:
while sleep 5; do
ssh NAS-local ### It is domain name, I do not use IP address as a hard code. Let DNS resolve IP address first.
### My own router knows where is this NAS-local. I do not need ISP.
I do not use any option like ssh -6 <domain-name> for IPv6. I do NOT want the connection with my NAS on a public network (WAN and MAN, for example: ISP is on the WAN).
LAN is okay for me because my own private router knows where my NAS host is located. I do not need this public ISP to resolve my NAS domain to an IPv6 address.
My devices, router and ISP support native IPv6.
This script will be executed automatically when reboot.
The nice Portmaster firewall sometimes notifies me after rebooting my computer, but ssh want to connect to my public ISP on the WAN once by rebooting because of IPv6. (I see a clear detail, the public IPv6 address belongs to my ISP)
I know SSH is not a problem with IPv4. For example, I force ssh to use the option: ssh -4 <domain-name> → No issue. It always connects to my private LAN.
The default order of multiple DNS servers is not good in systemd-resolved. For example, I have 3 different DNS servers in LAN and WAN:
DNS server in my private router for IPv4 on the LAN.
DNS server in my private router for IPv6 on the LAN.
DNS server in the paid ISP router for IPv6 on the WAN, not IPv4.
(AFAIK, IPv6 does not need NAT, this is why the ISP can know where many many devices are on the LAN and WAN)
(Everyone needs an ISP. If without ISP, then you can no longer use Internet except LAN).
systemd-resolved automatically selects 3rd DNS as the default DNS server. I have never manually configured DNS from systemd-resolved.
When I switched systemd-resolved to networkmanager, networkmanager generated these 3 same DNS servers in /etc/resolv.conf, but in a different order not the same as systemd-resolved:
The second DNS server (in my router) is first default and the third DNS server (in my paid ISP) is last in the order of networkmanager.