将路由永久添加到 Solaris 10

Cia*_*ian 1 routing solaris-10

我需要向solaris 10 框添加几个静态路由。在 Solaris 9 上,我总是通过添加一个 init 脚本来重新应用路由来使这些在重新启动后保持不变。使用solaris 10,向SMF 添加服务似乎有些矫枉过正。关于如何添加在重启后仍然存在的路由的最佳实践是什么?

Kam*_*iel 5

route命令具有-p选项,在 OpenSolaris 中,我相信在 Solaris 10 中也是如此。来自man route

 -p             Make changes to the network route tables per-
                sistent across system restarts. The operation
                is applied  to  the  network  routing  tables
                first  and, if successful, is then applied to
                the list  of  saved  routes  used  at  system
                startup.  In determining whether an operation
                was successful, a failure to add a route that
                already  exists  or to delete a route that is
                not in the routing table is ignored. Particu-
                lar  care  should be taken when using host or
                network  names  in  persistent   routes,   as
                network-based  name  resolution  services are
                not available at the time routes are added at
                startup.
Run Code Online (Sandbox Code Playgroud)

我相信/etc/inet/static_routes如果它们成功应用,它会将它们写入文件。