Não consigo rotas estáticas para persistir na reinicialização do Mac OS 10.6.5. Experimentei todos os métodos prescritos nos resultados de pesquisa do Google e postagens anteriores neste site. Eu tentei criar manualmente um daemon launchd e usei o daemon launchd do RouteSplit sem sucesso. Está claro que a interface não está pronta quando esses métodos tentam aplicar a rota. Esta estação de trabalho em questão está obtendo seu IP do DHCP e provavelmente não obteve sua concessão de DHCP quando o comando é executado. Podemos aplicar a rota manualmente quando efetuamos login, mas não por meio de métodos de inicialização. Existe outra maneira de aplicar essa rota colocando o comando em algo mais tarde, mas antes que a janela de login apareça para o usuário?
Aqui estão algumas informações de registro relevantes do system.log. Você pode ver os erros "rota: gravação no soquete de roteamento: Rede está inacessível", onde meu script launchd é disparado. Eu tentei adicionar extra "sleep" e "ipconfig waitall" instruções mais tarde no script, mas isso não voa.
Dec 15 19:30:41 localhost com.apple.launchd[1]: *** launchd[1] has started up. ***
Dec 15 19:30:45 localhost mDNSResponder[18]: mDNSResponder mDNSResponder-258.13 (Oct 8 2010 17:10:30) starting
Dec 15 19:30:47 localhost configd[15]: bootp_session_transmit: bpf_write(en1) failed: Network is down (50)
Dec 15 19:30:47 localhost configd[15]: DHCP en1: INIT transmit failed
Dec 15 19:30:47 localhost configd[15]: network configuration changed.
Dec 15 19:30:47 Administrators-MacBook-Pro configd[15]: setting hostname to "Administrators-MacBook-Pro.local"
Dec 15 19:30:47 Administrators-MacBook-Pro blued[16]: Apple Bluetooth daemon started
Dec 15 19:30:52 Administrators-MacBook-Pro syslog[67]: routes.sh: Starting RouteSplit
Dec 15 19:30:53 Administrators-MacBook-Pro com.apple.usbmuxd[41]: usbmuxd-207 built for iTunesTenOne on Oct 19 2010 at 13:50:35, running 64 bit
Dec 15 19:30:54 Administrators-MacBook-Pro /System/Library/CoreServices/loginwindow.app/Contents/MacOS/loginwindow[50]: Login Window Application Started
Dec 15 19:30:55 Administrators-MacBook-Pro bootlog[61]: BOOT_TIME: 1292459441 0
Dec 15 19:30:55 Administrators-MacBook-Pro syslog[86]: routes.sh: static route 192.168.0.0/23 192.168.2.2
Dec 15 19:30:55 Administrators-MacBook-Pro net.routes.static[65]: route: writing to routing socket: Network is unreachable
Dec 15 19:30:55 Administrators-MacBook-Pro net.routes.static[65]: add net 192.168.0.0: gateway 192.168.2.2: Network is unreachable
Dec 15 19:30:57 Administrators-MacBook-Pro org.apache.httpd[38]: httpd: Could not reliably determine the server's fully qualified domain name, using Administrators-MacBook-Pro.local for ServerName
Dec 15 19:30:58 Administrators-MacBook-Pro loginwindow[50]: Login Window Started Security Agent
Dec 15 19:30:58 Administrators-MacBook-Pro WindowServer[89]: kCGErrorFailure: Set a breakpoint @ CGErrorBreakpoint() to catch errors as they are logged.
Dec 15 19:30:58 Administrators-MacBook-Pro com.apple.WindowServer[89]: Wed Dec 15 19:30:58 Administrators-MacBook-Pro.local WindowServer[89] <Error>: kCGErrorFailure: Set a breakpoint @ CGErrorBreakpoint() to catch errors as they are logged.
Dec 15 19:31:18 Administrators-MacBook-Pro configd[15]: network configuration changed.
Dec 15 19:31:19 administrators-macbook-pro configd[15]: setting hostname to "administrators-macbook-pro.local"
Dec 15 19:31:25 administrators-macbook-pro _mdnsresponder[121]: /usr/libexec/ntpd-wrapper: scutil key State:/Network/Global/DNS not present after 30 seconds
Dec 15 19:31:25 administrators-macbook-pro _mdnsresponder[124]: sntp options: a=2 v=1 e=0.100 E=5.000 P=2147483647.000
Dec 15 19:31:25 administrators-macbook-pro _mdnsresponder[124]: d=15 c=5 x=0 op=1 l=/var/run/sntp.pid f= time.apple.com
Dec 15 19:31:25 administrators-macbook-pro _mdnsresponder[124]: sntp: getaddrinfo(hostname, ntp) failed with nodename nor servname provided, or not known
Dec 15 19:31:27 administrators-macbook-pro configd[15]: network configuration changed.
Dec 15 19:31:27 Administrators-MacBook-Pro configd[15]: setting hostname to "Administrators-MacBook-Pro.local"
Dec 15 19:31:27 Administrators-MacBook-Pro ntpd[37]: Cannot find existing interface for address 17.151.16.20
Dec 15 19:31:27 Administrators-MacBook-Pro ntpd_initres[125]: ntpd indicates no data available!
Dec 15 19:31:31 Administrators-MacBook-Pro sshd[128]: USER_PROCESS: 133 ttys000
Dec 15 19:31:37 Administrators-MacBook-Pro sudo[138]: administrator : TTY=ttys000 ; PWD=/Users/administrator ; USER=root ; COMMAND=/usr/bin/less /var/log/system.log
'' Você pode ver a seguinte linha em /var/log/kernel.log que mostra a interface en0 chegando:
Dec 15 19:30:51 Administrators-MacBook-Pro kernel[0]: Ethernet [AppleBCM5701Ethernet]: Link up on en0, 1-Gigabit, Full-duplex, No flow-control, Debug [796d,0f01,0de1,0300,c1e1,3800]