I am a complete noobie to Linux, though I did use a 2.0 smoothie for a couple of years. But I recently moved to an area without the prospect of getting any serious type of broadband, and the only thing I could get was O2 Broadband using a Huawei usb modem. This is a 270 version, but I understand that the instructions for the 220 should be exactly the same.
The problem was that in the house the signal was poor, and I couldn’t get a signal in my study where my desktop pc was, so the modem had to go up in the loft – 5 Bars up there. Initially I tried XP Pro on this machine, but I couldn’t get the thing patched up, as it was running very unstable, with almost constant lockups, then I found that Smoothwall 3.x could be modified to do this.
My machine only has usb 1 (.1 I think) hubs, but I have ordered a new 2.0 pci card, though as I cannot get 3G where I am, merely EDGE, I doubt the usb connection is much of a bottle neck.
I note that there seem to be a number of unanswered posts about this very topic, but would like to stress that none of these instructions are mine, and all credit should go to Andrew Bevitt- NextG –over LAN with Smoothwall.
[ندعوك للتسجيل في المنتدى أو التعريف بنفسك لمعاينة هذا الرابط]and Nanab in these forums;
[ندعوك للتسجيل في المنتدى أو التعريف بنفسك لمعاينة هذا الرابط]Etherlord suggested that I write these instructions down, so here is the way I got it working, including the problems I had along the way.
Andrew’s instructions state that some degree of familiarity with Linux is required, which I don’t have, so this is the idiots guide- the way this idiot did it. You guys out there with vast experiences of Linux may well have a better solution to the way I did things, but it was my first time, so go easy on me!
First thing, need to download the developer version of Smoothwall- tools are required that are not included in the normal iso, basically we need the make command to configure and compile the new kernel.
Install Smoothwall 3.0, then if possible run updates- I got my box working, but the Kernel “bump up” in the updates 1 and 2 knackered it again. If you can’t run the updates first, you will need to do some of these steps again, though only the lilo configuration, as the default boot kernel gets changed from what you need it to be.
Remember, that the red is going to be the modem, so you can’t assign a NIC to the red interface.
Assuming Smoothwall is up and running now, the next thing to do is download the latest stable linux kernel- I used 2.6.25. Andrew B says a kernel newer than 2.6.20 is required to support the modem.
Now assuming you are a Windows user...
Download the tar.bz2 version of the file to your windows pc and then a copy of WinSCP. WinSCP allows a windows user to browse a linux box with a similar interface to Windows explorer, including copy, edit and delete. You will need to ensure that the SSH option is checked on the Smoothwall page for remote access. A copy of Putty is really useful too, as it is as good, if not better than a keyboard and screen attached to the box, much better than smoothwall's in build shell.
I used WinSCP version 4.07 to create a new file in the usr/src directory called kernelimage and pasted the tar.bz2 file into that.
Next bit is all my idea!!!
If you go to sources on smoothwall.org, you should be able to download a .config file for smoothwall 3.0, which means that you don’t really need to do much configuring of the kernel- I tried about 10 times, but could never get a bootable kernel! Unfortunately the link to “download the smoothwall gpl” wasn’t working when I was writing this.
Found it!
[ندعوك للتسجيل في المنتدى أو التعريف بنفسك لمعاينة هذا الرابط]then save this file to windows pc- it won’t let you save it as .config- invalid windows name, so call it something else until copying the file to the smoothwall.
Another option I suppose would be to start the kernel configuration on the current kernel, and change nothing, just save the .config file, then copy it by WinSCP to your windows desktop for the moment.
So logon as root.
Code:
- الكود:
-
cd /usr/src (note there is a space after cd)
Code:
- الكود:
-
tar xjf /usr/src/kernelimage/linux-2.6.25.tar.bz2
This will decompress to the folder linux-2.6.25 which will be located in usr/src
Modify the path to where you put your tar.bz2 file, and replace the numbers after linux with the version you are using (MUST be higher than .20)
Now we have extracted the kernel it is time to configure it.
I would at this stage copy the .config file created earlier to the new linux-2.6.25 folder with WinSCP.
Change to the linux-2.6.25;
Code:
- الكود:
-
cd /linux-2.6.25
Then type the command
Code:
- الكود:
-
make menuconfig
At this point it is worth loading up the previous .config file you put in the folder, there is an option to do this down the bottom of the main screen.
Then we need to add some extras to the standard kernel;
There are options here- pressing Y includes the option in the kernel, N excludes, and M modularises- which means that it will be installed if required (I think). Perhaps a normal kernel should have everything which might be required as M, but as Smoothwall is intentionally a cut down version, I guess the less things installed the better, from a security vulnerability point of view.
Have a browse through the options, I think particular attention to the usb options is required- try to ensure that your chipset type is selected- does your motherboard have a UHCI or an OHCI chipset. Unless it is unusual, I guess you should be able to check this with the manual, or modularise everything except the unusual ones?
Code:
- الكود:
-
lspci -v | grep HCI
will give you the info also I believe.
If you can get online another way, maybe you check your pc out in my smoothwall, as I believe it gives details about usb in the list of hardware.
Now the things that definitely require addition: Whether you decide to modularise these or install them is up to you- I installed these, as it makes sense they will be required.
Under Networking/Networking Options/Network packet filtering framework (Netfilter), enable everything you can.
Under Networking/Networking Options enable
IP: advanced router
IP: tunnelling and
IP: TCP syncookie support.
In Device Drivers/Network device support , make sure
PPP (point-to-point) support is enabled and enable everything that is listed below PPP support.
Under Device Drivers/USB Support/USB Serial Converter support enable
USB Serial Converter support and enable USB driver for GSM and CDMA modems.
In the general screen I gave mine a local version append calling it O2_Modem, but you can call your whatever suits.
Now save the changes- hit escape and it will ask if you want to save. Confirm and save the file as .config- it may overwrite the previous one, but you’ll have a backup on your desktop anyway. It should then exit and confirm that .config was saved.
Now run make
Code:
- الكود:
-
make
this takes a few minutes, then type
Code:
- الكود:
-
make modules_install
this is quicker.
Not quite sure what this next bit is for, but type it anyway- I think it makes the boot image for your newly configured kernel.
Now, Andrew B said to type
cp arch/i386/boot/bzImage /boot/vmlinuz-2.6.22.9-nextg
but I didn’t have an i386 folder, so I did this
Code:
- الكود:
-
cp arch/x86/boot/bzImage /boot/vmlinuz-2.6.25-O2_Modem
Note the capital in bzImage- linux is case sensitive remember!!
Next we need to configure lilo to boot the new kernel.
The program vi is a bit odd to windows users, you type i to insert, escape to exit inserting, and a slash / will find anything typed after it. Andrew suggests finding the correct lines using the slash, but though this worked, I couldn’t figure out how then to get out of searching at the line found. At least you can see what you are supposed to be looking for when you start scrolling through the lines of text/code. Oh, and to save you type a capital ZZ or wq, but not when inserting text -esc first.
I think you could also use WinSCP to navigate to the file in question, and then use the edit option in that program- might be easier?
Type;
Code:
- الكود:
-
vi /etc/lilo.conf (again note there is a space after vi)
Change the line Default=Smoothwall to Default=SW-O2_Modem or whatever you want to call it,
Then add the next 2 lines at the bottom-under the current one(s)- there will be more than one if you ran the updates.
image=/boot/vmlinuz-2.6.25-O2_Modem
label=SW-O2_Modem
the vmlinuz bit needs to be the same as the name you called it in the cp /arch line above, and the label= needs to be the same as typed in the default= line. The label= line needs a tab in front of it like the other entries.
Save it- ZZ, and now run lilo-
Code:
- الكود:
-
lilo
When lilo runs it should confirm added your kernel- SW_O2Modem as well as any others that were in the list- these are your originals and will show up in the first screen when Smoothwall boots- you can press escape to select different ones, but the new one will be the default. That’s your get out of jail card if this doesn’t work- I had to do it a couple of times, but that was due to incorrect kernel configuration.
As long as lilo runs without errors, it is time to reboot Smoothwall and hope it works. First few times I tried to configure the kernel I ended with a kernel panic, but the .config file helps.
If it reboots login as root on the smoothwall box or over SSH, and type;
Code:
- الكود:
-
dmesg | tail
(the line is to the left of z, at least on a UK keyboard). Then plug in the modem and type
Code:
- الكود:
-
dmesg | tail
again- I had to do this a couple of times before it noticed the modem, but you should see various new details about USB showing up. If that is ok, time to configure Smoothwall to use the new modem. If not, try again- using the above links!
Need to configure pppsetup.cgi
This is where using the console in Smoothwall became too difficult for me- screen was corrupting, Putty or the keyboard & screen options are better.
Type;
Code:
- الكود:
-
vi /httpd/cgi-bin/pppsetup.cgi
Find the line that reads
unless ($pppsettings{'COMPORT'} =~ /^(ttyS0|ttyS1|ttyS2|ttyS3|isdn1|isdn2|pppoe|adsl)$/) {
and insert |ttyUSB0
so that it reads
unless ($pppsettings{’COMPORT’} =~ /^(ttyS0|ttyS1|ttyS2|ttyS3|ttyUSB0|isdn1|isdn2|pppoe|adsl)$/) {
Find the line that reads
selected{'COMPORT'}{'ttyS3'} = '';
And add this line beneath it
selected{’COMPORT’}{’ttyUSB0′} ='';
Note: the quotes at the end are 2 single quotes, not one double quote- more obvious onscreen than as I type here.
Find
<option VALUE='ttyS3' $selected{'COMPORT'}{'ttyS3'}>$tr{'modem on com4'}
And add beneath
<option VALUE=’ttyUSB0′ $selected{’COMPORT’}{’ttyUSB0′}>O2_Modem
(or again whatever you wish to call it. Also note that it looks wrong compared to the lines above, which all have >$tr{ in them- I assumed that was a typo mistake, but it isn’t!)
Save again- ZZ
Now;
Code:
- الكود:
-
vi /usr/bin/smoothwall/writedhcp.pl
Find the line that reads
print FILE "\tmax-lease-time $maxleasetime;\n";
And below it add
print FILE “\tauthoritative;\n”;
Save; ZZ, and that is basically you done.
Reboot the Smoothie again, and then go into the Smoothwall web page, to configure the new dial up settings.
Go to networking/ppp, and you should be able to select the 02_Modem (or whatever) as the modem, I used gprs as username and password- I’m not sure you would need one, but you might need to google these settings- you don’t need to insert the APN anywhere- I was trying to insert “open.internet” somewhere, but it works without that. The number to dial (for me) is *99#.
Oh, and I used the Huawei O2 program on my windows PC to get rid of the request/ requirement to input a pin before connecting- works for me, but as I say it is in the attic, and if someone steals it, no doubt the computers are gone too!!
Do a test dial, and fingers crossed!
If you didn’t manage to run updates before starting this modification, I would run them now, once they have installed you will need to use vi again to re-edit the lilo.conf file to re-establish your kernel as default. You will also need to add it back to the list of images, as when I updated mine, the only boot image options were Smoothwall and old. Remember to rerun lilo, and ensure it confirms the images were added before rebooting.
Issues- my modem seems to lose the connection after about 1½ to 2 hours, I have no idea why, but perhaps O2 don’t want the modem used with a persistent connection. I suspect there is something else going on though, as I cannot reconnect, and the logs suggest that Smoothwall seems to lose the modem- seems disconnected. I set mine to automatically dial on DNS request, with a time out of 0- always on, and set to reboot if the connection went down for 5 minutes or more- as I say, the connection will never come back up without a reboot anyway. Though if I manually hang it up I can redial!?!Seems to work ok, though I haven’t had the time, (and don’t have the knowledge at the moment) to investigate this further.
If you get this working, perhaps you would let me know how yours works out?
I hope this works for you- I have read and re-read these instructions to try to ensure there are no mistakes, and I can't find any, so hopefully it is all present and correct.
Best of luck, and as I say I’m just telling you what I learned from these two other Linux Gurus.
Ian