Unable to make route permanent

Hi to all, I'm unable on my macOs Sierra to make permanent my route...

On terminal I add route with command:


sudo route add -n 192.168.0/16 192.168.46.1


I try with several method to make di route permanent:


Any suggest?

Thanks

Stefano

Posted on Jan 20, 2017 2:30 AM

Reply
7 replies

Jan 20, 2017 6:38 AM in response to Barney-15E

Yes, the script is owned by root.


-rw-r--r-- 1 root wheel 501B 20 Gen 11:13 local.staticroute.vm.plist


This the content:


<?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.staticroute.vm</string>

<key>ProgramArguments</key>

<array>

<string>route</string>

<string>add</string>

<string>-n</string>

<string>192.168.0/16</string>

<string>192.168.46.1</string>

</array>

<key>RunAtLoad</key>

<true/>

</dict>

</plist>

Many thanks!

Jan 20, 2017 6:34 AM in response to stefx78

If it loads fine, but doesn't run for some reason, that may show up in Console, but I'm not certain.

There may be something wrong with the plist. I found there is little help determining what that might be.

Also, make sure the plist is owned by root.

I don't know if I will see anything wrong with it, but post the contents of the plist and I'll take a look.

Jan 20, 2017 6:49 AM in response to stefx78

I'm not sure, but perhaps it is something to do with the /16. That may be getting interpreted incorrectly as it is translated from the plist. If it works straight from the command line, I would think it would work in the plist.


You could try this approach: https://www.jverdeyen.be/mac/persistent-static-routes-mac-os-x/

However, in the shell script, I don't think you should use "sudo" as it is run by root by default.

Jan 20, 2017 8:11 AM in response to Barney-15E

Nothing... 😟

In console I see only this error, but I don't know the cause...


rejecting read of { kCFPreferencesAnyApplication, kCFPreferencesAnyUser, kCFPreferencesCurrentHost, no container, managed: 0 } from process 548 because accessing preferences outside an application's container requires user-preference-read or file-read-data sandbox access


Thanks

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Unable to make route permanent

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.