分类: BSD
2007-12-18 11:00:58
#!/bin/bash WLAN_INTERFACE=wlan0 #configure wlan encrypt key iwconfig $WLAN_INTERFACE enc s:0987654321abc [1] iwconfig $WLAN_INTERFACE enc open [1] iwconfig $WLAN_INTERFACE mode ad-hoc #configure wlan essid, then ur iphone may found it. ` iwconfig $WLAN_INTERFACE essid "iplin" ifconfig $WLAN_INTERFACE up #configure ip address for wlan interface, this ip address will be used as iphone's gateway. ifconfig $WLAN_INTERFACE 192.168.3.1 #configure ur linux box as a router. echo "1" > /proc/sys/net/ipv4/ip_forward iptables -t nat -A POSTROUTING -o eth0 -s 192.168.3.1/24 -j MASQUERADE |