bfw as UMTS router mini howto

bfw as UMTS router mini howto

Mensagempor e_defranc » Qua Jul 15, 2009 2:25 pm

*************************************************************************
BFW as UMTS router mini howto
*************************************************************************

written by Ezio Reisenhofer - Trieste - Italy July, 12,2009
===================================================

This is no realy an how to but is a report about my personal experience to setup the BFW as UMTS router with a USB Key.

I have test all this in Italy with an Italian Operator but most likely all this work in all country and with all operator that use the same usb key.

The my modem key is a Huawey E169.

Before that you can use it with BFW there are some operations that you must to do.

Most likely your key is pre configured as to be aspect that you typing the pin code before that the modem subscribe the network access.

This features for our use is not welcome.

Is need that you install on the windows system the software that come with the key on the key itself and modify this feature so that the key can acquire the network without any pin code.

Usualy this operation can be make also from the vendor were you buy the key and subscribe the service account.

There is another thing that you need: the hardware id.

This can be detected by the same windows system (computer resources -> hardware -> device manager -> modem -> <your modem key model> -> properties -> details -> ID Hardware) or, by any modern linux system.

I have used an Xubuntu 8.04: from a terminal console typing lsusb and viewing the result.

Pluging the key modem and retype lsusb ... the new device is your key and the id hardware is similar to this:
Código: Selecionar todos
12d1 1001

(coincidentally this is the mine).

After all this premise, you are ready to start to setup your BFW as UMTS router.

Firstly, download the iso of latest version of BFW (currently I use the 2.31.10.final) make a cd with it and boot up the target PC from cdrom.

Download also the usbserial module from here:
http://www.polaco.pro.br/brazilfw/addons/usbserial.tgz (thank to cmartin for the encouragement and support).

Contrary to earlier versions that I have used (the last one is the 2.26) the wizard autodetect the nic and install all packages on to the hardisk of the target pc.

The wizard will propose you to make a partition of about 40 Mb for bfw and the rest of the disk as another partition of dimension that you can define as you want or, if you want, you can choose of not use it.

I suggest to create in any case 2 partitions ... the second one will be used as general purpouse disk.

If you choose to make a second partition, this will mounted on /partition mount point.

When asked, select the dialup router version with modem and ppp session.

After the end of installation, when proposed by wizard, remove the cd and reboot the system.

The Bfw startup ... perform all personalization that you need and, most important thing, copy the usbserial.tgz in the startup disk of the bfw.

You can to do this simply:

1) coping the module on a floppy;
2) insert the floppy in the target pc and from bfw console typing:

Código: Selecionar todos
mkdir /mnt/floppy
mkdir /mnt/bootdisk

mount /dev/fd0 /mnt/floppy
mount /dev/boot /mnt/bootdisk

cp /mnt/floppy/usbserial.tgz /mnt/disk

sync

After this, umount the floppy and bootdisk (not realy need but prefered) and re boot the system.

Before the system restart, enter in the bios setup and verify that usb is enabled and that the usb legacy is disabled.

I don't know if this is realy need but in my experience with the usb legacy enabled my system don't see the usb modem key.

Save and exit from the bios setup and bootup the BFW with the key plugged in a usb port ... looking to the screen ... at some point after modules loading, you must see a text similar to this:

Código: Selecionar todos
usb.c: registered new driver serial
usbserial.c: USB Serial support registered for Generic
usbserial.c: Generic converter detected
usbserial.c: Generic converter now attached to ttyUSB0 (or usb/tts/0 for devfs)
usbserial.c: Generic converter detected
usbserial.c: Generic converter now attached to ttyUSB1 (or usb/tts/1 for devfs)
usbserial.c: Generic converter detected
usbserial.c: Generic converter now attached to ttyUSB2 (or usb/tts/2 for devfs)
usbserial.c: USB Serial Driver core v1.4


This is good and means that the system have initialized correctly the usb serial system.

At this point, with a browser from a pc on the internal network, login and browse your bfw.

Point to Internet Address Configuration page and set as follow:

    On-Demand Connection -> Use on demand connection
    On demand timeout -> 30 sec (or less or more as you prefer)
    Modem Device -> /dev/ttyUSB0 (originaly you see /dev/ttyS0, cancel and write as show here)
    Serial port speed -> 115200
    Modem Init String -> ATZ
    Phone Number -> *99#
    Username -> leave blank
    Password -> leave blank
    Perform Login During Chat -> No (usualy the operator recognize the user from SIM in the USB Modem for this don't require u.n. and password for the login)
    Did your ISP assign you a static IP ADRRESS -> No
    Local Remote IP -> 10.0.0.1
Save all and backup also on the system disk (select this option from web menu)

From bfw console, open the file /etc/rc.d/pkgs/mod.usbserial (type: ae /etc/rc.d/pkgs/mod.usbserial) search the rows:

Código: Selecionar todos
VENDOR_ID=0x12d1
DEVICE_ID=0x1001


and replace the original value with the ID hardware of the your key (that you have previously detected).

Save and exit (control Q Y) and save the change on the disk typing the command menu and selecting the W (writing backup on the disk).

Now you have finished ... reboot the system and test your internet connection.

If you have choosed the option "use on demand connection", you can get up and down the conncection from the index page of the web interface of you bfw from any pc on your internal network.

The BFW also will go up the internet connection every time that from internal network any application or program try to access to the internet.

Similarly, with no trafic on the netowrk, when the time setting in "on demand timeout" expired BFW will switch off the connection.


==================================================
Some final notes
==================================================

First: about nat and local ip address

maybe what I am about to say will seem redundant ...

Most likely your service provider give you a connection completely filtered and assign you an IP in range 10.x.x.x (or 192.168.x.x).

This means that all your network will be invisible from outside and that the portforwarding will be useless ....

For this, someone might ask whether or not to disable nat ...

I think that is always preferable maintain a separation between the internal and external network. For this I suggest of enable always the NAT and, setup properly the address ip of the internal network and of the public termination (that some row up we have defined as "local remote ip").

This means that if your ISP assign you an IP in the range 10.x.x.x, you must assign to the local remote ip an address in range 10.x.x.x (i.e. 10.0.0.1, obviously this must be different from the ip assigned from the ISP) and for the local network you will use the addresses in the range 192.168.x.x, and, on the contrary if your ISP assign you an IP in the range 192.168.x.x, you must assign to the local remote ip an address in range 192.168.x.x (i.e. 192.168.1.1) and for the local network you will use tha addresses in the range 10.x.x.x.

Second: about the test of gateway

I don't know if is a bug or not, but for me the test of the gateway don't work.

I have modified the /usr/sbin/gateway.test where is setup the gateway IP from:

Código: Selecionar todos
GATEWAY=`echo $GATEWAY | cut -f 3 -d " "`


to

Código: Selecionar todos
GATEWAY=`echo $GATEWAY | cut -f 2 -d " "`


Now when you test the gateway (and the link is up) it's working for my configuration.

If your gateway test fails, you can try my update.

But for apply this, is need that you copy the root.tgz from your boot disk on other side (i.e. on other partition mounted in /partition), untar it (tar -xvzf root.tgz), open the usr/sbin/gateway.test in the path where you have decompress the root.tgz, modify it as explained, tar all again and copy the new created root.tgz on your boot disk.

This because the standard backup procedure (I imagine for security reasons) don't backup the root.

What else ?

Good luck
e_defranc
 

Voltar para BrazilFW 2.x

Quem está online

Usuários navegando neste fórum: Nenhum usuário registrado e 1 visitante

cron