Skip to content

Instantly share code, notes, and snippets.

@tchn
Created December 8, 2011 11:27
Show Gist options
  • Save tchn/1446764 to your computer and use it in GitHub Desktop.
Save tchn/1446764 to your computer and use it in GitHub Desktop.
ipfw
MBP OSX 10.5 (en0: WAN, en1:WiFi <- iPhone4のデフォゲさま)
Thinkpad x200s (wlan1: APさま、dnsmasqさま
iPhone4 (WiFi)
コマンド @MBP
# sysctl -w net.inet.ip.forwarding=1
# natd -interface en0
# ipfw -f flush
# ipfw add divert natd all from any to any via en0
# ipfw add 99 forward 127.0.0.1,8080 tcp from any to any 80 in
設定の確認
# ipfw list
00099 fwd 127.0.0.1,8080 tcp from any to any dst-port 80 in
00100 divert 8668 ip from any to any via en0
65535 allow ip from any to any
$ sysctl net.inet.ip.forwarding
net.inet.ip.forwarding: 1
MBPのインターネット共有はoff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment