I'm trying to mount a Windows share on a headless Linux computer with the following systemd unit file:
[Unit]
Description=mount network drive from harvester OBC
Requires=network-online.target
After=network-online.service
StartLimitIntervalSec=0
[Mount]
What=//192.168.X.Y/Users/User/Desktop/exchange
Where=/home/me/exchange
Options=username=me,password=secret,workgroup=WORKGROUP,rw,uid=1000,gid=1000
Type=cifs
[Install]
WantedBy=multi-user.target
However, the IPv4 and host URL of the Windows computer change when I connect the two machines with a different network. However, the Windows computer's IPv6 stays the same: fe80::1234:567:89ab%17 on wlp1s0 (address partially obfuscated). So I'm wondering if it is possible to mount the exchange folder via an IPv6 address. I can successfully ping the IPv6.
So far I've tried:
What=//fe80::1234:567:89ab/Users/User/Desktop/exchange
What=//fe80::1234:567:89ab%17/Users/User/Desktop/exchange
What=//fe80::1234:567:89ab%wlp1s0/Users/User/Desktop/exchange
What=//fe80::1234:567:89ab%wlp1s0/17/Users/User/Desktop/exchange
For all of these I get an error telling me that the share was not found.
How can I make this work and connect to the Windows computer regardless of which WiFi is used to connect the two?
[], so tryWhat=//[fe80::1234:567:89ab]/Users/User/Desktop/exchangeetc. Those semicolons tend to be recognised as a separator for the port & that confuses things.17come from? Is it the interface index on the Linux machine or the WIndows machine?17– the scope/zone index needs to be meaningful within the Linux system that's doing the connection.