Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have just installed 12.04 on a separate partition on my hard drive so I can dual-boot to either Windows 7 or Ubuntu.

I am living in Japan and so I'm using a mobile broadband USB device called "Softbank C02LC".

By default it seems that this device isn't recognized, so I did the following:

Terminal:

sudo su
nano /usr/bin/usbModemScript

Nano:

#!/bin/bash
echo 1c9e 9900 > /sys/bus/usb-serial/drivers/option1/new_id

Terminal:

chmod +x /usr/bin/usbModemScript
nano /etc/udev/rules.d/option.rules

Nano:

ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9900", RUN+="/usr/bin/usbModemScript"
ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9900", RUN+="/sbin/modprobe option"

which made the device visible from the network manager etc.

However, even though I set up my details correctly when I created a new connection (Correct username, APN etc) as soon as I try to connect it almost immediately disconnects.

Because of this I then followed the instructions at this site.

And I ended up using the c02lc_connect script at the bottom of the page to connect to the Internet.

The file contains the following bash script:

#!/bin/sh

usbinterfece=/dev/ttyUSB2
VID=1c9e
PID=9900
WRONG_PID=f000
LSUSB=/usr/sbin/lsusb
GREP=/bin/grep
MODPROBE=/sbin/modprobe
SWITCH=/usr/sbin/usb_modeswitch
SWITCH_D=/etc/usb_modeswitch.d
WVDIAL=/usr/bin/wvdial
SLEEP=/bin/sleep
SUDO=/usr/bin/sudo
WHICH=/usr/bin/which

switch_config="$SWITCH_D/$VID:$WRONG_PID"

if ! [ -x $WVDIAL -a -x $SWITCH ]; then
    echo "Install wvdial and usb_modeswitch."
    exit 0
fi

check_usb() {
    local vid="$1"
    local pid="$2"
    ($LSUSB | $GREP "$vid:$pid")
}

if ! (check_usb "$VID" "$PID"); then
    echo "Cannot find modem device..."
    if (check_usb "$VID" "$WRONG_PID") && ( [ -f "$switch_config" ] ); then
        echo "The device is attached but its mode is wrong."
        echo "Try usb_modeswitch..."
        $SUDO $SWITCH -c "$switch_config"
        $SLEEP 1
        if (check_usb "$VID" "$PID"); then
            echo "Successfully switched the mode."
        else
            echo "Failed to switch the mode..."
            exit 1
        fi
    else
        exit 1
    fi
fi

if [ ! -c "$usbinterface" ]; then
    $SUDO $MODPROBE usbserial vendor=0x$VID product=0x$PID
    $SLEEP 2
fi

$SUDO $WVDIAL

which works completely fine - no problems what-so-ever.

But we also have 1 more laptop here which I need to share the Internet connection with. In Windows 7 I do this with the Connectify program, and in Ubuntu I have seen that you can do things like set up hotspots etc.

But because I am using WvDial I am not sure how I would share the Internet.

I am only beginning to use Ubuntu but unfortunately until I can figure out how to share the Internet over WiFi when connected via WvDial I have to stick with Windows.

If you have any ideas on how to do this it would be much appreciated.

share|improve this question

1 Answer 1

up vote 2 down vote accepted

Hi you need to configure hostapd

I have configure following in hostapd /etc/hostapd/hostapd.conf with WPA authentication options for wireless users

01 interface=wlan0

02 driver=nl80211

03 ssid=dontMessWithVincentValentine

04 hw_mode=g

05 channel=6

06 macaddr_acl=0

07 auth_algs=1

08 ignore_broadcast_ssid=0

09 wpa=3

10 wpa_passphrase=KeePGuessinG

11 wpa_key_mgmt=WPA-PSK

12 wpa_pairwise=TKIP

13 rsn_pairwise=CCMP

sudo hostapd /etc/hostapd/hostapd.conf

share|improve this answer
    
Thank you for taking the time to answer my question. I am new to Ubuntu so this might be a bit of a simple question, but I am assuming that I would need to edit the /etc/hostapd/hostapd.conf file with my own settings and then should it just work if I create an ad hoc network? –  Sour Lemon Oct 3 '12 at 6:33
    
yes u need to create a as hoc connection –  kam gos Oct 3 '12 at 6:57
    
Thank you - It's working now. At first it wasn't working even though I could see the ad hoc wireless connection, but that was just because of the encryption method for some reason, so I changed it to the WEP encryption and now it's fine. –  Sour Lemon Oct 3 '12 at 7:42
    
Welcome its nice to to know that the problem is solved –  kam gos Oct 3 '12 at 7:56

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.