LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   bluetooth pan bridging problem (https://www.linuxquestions.org/questions/linux-networking-3/bluetooth-pan-bridging-problem-580421/)

ppr:kut 08-28-2007 09:48 AM

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:

Code:

brctl addbr pan0
brctl setfd pan0 0
brctl stp pan0 off
ifconfig pan0 192.168.192.1

this seems working as 'brctl show' gives me the following output:

Code:

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

Que_273 08-29-2007 01:54 PM

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 (192.168.192.1 on the internet side). If you run "route" (as root) on the non-internet side you should see the bluetooth subnet (192.168.192.0) 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 192.168.192.1

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)


All times are GMT -5. The time now is 05:03 AM.