¡¡¡¡ÓÃbluetooth ÔÚ Linuxƽ̨ϼܽ¨¸öÈ˵ÄÎÞÏß¾ÖÓòÍø£¬·½±ã£¬ÊµÓöøÁé»î¡£
¡¡¡¡Ê×ÏÈÐèÒª°²×°bluez-libs¡¢bluez-utils£¬»¹ÓÐÄÚºËÖеÄbnepÄ£¿é¡£
¡¡¡¡1: Æô¶¯À¶ÑÀhciconfig hci0 up piscan
¡¡¡¡2: modprobe bnep
¡¡¡¡*ÒÔÉϲ½Ö裬ÔÚÖ÷»úºÍºÍ¿Í»§»úÉ϶¼Òª²Ù×÷
¡¡¡¡3: ÔÚÖ÷»úÉÏ£¬ÔËÐÐpand --listen --role NAP --master
¡¡¡¡ÔÚ¿Í»§»úÉÏ£¬ÔËÐÐpand --connect 00:11:67:46:4E:4E --role NAPU
00:1167:46:4E:4E ΪÀ¶ÑÀÉ豸µÄµØÖ·
¡¡¡¡4: µ±ÓÃpand -l ÄÜ¿´µ½
¡¡¡¡bnep0 00:11:67:46:4E:4E PANU
¡¡¡¡ËµÃ÷Á¬½Ó³É¹¦
¡¡¡¡5: ÔÚÖ÷»úÉÏÉèÖÃifconfig bnep0 10.10.106.1
¡¡¡¡ÔÚ¿Í»§»úÉÏÉèÖÃifconfig bnep0 10.10.106.2
¡¡¡¡ÖÁ´Ë£¬Äã¾Í¿ÉÒÔ´Ó10.10.106.2 ping µ½10.10.106.1
¡¡¡¡ÈôÐèÒª¹²ÏíÉÏÍø£¬ÔòÐèÒªÔÚÖ÷»úÉÏÓÃiptableÀ´ÉèÖÃһϡ£
¡¡¡¡¿Í»§»úÒªÌí¼Óroute
¡¡¡¡route add -net default gw 10.10.106.1
¡¡¡¡ÒÔÏÂÊÇÎÒµÄiptableµÄ½Å±¾¡£
¡¡¡¡#!/bin/bash
¡¡¡¡IPTABLES='/usr/sbin/iptables'
¡¡¡¡# Set interface values
¡¡¡¡EXTIF='ppp0'
¡¡¡¡INTIF1='bnep0'
¡¡¡¡# enable ip forwarding in the kernel
¡¡¡¡/bin/echo 1 > /proc/sys/net/ipv4/ip_forward
¡¡¡¡# flush rules and delete chains
¡¡¡¡$IPTABLES -F
¡¡¡¡$IPTABLES -X
¡¡¡¡# enable masquerading to allow LAN internet access
¡¡¡¡$IPTABLES -t nat -A POSTROUTING -o $EXTIF -j MASQUERADE
¡¡¡¡# forward LAN traffic from $INTIF1 to Internet interface $EXTIF
¡¡¡¡$IPTABLES -A FORWARD -i $INTIF1 -o $EXTIF -m state --state NEW,ESTABLISHED -j ACCEPT
¡¡¡¡#echo -e " - Allowing access to the SSH server"
¡¡¡¡$IPTABLES -A INPUT --protocol tcp --dport 22 -j ACCEPT
¡¡¡¡#echo -e " - Allowing access to the HTTP server"
¡¡¡¡$IPTABLES -A INPUT --protocol tcp --dport 80 -j ACCEPT