Setting up 3G dongle/USB Modems for linux

In some places, 3G USB modems might be only way to connect our servers to internet. Below is a guideline to install and use 3G dongles in linux.


Install wvdial to be used for dialing 3G modem


yum install wvdial


Now create a configuration file for wvdial in ‘/etc/wvdial.conf'


    vi /etc/wvdial.conf
Dialer Defaults
[Dialer Defaults]
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2
Init3 = AT+CGDCONT=1,"IP”,"<APN of Internet provider>"
Stupid Mode = 1
Modem Type = USB Modem
New PPPD = no
Modem = /dev/ttyUSB2
ISDN = 0
Auto Reconnect = 1
Phone = *99#
Username = <Provider username>
Password = <Provider password>
Baud = 460800
Carrier Check = no
Install required libraries and tools.


yum install tcl usbutils libusb1-devel


Download usb_modeswitch and usb_modeswitch_data


Download using wget command
wget #or latest
wget  #or latest


Extract and install
tar xvfj usb-modewitch-2.2.6.tar.bz2
tar xvfj usb-modewitch-data-20151101.tar.bz2

cd usb-modewitch-2.2.6
make install

cd usb-modewitch-data-20151101
make install


usb_modeswitch creates some udev rules to automatically change the mode of 3G dongle to act as usb_modem
Now plug in your 3G dongle, it should automatically be detected.


     dmesg | grep tty   # should show something like 'GSM modem (1-port) converter now attached to ttyUSB0'
     sudo wvdial &


Now this should start dialing via 3G modem, and internet should be started.

The Bahmni documentation is licensed under Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)