Well I couldn't wait for someone to figure out a fix so I made some scripts to fix the issue for me. It's worked on an m series and intel macbook pro. Here is what I did.
I also don't know if it's a parallels specific error now. Parallels definitely triggers the issue, but I had this issue show up on a mac I never installed parallels on today after the issue showing up on about 20 intel macs and not showing on 4 M series macs. Either way, this should solve the issue.
This only works for the base Admin account on your mac.
Make a txt file named vpn-route-manager.sh and place it in the admin home folder
Paste this inside the txt file:
Code:
#!/bin/bash
# Wait for VPN interface (utun4, tun0, etc.) to appear
while ! ifconfig | grep -q "utun"; do
sleep 1
done
# Get VPN interface name (e.g., utun4)
VPN_IF=$(ifconfig | grep '^utun' | cut -d: -f1)
# Delete conflicting route (if needed)
sudo route -n delete 192.168.1.0/24 2>/dev/null
# Add route via VPN gateway (replace 192.168.4.1 if necessary)
sudo route -n add 192.168.1.0/24 -interface $VPN_IF
echo "[$(date)] VPN route applied: 192.168.1.0/24 → $VPN_IF" >> ~/vpn-route.log
This will be used to swap the network interface for the .1 subnet after the VPN is started
Make another txt file named local.vpnroute.plist and place it in Library/LaunchAgents
Paste this inside the txt file:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>local.vpnroute</string>
<key>ProgramArguments</key>
<array>
<string>/bin/bash</string>
<string>-c</string>
<string>~/vpn-route-manager.sh</string>
</array>
<key>StartOnMount</key>
<true/>
<key>WatchPaths</key>
<array>
<string>/var/run/resolv.conf</string> <!-- Newer macOS versions -->
<string>/etc/resolv.conf</string> <!-- Legacy -->
</array>
<key>RunAtLoad</key>
<true/> <!-- Run at startup -->
</dict>
</plist>
This is what watches for changes in the network settings. When the vpn starts up, it runs the .sh file we made earlier, swapping the interface on the .1 subnet
Now you need to make the .sh file executable.
Open terminal and run
Chmod +x ~/vpn-route-manager.sh
I don't remember if I needed this but, only run this if you are not concerned about password requirements for changing routing settings.
Run in terminal
echo "$USER ALL=(ALL) NOPASSWD: /sbin/route" | sudo tee /etc/sudoers.d/vpn-route
Now we need to run the plist file in the terminal
launchctl load ~/Library/LaunchAgents/local.vpnroute.plist
These changes will persist through reboots etc.
Turn on the VPN and ping something on the .1 subnet. It should work now. This has worked for me on 2 macs and I will do more soon. Hope this helps someone else!
Click to expand...