Build a personal Bluetooth LAN on the Linux platform
Source: Internet
Author: User
Create a personal Bluetooth LAN on the Linux platform-Linux Enterprise Application-Linux server application information. For more information, see the following. Using bluetooth to build a personal Wireless LAN on the Linux platform 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.
00: 1167: 46: 4E: 4E is the address of the bluetooth device.
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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service