0

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?

6
  • IPv6 addresses generally have to be contained within [], so try What=//[fe80::1234:567:89ab]/Users/User/Desktop/exchange etc. Those semicolons tend to be recognised as a separator for the port & that confuses things. Commented Feb 21, 2024 at 21:54
  • Syntax aside, where does the 17 come from? Is it the interface index on the Linux machine or the WIndows machine? Commented Mar 16, 2024 at 10:34
  • @u1686_grawity I don't remember for sure. I think 17 was the scope id displayed with ipconfig on the Windows machine. Commented Mar 18, 2024 at 11:09
  • @Bib that didn't work. Commented Mar 18, 2024 at 11:09
  • @Joooeey: Yeah, that will not be useful here because it was displayed on the Windows machine and has no meaning on any other machine. So you can safely rule out all variants that include 17 – the scope/zone index needs to be meaningful within the Linux system that's doing the connection. Commented Mar 18, 2024 at 11:36

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.