1. host

route add x.x.x.x gateway

route delete x.x.x.x gateway

sudo route add

sudo route delete

2. subnet

route add x.x.x.x/24 gateway

route delete x.x.x.x/24 gateway

route add

route delete

3. Automatically set static routs

참고: http://www.andre-aulich.de/en/perm/setting-static-routes-in-mac-os-x-104105-client-and-server

We can simply use a launchd entry in /Library/LaunchDaemons, which can look like this. 

<?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">


















Just copy the file into /Library/LaunchDaemons/ and activate it by typing

sudo launchctl load -w /Library/LaunchDaemons/setstaticroute.plist

Posted by fermi

댓글을 달아 주세요