📜 ⬆️ ⬇️

Ubuntu: Distribute Internet to Palm via Bluetooth - in 10 steps

The point of this article is to make the Palm PDA, which has a Bluetooth interface, go to the Internet through a configured connection in Linux. Although it would be more correct to say - get Linux to distribute 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, look for the line that defines the Bluetooth name on the PC name "% h-% d" and change to something more meaningful, for example: name "ubuntu";
Then the security user line ; change to security auto . Also make sure that the auth enable and encrypt enable lines 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 it. Do not be scared.

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 assumed that the network interface in Ubuntu, which distributes the Internet is eth0, if you have a different one, for example, eth1, change it to your own 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 the 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 start the Bluetooth LAP (Lan access over PPP) daemon in a non-demonic: 0 mode and you will be able to watch the Bluetooth connection process of your PDA and PC.

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

Our dund will output the lines of the connection process, in my case the connection was established immediately and there was nothing more to configure!

Step 10
Create a shell script for sharing an 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 execute:

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

Source: https://habr.com/ru/post/31440/


All Articles