Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Saturday, September 15, 2012

Micromax MMX 353G modem in linux

I am using BSNL broadband for 5-6 years now. Now and then disruption in their service made me wish for a good backup Internet connection for long. Unfortunately in my locality, like most of the places in Bengal, there is no broadband vendor other than BSNL. I tried tata usb modem and reliance netconnect modem earlier. It was plain waste of money.

After the arrival of 3g network, I got to know about this generic 3g modem which one can use with any prepaid/postpaid 3G SIM. I went to a local computer store and randomly purchased Micromax MMX3G. I also got a Vodafone 3G SIM meanwhile.

As it happens generally, the modem didn't work in my CentOS 6.2 desktop. It was mounting the modem as USB Mass Storage device. I was not able to mount it as an USB Modem. After around a weeks of effort in Internet, I found this tool called usb_modeswitch. I installed that and followed some other configuration steps specified in some forums (don't remember the link). NetworkManager was recognizing this device and I was able to create network using this device. But unfortunately I was not getting connectivity. I called Vodafone customer care to find out if they can help. They straight away said that neither do they support this device nor do they support Linux. I still wanted to talk to the technical support team. Fortunately I was connected to a support engineer. He refused to help saying it won't work in Linux. After I insisted for an answer he said I might try with APN (Access Point Name) as www. If it works, well and good. Otherwise, tough luck.

While rechecking my configuration, I found I configured APN as internet earlier. I modified that and tried it again. And, bingo! Network became active, I got connected to the Internet. My billion thanks to that support engineer who provided me this tricky help.

For reference below is the list of steps, I use to start the network using this device. Once these steps are done, NetworkManager detects the device after 2-3 seconds. 0x1c9e and 0x9605 are the vendor and product ids for this device.

service network stop

service NetworkManager start

usb_modeswitch -W -I -c /etc/usb_modeswitch.d/1c9e\:f000 -v 1c9e -p f000

modprobe usbserial vendor=0x1c9e product=0x9605

modprobe option
Good luck :)

Friday, May 11, 2012

Upgrading to CentOS 6.2

Life have been pretty stable with CentOS 5.2 for last couple of years. But experiment to modify some lvm logical volumes ended up corrupting my file system under /usr/local. Since many binary and lib files are stored under this, I thought to fix this fresh OS installation would be the easiest option. I'm not sure if there was any other way around to restore /usr/local.

Thinking of fresh installation, I thought it's also good time I upgrade to a newer version. Since my /home is mounted as a different file system, I thought it'll be fairly easy to install CentOS 6.2. It was actually. Many quirky things which I had to do for 5.2 seemed to work out of the box. But as it happens, fresh installation always comes with its own issues. Few things I noticed:

  • My eclipse started crashing soon after I started using CentOS 6.2. Some looking around in the web pointed me to the potential incompatibility between eclipse and Xulrunner 2 which came with CentOS 6.2. Removing Xulrunner 2 did the trick.
  • I could install FF 12, Google Chrome, Opera without any fuss. 
  • I was pleasantly surprised to find Network Manager automatically creating the DSL connection provided by BSNL. But then the difficulty started. Internet was working. But I found many websites mostly those which uses a CDN service were not loading in browsers. I tried FF, Chrome and Opera. All were having similar behavior. Digging deep in the Internet didn't help much. Finally I thought let me try removing Network Manager and creating the connection using traditional network service. I installed rp-pppoe to create the pppoe connection manually. That happened to be the eureka moment. Now all websites seem to be loading smoothly in all the browsers.

Tuesday, March 03, 2009

Configuring LAN with BSNL Datone in Linux machine

This is how I configured my home LAN with one desktop and one laptop. Before listing the exact steps let me brief the background. The desktop runs on CentOS and acts as the gateway for the LAN machines. Main difficulty was implementing the NAT so that I could access Internet from my Laptop. Looking at the tldp documentation, I thought it would be fairly easy to implement ip masquerading using iptables. Actually it was but only after I found the correct fix when Internet is provided through PPPoE protocol. The point to remember with PPPoE is the outgoing port in these situation will be ppp* not eth*.


+-------------+ +-------------+ +-------------+
----| | | | 10.0.0.* | |
BSNL| Modem | 192.168.1.* | Gateway |---------------| Internal M/C|
Cable| |---------------| (CentOS) |eth1 | (Ubuntu) |
| | (ppp) eth0| | | |
+-------------+ +-------------+ +-------------+




Step 1:
[root ]# echo 1 >  /proc/sys/net/ipv4/ip_forward

Step 2:
[root ]# echo "net.ipv4.ip_forward = 1" >> /etc/sysctl.conf

Step 3:
[root ]# echo 1 >  /proc/sys/net/ipv4/ip_dynaddr

Step 4:
[root ]# /sbin/iptables -A FORWARD -i eth1 -o ppp0 -m state --state RELATED,ESTABLISHED -j ACCEPT

Step 5:

[root ]# /sbin/iptables -A FORWARD -i ppp0 -o eth1 -j ACCEPT

Step 6:
[root ]# /sbin/iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE

Step 7:
[root ]# service iptables save

Step 8:
[root ]# service iptables restart

Step 9:
If you have some firewalls (like Redhat Firewall) enabled in your system, you must make the LAN interface trusted in the gateway machine.

And there you go. Step 4-9 can also be done using UI: /usr/bin/system-config-securitylevel-tui like this:



P.S.: Chennai LUG helped me for this.

Wednesday, March 28, 2007

Reading Anandabazar on linux

I am using Linux seriously for last four years. One of the things I wanted to do on linux from the very beginning is to read my favourite bengali daily Anandabazar Patrika. I tried a lot, but my all efforts went in vein vain. People told me that you can not read Anandabazar on linux due to some font issues :(. But recently with help from Kolkata-Lug I got a work around by which I can read my favorite daily on linux. In this post, I try to give a how-to kinda description of what you need to do to read Anandabazar on linux.

First thing you need is an unicode enabled browser. And firefox is one such browser. But problem is indic scripts don't get rendered properly with firefox. To view indic scripts in firefox you need to use a different rendering engine, called pango. The default download version available on mozilla site is not built with pango. So with that version, you can't view indic scripts properly.

There are two ways to get firefox built with pango. Binaries available in fedora or ubuntu repositories are built with pango. So if you use these two distros and install firefox using yum or apt-get then chances are you'll get a pango enabled firefox. Other option is to build firefox from source yourself, though I don't have any clue on this. To check if your firefox has pango built in, input 'about:buildconfig' in your firefox address bar. Look for '--enable-pango' in configure arguments. If you see one such phrase, then you can be sure that your firefox has pango built in.

Next, you need an Unicode Bangla Font. Ankur has a good mini and precise how-to for installing Bangla fonts. But, I was not able to install the rpm from that site due to some dependency problem. So I had to opt for the good old tgz packages. The instructions are given there, and they are very straight forward indeed.

With this settings, you will be able to view most bengali sites. But unfortunately there are some *stupid* websites who don't like to follow the font specifications. They use their in-house proprietary set of fonts. Anandabazar is one among them. To get rid of this comes Padma, yet another firefox extension. Padma automatically transforms web pages that use the specified dynamic font schemes (Anandabazar is one among them) to Unicode. And once you have the unicodes, firefox is able to render them.

I was so happy to read 'Golmele Ginni' after so many days ;-)

Note: All these were done on a CentOS release 4.1 (Final) and Firefox 1.5.0.10.