adhoc.sh
来自「建立adhoc网络的脚本」· Shell 代码 · 共 17 行
SH
17 行
#!/bin/bashWLAN_INTERFACE=wlan0#configure wlan encrypt key#iwconfig $WLAN_INTERFACE enc s:0987654321abc [1]ifconfig $WLAN_INTERFACE downiwconfig $WLAN_INTERFACE mode Ad-Hoc#configure wlan essid, then ur iphone may found it. `iwconfig $WLAN_INTERFACE essid 'lidawen'#iwconfig $WLAN_INTERFACE key open#iwconfig $WLAN_INTERFACE key 0123-4567-89 restricted s:12345ifconfig $WLAN_INTERFACE up#configure ip address for wlan interface, this ip address will be used as iphone's gateway.ifconfig $WLAN_INTERFACE 192.168.16.2 netmask 255.255.255.0#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
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?