я в этом всем не очень понимаю... ДБА я... у наших ребят взял инструкцию по настройке VPN на MAC-е...
там для добавления маршрута выполняется питонячий скрипт:
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import subprocess
if 'IPREMOTE' not in os.environ or os.environ['IPREMOTE'] != "62.152.66.6":
with open("/tmp/ppp.log", 'w') as f:
f.write("IPREMOTE is bad\n\n")
exit(0)
try:
subprocess.call("/sbin/route -n add -net 62.152.66.152/29 192.168.222.254", shell=True)
except Exception as e:
with open("/tmp/ppp.log", 'w') as f:
f.write("Subprocess error!!!\n\n")
f.write(str(e))
try:
found = False
with open("/etc/hosts", 'r') as f:
for line in f.readlines():
if line.find("stash") >= 0 and line.find("62.152.66.158") >= 0:
found = True
break
if not found:
with open("/etc/hosts", 'a') as f:
f.writelines("62.152.66.158 stash\n")
except Exception as e:
with open("/tmp/ppp.log", 'w') as f:
f.write("We got an error {0}".format(str(e)))
with open("/tmp/ppp.log", 'w') as f:
f.write("Route added, hosts patched. Ipremote is {0}".format(os.environ['IPREMOTE']))
Но я в нем не силён.
В описании для мака про ДНС однако ни слова не было