1. host
route add x.x.x.x gateway
route delete x.x.x.x gateway
sudo route add 10.8.0.2 192.168.0.1
sudo route delete 10.8.0.2 192.168.0.1
2. subnet
route add x.x.x.x/24 gateway
route delete x.x.x.x/24 gateway
route add 10.8.0.0/24 192.168.0.1
route delete 10.8.0.0/24 192.168.0.1
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">
<dict>
<key>Label</key>
<string>setstaticroute</string>
<key>ProgramArguments</key>
<array>
<string>route</string>
<string>add</string>
<string>-host</string>
<string>192.168.2.100</string>
<string>192.168.1.254</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>StartInterval</key>
<integer>1200</integer>
</dict>
</plist>
Just copy the file into /Library/LaunchDaemons/ and activate it by typing
sudo launchctl load -w /Library/LaunchDaemons/setstaticroute.plist
'정보기술 > Mac' 카테고리의 다른 글
Mac OS X HiDPI 강제 활성화 (0) | 2014.03.24 |
---|---|
Dell U3014 모니터 Mac OSX 에서 sharpening or contrast enhancement 문제 해결 (0) | 2013.07.22 |
OS X 메일 프로그램에 메일 보낸 사람 프로필 사진 띄우기 (0) | 2012.12.06 |
OS X의 "Open With..." List 중 중복되거나 오래된 item의 정리 (0) | 2012.12.03 |
네트워크 폴더에서 .DS_Store 및 .AppleDouble 의 생성을 중지하는 방법 (0) | 2012.05.25 |