Frubee: program for Internet connection

Configuration wizards, scanners, remote desktop, etc.
Post Reply
Message
Author
tone
Posts: 28
Joined: Sun 25 Jul 2010, 22:42

Frubee: program for Internet connection

#1 Post by tone »

I designed and developed a program that connects the client to the router and assign IP address dynamically (to the client on which it's executed), without the use of the DHCP (no DHCP client, no DHCP server).
The program (via pppd) also allows connection to the Internet with USB modem sticks or mobile phone plug to the PC with USB (not tested with smartphones).
This is the URL:
https://github.com/tone77/frubee

Directions to install and try Frubee on Puppy Linux distros
A) if you don't want build it

Code: Select all

on Precise Puppy 5.7.1 (kernel 3.9.11) run frubee-x.x.x-precise571.pet
on Slacko 5.7.0 (kernel 3.10.32) run frubee-x.x.x-slacko570.pet
on Tahrpup 6.0.2 (kernel 3.14.20) run frubee-x.x.x-tahr602.pet
B) if you want build it

Code: Select all

on Precise Puppy 5.7.1 install "devx_precise_5.7.1.sfs" ([url]http://distro.ibiblio.org/quirky/precise-5.7.1/devx_precise_5.7.1.sfs[/url])
on Slacko 5.7.0 install "devx_slacko_5.7.0.sfs" ([url]http://distro.ibiblio.org/puppylinux/puppy-slacko-5.7/devx_slacko_5.7.0.sfs[/url])
on Tahrpup 6.0.2 install "devx_tahr_6.0.2.sfs" ([url]http://distro.ibiblio.org/puppylinux/puppy-tahr/iso/tahrpup%20-6.0-CE/devx_tahr_6.0.2.sfs[/url])
and run from shell the script "install.sh".

Once installed, run from shell:

Code: Select all

frubee
and follow the onscreen instructions.

Light test
You can try Frubee even if the PC has already an IP address and it's connected to the router via DHCP.
Run Frubee.
To restore the original configuration restart PC (PC could have another IP address).

Full test
To avoid the risk of no longer be able to connect, before running the full test, it's advisable to check if Frubee connects to Internet with the mode aforementioned, that is not by manually editing the original configuration.
For details read below.
1. Disable DHCP server in the router
2. Disable DHCP client in Puppy Linux distro: run "mv /usr/sbin/dhcpcd /usr/sbin/dhcpcd_"
3. Restart PC
4. Run Frubee
5. Re-enable DHCP server in the router
6. Re-enable DHCP client in Puppy Linux distro: run "mv /usr/sbin/dhcpcd_ /usr/sbin/dhcpcd"
7. Restart PC


Frubee also can be used if the DHCP doesn't work or is not present.


pet for Precise Puppy 5.7.1, Tahrpup 6.0.2, Slacko 5.7.0
Attachments
frubee-2.0.0-precise571.pet
Package for Precise Puppy 5.7.1
(27.85 KiB) Downloaded 354 times
frubee-2.0.0-tahr602.pet
Package for Tahrpup 6.0.2
(27.85 KiB) Downloaded 362 times
frubee-2.0.0-slacko570.pet
Package for Slacko 5.7.0
(26.5 KiB) Downloaded 348 times

tone
Posts: 28
Joined: Sun 25 Jul 2010, 22:42

#2 Post by tone »

If you want to connect automatically (don't shows dialog boxes), use "--name-nation" and "--name-operator":

Code: Select all

   frubee --name-nation NameNation --name-operator NameOperator
To assign a correct value to "--name-nation" and "--name-operator" (or see all arguments), run from shell:

Code: Select all

frubee --help
and read the content.

If you want to add a nation, a mobile phone operator, a router or custom router of an ISP you can read
https://github.com/tone77/frubee/blob/m ... aFiles.txt

tone
Posts: 28
Joined: Sun 25 Jul 2010, 22:42

#3 Post by tone »

Directions for use Frubee during the operating system boot.
1. Disable DHCP server in the router
2. Disable DHCP client in Puppy Linux distro: run "mv /usr/sbin/dhcpcd /usr/sbin/dhcpcd_"
3. In the file "/etc/rc.d/rc.local" insert:

Code: Select all

   frubee --run-from-boot > /dev/console
4. Restart PC

If frubee doesn't connects to Internet, read the file "/tmp/NOCONNECT.err" to see the error.

Restore the original configuration
1. Comment in the file "/etc/rc.d/rc.local" the command for run frubee
2. Re-enable DHCP server in the router
3. Re-enable DHCP client in Puppy Linux distro: run "mv /usr/sbin/dhcpcd_ /usr/sbin/dhcpcd"
4. Restart PC

tone
Posts: 28
Joined: Sun 25 Jul 2010, 22:42

#4 Post by tone »

There's the possibility to set the range of the IP addresses to be assigned with Frubee.
You can reserve some IP addresses to be assigned exclusively to Frubee that in this way can coexist peacefully with DHCP on the same router.

Examples
Router 192.168.1.1
DHCP - Start IP address 192.168.1.2
DHCP - End IP address 192.168.1.199
Frubee - Start IP address 192.168.1.200
Frubee - End IP address 192.168.1.254

Code: Select all

frubee --fourth-triplet-start 200 --fourth-triplet-end 254
or
Router 192.168.1.1
Frubee - Start IP address 192.168.1.2
Frubee - End IP address 192.168.1.49
DHCP - Start IP address 192.168.1.50
DHCP - End IP address 192.168.1.254

Code: Select all

frubee --fourth-triplet-start 2 --fourth-triplet-end 49

tone
Posts: 28
Joined: Sun 25 Jul 2010, 22:42

#5 Post by tone »

Frubee allows to connect multiple 3G USB modem (multiple pppd).

To manage the multiple connection there are also the scripts:
frubee_dm (frubee detect modem). This script creates the list of device to pass to frubee for the connection of multiple 3G USB modem: detects only USB modem sticks, not detects mobile phone
frubee_tc (frubee test connection). This script shows connection status of ppp0, ppp1, ppp2, ppp3, ppp4

To explain the operating directions, I write an example. I tried with two modems, but Frubee can connect more.

STEP 0
In order to have a correct detection of modems, restart your PC.

STEP 1
Run in the shell

Code: Select all

 
frubee_tc [URL on which run the ping test] [Interval of seconds between a control and the other]
it appears:

Code: Select all

 
Bytes received in connection ppp0: NOT CONNECTED
Bytes received in connection ppp1: NOT CONNECTED
Bytes received in connection ppp2: NOT CONNECTED
Bytes received in connection ppp3: NOT CONNECTED
Bytes received in connection ppp4: NOT CONNECTED
        TO STOP THE SCRIPT PRESS CTRL+C
------------------------------------------------
If unplug and plug the modem, "frubee_dm" doesn't work correctly: in this case you have to restart the PC.


STEP 2
Plug the first 3G USB modem (I have "Huawei E1820") and run frubee_dm in the shell
It appears:

Code: Select all

-------------------------------------------------
Parameter to be passed to frubee for the modem 1:
ttyUSB0
if not working, try:
ttyUSB1
if not working, try:
ttyUSB2

STEP 3
Plug the second 3G USB modem (I have "Huawei E220") and run frubee_dm in the shell
It appears:

Code: Select all

-------------------------------------------------
Parameter to be passed to frubee for the modem 1:
ttyUSB0
if not working, try:
ttyUSB1
if not working, try:
ttyUSB2
-------------------------------------------------
Parameter to be passed to frubee for the modem 2:
ttyUSB3
if not working, try:
ttyUSB4

STEP 4
To connect the modem 1, run

Code: Select all

frubee --name-device-usb ttyUSB0
situation in frubee_tc once connected the modem 1

Code: Select all

Bytes received in connection ppp0: 102
Bytes received in connection ppp1: NOT CONNECTED
Bytes received in connection ppp2: NOT CONNECTED
Bytes received in connection ppp3: NOT CONNECTED
Bytes received in connection ppp4: NOT CONNECTED
        TO STOP THE SCRIPT PRESS CTRL+C
------------------------------------------------
Bytes received in connection ppp0: 432
Bytes received in connection ppp1: NOT CONNECTED
Bytes received in connection ppp2: NOT CONNECTED
Bytes received in connection ppp3: NOT CONNECTED
Bytes received in connection ppp4: NOT CONNECTED
        TO STOP THE SCRIPT PRESS CTRL+C
------------------------------------------------

STEP 5
Once connected the modem 1, to connect the modem 2, run

Code: Select all

frubee --name-device-usb ttyUSB3
situation in frubee_tc once connected the modem 1 and modem 2

Code: Select all

Bytes received in connection ppp0: 4810
Bytes received in connection ppp1: 158
Bytes received in connection ppp2: NOT CONNECTED
Bytes received in connection ppp3: NOT CONNECTED
Bytes received in connection ppp4: NOT CONNECTED
        TO STOP THE SCRIPT PRESS CTRL+C
------------------------------------------------
Bytes received in connection ppp0: 4810
Bytes received in connection ppp1: 242
Bytes received in connection ppp2: NOT CONNECTED
Bytes received in connection ppp3: NOT CONNECTED
Bytes received in connection ppp4: NOT CONNECTED
        TO STOP THE SCRIPT PRESS CTRL+C
------------------------------------------------
If, however, there is something not clear, ask as well, I'm at your disposal.
Attachments
desktop.png
my desktop (on Precise Puppy 5.7.1)
(174.92 KiB) Downloaded 758 times

Atle
Posts: 596
Joined: Wed 19 Nov 2008, 12:38
Location: Oslo, Norway
Contact:

#6 Post by Atle »

This is excellent work Tone

Atle
Posts: 596
Joined: Wed 19 Nov 2008, 12:38
Location: Oslo, Norway
Contact:

#7 Post by Atle »

Did anyone try the pets here? There is no comments at all

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#8 Post by greengeek »

Atle wrote:Did anyone try the pets here?
I have not tried them as my environments all have a pre-existing DHCP server. I can't think of a situation where I could safely allow the client to decide on it's own IP address. Although I do like the idea of another method to allow 3G modems to connect. But don't they have to receive their IP from the ISP rather than allocating their own??

tone
Posts: 28
Joined: Sun 25 Jul 2010, 22:42

#9 Post by tone »

Hello Atle, I'm honoured of your appreciations on Frubee!!
Thanks (also Frubee thanks you)!
Everything worked properly?

Hello greengeek!
Frubee doesn't wants to replace DHCP, but it wants to be a lifeboat if DHCP doesn't work or is not present.

There are two types of IP addresses: private and public.

DHCP service assigns private IP address dynamically that can be used freely in a local network:

Code: Select all

Private IP address (used only in local network)
from 10.0.0.0 to 10.255.255.255
from 172.16.0.0 to 172.31.255.255
from 192.168.0.0 to 192.168.255.255
Also Frubee assigns private IP address dynamically (I have only tried 192.168.xxx.xxx).

Public IP addresses are issued by ISP (Internet service providers): you see it in the configuration page of the router or in the websites that offer this service.

tone
Posts: 28
Joined: Sun 25 Jul 2010, 22:42

#10 Post by tone »

I released version 2.2.0 of Frubee

Has been added the possibility to use the desired DNS (only for the connection with the router).

To manage the DNS it was added the parameter "--user-dns".
Example

Code: Select all

frubee --user-dns AddressOfDesiredDNS
If "--user-dns" is not used, in /etc/resolv.conf is inserted the address of the router (so, are used the DNS set on the router).

To avoid that /etc/resolv.conf generated by frubee is overwritten by dhcpcd (the DHCP client) you can:
1. run "mv /usr/sbin/dhcpcd /usr/sbin/dhcpcd_"
2. Restart PC
3. Run Frubee

To re-enable DHCP client
1. run "mv /usr/sbin/dhcpcd_ /usr/sbin/dhcpcd"
2. Restart PC


pet for Precise Puppy 5.7.1, Tahrpup 6.0.2, Slacko 5.7.0
Attachments
frubee-2.2.0-precise571.pet
Package for Precise Puppy 5.7.1
(27.35 KiB) Downloaded 258 times
frubee-2.2.0-tahr602.pet
Package for Tahrpup 6.0.2
(27.5 KiB) Downloaded 257 times
frubee-2.2.0-slacko570.pet
Package for Slacko 5.7.0
(25.91 KiB) Downloaded 252 times

tone
Posts: 28
Joined: Sun 25 Jul 2010, 22:42

#11 Post by tone »

I released version 2.3.1 of Frubee

Has been added the possibility to specify the APN for the connection with the mobile.

To manage the APN it was added the parameter "--user-apn".
Example

Code: Select all

frubee --user-apn ApnOfOperator
If you use the parameter "--user-apn" you can connect with the mobile regardless of the choices in the menu in dialog boxes.

pet for Precise Puppy 5.7.1, Tahrpup, Slacko 5.7.0
Attachments
frubee-2.3.1-precise571.pet
Package for Precise Puppy 5.7.1
(28.08 KiB) Downloaded 241 times
frubee-2.3.1-tahr.pet
Package for Tahrpup 6.0.2, 6.0.5
(27.63 KiB) Downloaded 243 times
frubee-2.3.1-slacko570.pet
Package for Slacko 5.7.0
(26.13 KiB) Downloaded 244 times

Post Reply