macã«dnsmasqãã¤ã³ã¹ãã¼ã«
macã«dnsmasqãã¤ã³ã¹ãã¼ã«
boxenã«dnsmasqãå ¥ã£ã¦ããã®ã§æ°ã«ãªã£ã¦å ¥ãã¦ã¿ã¾ãã。
dnsmasqã¯ãã¼ã«ã«ã«èµ·åã§ããdnsãµã¼ãã§ã。
ç°å¢ã¯Mountain Lionã§ã。
Homebrewã§ã¤ã³ã¹ãã¼ã«
ä¸è¨ã®éãConfãã¡ã¤ã«ãã³ãã¼
ä¸è¨ã®éããã¹ãéã。
ã³ãã³ããèªèããã¦ããã確èª
launchctlãå©ç¨ãã¦èªåçã«èµ·åãããããã«è¨å®ãã¡ã¤ã«ãç¨æãã¦ããã¦ãã¾ã。
å¤å、ééããªã常æå©ç¨ããã®ã§、使ããã¦ããã ãã¾ããã。
è¨å®ãã¡ã¤ã«ãã³ãã¼
è¨å®ãã¡ã¤ã«ãèªã¿ãã¾ãã(Daemonã¨ãã¦èªåçã«èµ·åãã)
ããã»ã¹ç¢ºèª
常æèµ·åãªã¹ãã«å ¥ã£ã¦ãããã®ç¢ºèª
ã¡ãªã¿ã«è¨å®ãã¡ã¤ã«ã¯ãããªæã
é常ã®èµ·åã®å ´å
åèµ·åããã¨ã(åæ¢ããã¨Daemonãªã®ã§èªåçã«åèµ·åããã)
åæ¢ããã¨ã(ä»å¾èªåèµ·åãããªããªã)
åèãªã³ã¯
LaunchDaemons (launchctl, launchd.plist) ã®ä½¿ãæ¹ - maruko2 Note.
http://www.maruko2.com/mw/LaunchDaemons_(launchctl,_launchd.plist)_%E3%81%AE%E4%BD%BF%E3%81%84%E6%96%B9
boxenã«dnsmasqãå ¥ã£ã¦ããã®ã§æ°ã«ãªã£ã¦å ¥ãã¦ã¿ã¾ãã。
dnsmasqã¯ãã¼ã«ã«ã«èµ·åã§ããdnsãµã¼ãã§ã。
ç°å¢ã¯Mountain Lionã§ã。
Homebrewã§ã¤ã³ã¹ãã¼ã«
$ brew install dnsmasq ==> Downloading http://www.thekelleys.org.uk/dnsmasq/dnsmasq-2.65.tar.gz ######################################################################## 100.0% ==> make install PREFIX=/usr/local/Cellar/dnsmasq/2.65 ==> Caveats To configure dnsmasq, copy the example configuration to /usr/local/etc/dnsmasq.conf and edit to taste. cp /usr/local/opt/dnsmasq/dnsmasq.conf.example /usr/local/etc/dnsmasq.conf To have launchd start dnsmasq at startup: sudo cp -fv /usr/local/opt/dnsmasq/*.plist /Library/LaunchDaemons Then to load dnsmasq now: sudo launchctl load /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist Warning: /usr/local/sbin is not in your PATH You can amend this by altering your ~/.bashrc file ==> Summary ðº /usr/local/Cellar/dnsmasq/2.65: 7 files, 416K, built in 16 seconds
ä¸è¨ã®éãConfãã¡ã¤ã«ãã³ãã¼
$ ls -l /usr/local/opt/dnsmasq/dnsmasq.conf.example -rw-r--r-- 1 hoge wheel 25062 12 14 20:48 /usr/local/opt/dnsmasq/dnsmasq.conf.example $ cp /usr/local/opt/dnsmasq/dnsmasq.conf.example /usr/local/etc/dnsmasq.conf
ä¸è¨ã®éããã¹ãéã。
$ vi ~/.bashrc PATHã« /usr/local/sbin ã追å $ source ~/.bashrc
ã³ãã³ããèªèããã¦ããã確èª
$ which dnsmasq /usr/local/sbin/dnsmasqåé¡ãªãã§ãã。
launchctlãå©ç¨ãã¦èªåçã«èµ·åãããããã«è¨å®ãã¡ã¤ã«ãç¨æãã¦ããã¦ãã¾ã。
å¤å、ééããªã常æå©ç¨ããã®ã§、使ããã¦ããã ãã¾ããã。
è¨å®ãã¡ã¤ã«ãã³ãã¼
$ sudo cp -fv /usr/local/opt/dnsmasq/*.plist /Library/LaunchDaemons
è¨å®ãã¡ã¤ã«ãèªã¿ãã¾ãã(Daemonã¨ãã¦èªåçã«èµ·åãã)
$ sudo launchctl load /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist
ããã»ã¹ç¢ºèª
$ ps aux | grep dnsmasq | grep -v grep nobody 2854 0.0 0.0 2432960 676 ?? Ss 4:48PM 0:00.00 /usr/local/opt/dnsmasq/sbin/dnsmasq --keep-in-foreground
常æèµ·åãªã¹ãã«å ¥ã£ã¦ãããã®ç¢ºèª
$ sudo launchctl list | egrep "dnsmasq|PID" PID Status Label 2854 - homebrew.mxcl.dnsmasq
ã¡ãªã¿ã«è¨å®ãã¡ã¤ã«ã¯ãããªæã
$ cat /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist <plist version="1.0"> <dict> <key>Label</key> <string>homebrew.mxcl.dnsmasq</string> <key>ProgramArguments</key> <array> <string>/usr/local/opt/dnsmasq/sbin/dnsmasq</string> <string>--keep-in-foreground</string> </array> <key>KeepAlive</key> <dict> <key>NetworkState</key> <true> </true></dict> </dict></plist>
é常ã®èµ·åã®å ´å
åèµ·åããã¨ã(åæ¢ããã¨Daemonãªã®ã§èªåçã«åèµ·åããã)
$ sudo launchctl stop homebrew.mxcl.dnsmasq
åæ¢ããã¨ã(ä»å¾èªåèµ·åãããªããªã)
$ sudo launchctl unload /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist
åèãªã³ã¯
LaunchDaemons (launchctl, launchd.plist) ã®ä½¿ãæ¹ - maruko2 Note.
http://www.maruko2.com/mw/LaunchDaemons_(launchctl,_launchd.plist)_%E3%81%AE%E4%BD%BF%E3%81%84%E6%96%B9
ã³ã¡ã³ã
ããã¡PCãããªã³ã¿ã¼ã® DHCP & DNS ãµã¼ãã¨ãã¦ä½¿ãã¨ä¾¿å©ã§ãããã¼。