Ubuntu: Sharing Internet on Palm via Bluetooth - in 10 Steps

Original author: OnkarShinde
  • Transfer
The meaning of this article: to force a Palm PDA with a Bluetooth interface to access the Internet through a configured connection in Linux. Although it would be more correct to say - make Linux distribute the Internet to Palm via Bluetooth.
The result of all the manipulations will be this:


Step 1
gksudo gedit /etc/bluetooth/hcid.conf

In the editor, we look for the line that defines the Bluetooth name on the PC name "% h-% d" and change it to something more meaningful, for example: name "ubuntu";
Then the line security user; change to security auto . Also make sure that the lines auth enable and encrypt enable are commented out. Save and close.

Step 2
gksudo gedit / etc / bluetooth / pin

Change 1234 to something else (NUMBERS!), Save and close.
NB: In my case, the file opened empty, so I did not change 1234, but simply registered a new password and saved. Do not be alarmed.

Step 3
sudo nano / proc / sys / net / ipv4 / ip_forward

Replace 0 with 1 and save (Ctrl + X, press 'Y', press Enter)

Step 4
sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

NB: It is understood that the network interface in Ubuntu that distributes the Internet is eth0, if you have another, for example, eth1, change it to yours in the above line

Step 5
sudo iptables -A FORWARD -i ppp0 -j ACCEPT


Step 6
sudo iptables -A FORWARD -m state --state ESTABLISHED, RELATED -j ACCEPT


Step 7
Find the IP of our DNS server:
cat /etc/resolv.conf

The terminal will give us something like this: nameserver 192.168.0.1 . This IP address is the DNS address.
Now create a PPP connection file between Palm and computer.
gksudo gedit / etc / ppp / peers / palm

115200
192.168.2.1:192.168.2.2
local
ms-dns 192.168.0.1
noauth
debug

NB: See the line ms-dns 192.168.0.1 ? If you have a different DNS address, you need to change it here.

Step 8
dund --nodetach --listen --persist --msdun call palm

This command will launch the Bluetooth LAP daemon (Lan access over PPP) in non-demonic: 0) mode and you will be able to observe the process of Bluetooth connection between your PDA and PC.

Step 9
Now configure Palm:
a) Prefs - Connection - New ...
b) Name: LinuxBT (for example), Connect to: PC, Via: Bluetooth.
c) Click Tap to Find, and from the list select your PC (remember, we called it ubuntu for example)
d) Enter your password, click OK.
e) Go to Prefs - Network
e) Service: Linux, User Name / Password - empty, Connection: LinuxBT.
g) Click Connect.

Our dund will display the lines of the connection process, in my case the connection was established immediately and did not have to configure anything else!

Step 10
Create a shell script for sharing the Internet connection and make it start automatically at boot time
gksudo gedit /etc/init.d/start_bluetooth.sh

#! / bin / bash
echo 1> / proc / sys / net / ipv4 / ip_forward
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables -A FORWARD -i ppp0 -j ACCEPT
iptables -A FORWARD -m state --state ESTABLISHED, RELATED -j ACCEPT
killall -v dund
dund --listen --persist --msdun call palm

Save and close. Then do:

sudo chmod -v 755 /etc/init.d/start_bluetooth.sh
sudo ln -sv /etc/init.d/start_bluetooth.sh /etc/rc2.d/S98start_bluetooth


Done!

Cross-post from here: http://alfsoft.ru

Supplement: Related article: bluetooth pan network - the Internet on your phone from your big brother

Also popular now: