Article Title: tips: build a personal Bluetooth Lan in Linux. Linux is a technology channel of the IT lab in China. Including desktop applications, Linux system management, kernel research, embedded systems and open source, and other basic categories, bluetooth is used to build a personal wireless LAN, which is convenient, practical, and flexible.
First, install bluez-libs, bluez-utils, and the bnep module in the kernel.
1: Start Bluetooth hciconfig hci0 up piscan
2: modprobe bnep
* The preceding steps must be performed on both the host and client.
3: run pand -- listen -- role NAP -- master on the host.
Run pand -- connect 00: 11: 67: 46: 4E: 4E -- role NAPU on the client.
4: When pand-l is used, you can see
Bnep0 00: 11: 67: 46: 4E: 4E PANU
The connection is successful.
5: set ifconfig bnep0 10.10.106.1 on the host
Set ifconfig bnep0 10.10.106.2 on the client
Now, you can ping 10.10.106.2 to 10.10.106.1.
To share Internet access, you need to use iptable on the host.
Add a route to the client
Route add-net default gw 10.10.106.1
The following is my iptable script.
#! /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
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.