Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 08-28-2007, 09:48 AM   #1
Slackware Contributor
Registered: Aug 2006
Location: Netherlands
Distribution: Slackware
Posts: 484

Rep: Reputation: 249Reputation: 249Reputation: 249
bluetooth pan bridging problem

Hi folks!
I have a problem, which drives me crazy. I want to establish a personal area network with two participants via bluetooth. One is connected to the internet, and I want to be able to go online on the other too.
So, what I have is a working network configuration (at least it looks like it is). I can ping both pcs from each other and I can establish ssh connections.
What I still can't is going online with the pc without internet (with the other one it's possible of course)
The commands I use are:

brctl addbr pan0
brctl setfd pan0 0
brctl stp pan0 off
ifconfig pan0
this seems working as 'brctl show' gives me the following output:

bridge name     bridge id               STP enabled     interfaces
pan0            8000.0011f607554f       no              bnep0
However, somehow I can't use it, or I can't go online over it (but I can ping it from both)

So I hope there's someone out there, who can help me with this.

Thanks in advance
Old 08-29-2007, 01:54 PM   #2
Registered: Nov 2005
Location: South coast
Distribution: Debian /AMD64
Posts: 48

Rep: Reputation: 15
Assuming that your internet connection has an ip address from a different range to those used for the bluetooth connection, the bridge in this setup allows you to add the "temporary" bluetooth interfaces bnep0, bnep1, etc to a fixed interface pan0.

The bluetooth connection will have an IP address at either end ( on the internet side). If you run "route" (as root) on the non-internet side you should see the bluetooth subnet ( routing to the bnep0 interface, hence you can ssh to that IP.
The "default" route should be set to use the bnep0 interface as well.

(as root)
$ route add default gw

On the server side, it must act as a router to the internet. The "default" route there should be the internet device (eth0/ppp0).
In order to get the reply packets back over bluetooth, you will have to do ip masquerading using iptables.

(as root)
$ iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

(change eth0 to whatever your internet is on)
You must also make sure that ip_forwarding is turned on. This is done by setting a value in proc

$ echo 1 > /proc/sys/net/ipv4/ip_forward

but should be set more permenantly in the network startup file, this may be /etc/network/options or the /etc/init.d/networking files (I have the latter in Debian)

Last edited by Que_273; 08-29-2007 at 01:56 PM. Reason: POSTrouting not PRErouting!!


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Bridging+Bonding for Bridging+HA+Load Balancing? kartheekpn Linux - Networking 0 08-13-2006 02:08 AM
How to use Bluetooth PAN to communicate in Fedora 3 chen8002004 Fedora 0 01-10-2006 08:25 PM
pan problem signmeuptoo Linux - Software 1 12-10-2005 08:44 PM
Bluetooth PAN Network HaPagan Linux - Networking 1 09-23-2005 01:55 PM
Pan reply problem dhave Linux - Software 5 02-03-2005 03:11 AM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 07:16 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration