Jump to content

Recommended Posts

Posted

Hi. just downloaded and installed the new firmware 2.0.0 and i was wondering if it´s posible to use my 3g modem?

the pineapple finds the modem, but i don´t know how to get it working

im not so good with scripts.

can any one help me on the way

some info

lsusb

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Bus 001 Device 003: ID 12d1:1506 Huawei Technologies Co., Ltd. E398 LTE/UMTS/GSM Modem/Networkcard

just updated the firmware on my modem and know it´s E398 instead of E367.

Posted (edited)

You may want to look here

http://forums.hak5.org/index.php?showtopic=26108&st=0&p=199697&hl=huawei&fromsearch=1entry199697

After looking at the above thread, with out having the device see if this works. If it does let me know and I will push it to the Git. :D

Add this to you 3g.sh script. Make sure to change <<CHANGE HERE YOUR APN>> <<CHANGE HERE YOUR USERNAME>> <<CHANGE HERE YOUR PASSWORD>>

*12d1:1506*)    echo "Huawei E398 detected. Attempting mode switch"
        uci delete network.wan2         
        uci set network.wan2=interface  
        uci set network.wan2.ifname=ppp0           
        uci set network.wan2.proto=3g           
        uci set network.wan2.service=umts       
        uci set network.wan2.device=/dev/ttyUSB0     
        uci set network.wan2.apn=&lt;&lt;CHANGE HERE YOUR APN&gt;&gt;
        uci set network.wan2.username=&lt;&lt;CHANGE HERE YOUR USERNAME&gt;&gt;     
        uci set network.wan2.password=&lt;&lt;CHANGE HERE YOUR PASSWORD&gt;&gt;
        uci set network.wan2.defaultroute=1    
        uci commit network 
        usb_modeswitch -v 12d1 -p 1506
        sleep 10; rmmod usbserial
        sleep 3; insmod usbserial vendor=0x12d1 product=0x1506
        sleep 5; /etc/init.d/firewall disable; /etc/init.d/firewall stop
        logger "3G: firewall stopped"
        iptables -t nat -A POSTROUTING -s 172.16.42.0/24 -o 3g-wan2 -j MASQUERADE
        iptables -A FORWARD -s 172.16.42.0/24 -o 3g-wan2 -j ACCEPT 
        iptables -A FORWARD -d 172.16.42.0/24 -m state --state ESTABLISHED,RELATED -i 3g-wan2 -j ACCEPT

        ;;   

Edited by brianzimm
Posted

Thank you so much!!!

it worked :D

this is the output when i run 3g.sh

Searching for attached 3G Modems

1d6b:0002 12d1:1506

Huawei E398 detected. Attempting mode switch

uci: Entry not found

Looking for default devices ...

found matching product ID

adding device

Found device in default mode, class or configuration (1)

Accessing device 003 on bus 001 ...

Getting the current device configuration ...

OK, got current device configuration (1)

Using first interface: 0x00

Using endpoints 0x01 (out) and 0x82 (in)

Not a storage device, skipping SCSI inquiry

USB description data (for identification)

-------------------------

Manufacturer: Huawei Technologies

Product: HUAWEI Mobile

Serial No.: not provided

-------------------------

Warning: no switching method given.

-> Run lsusb to note any changes. Bye.

./3g.sh: line 166: /etc/init.d/firewall: not found

./3g.sh: line 166: /etc/init.d/firewall: not found

Posted

Good to know it works. Just put in a pull request in the git. :D

Posted

I use this script to my modem Huawei E173s-6

*12d1:1c05*)	echo "Huawei E173s-6 detected. Attempting mode switch"
		uci delete network.wan2 
		uci set network.wan2=interface 
		uci set network.wan2.ifname=ppp0 
		uci set network.wan2.proto=3g 
		uci set network.wan2.service=umts 
		uci set network.wan2.device=/dev/ttyUSB0 
		uci set network.wan2.apn=internet.movistar.com.co 
		uci set network.wan2.username=movistar
		uci set network.wan2.password=movistar
		uci set network.wan2.defaultroute=1 
		uci commit network 
		sleep 10; rmmod usbserial
		sleep 3; insmod usbserial vendor=0x12d1 product=0x1c05
		sleep 5; /etc/init.d/firewall disable; /etc/init.d/firewall stop
		logger "3G: firewall stopped"
		iptables -t nat -A POSTROUTING -s 172.16.42.0/24 -o 3g-wan2 -j MASQUERADE
		iptables -A FORWARD -s 172.16.42.0/24 -o 3g-wan2 -j ACCEPT 
		iptables -A FORWARD -d 172.16.42.0/24 -m state --state ESTABLISHED,RELATED -i 3g-wan2 -j ACCEPT

		;;

apparently all goes well, the connection is successful but then the modem disconnects and shutdown

Jan  1 00:11:29 Pineapple user.notice root: 3G: Connection Script here, searching for modems
Jan  1 00:11:31 Pineapple kern.info kernel: [  691.110000] usb 1-1: new high-speed USB device number 27 using ath79-ehci
Jan  1 00:11:31 Pineapple kern.info kernel: [  691.600000] usbserial_generic 1-1:1.0: generic converter detected
Jan  1 00:11:31 Pineapple kern.info kernel: [  691.610000] usb 1-1: generic converter now attached to ttyUSB0
Jan  1 00:11:31 Pineapple kern.info kernel: [  691.610000] usbserial_generic 1-1:1.1: generic converter detected
Jan  1 00:11:31 Pineapple kern.info kernel: [  691.620000] usb 1-1: generic converter now attached to ttyUSB1
Jan  1 00:11:31 Pineapple kern.info kernel: [  691.620000] usbserial_generic 1-1:1.2: generic converter detected
Jan  1 00:11:31 Pineapple kern.info kernel: [  691.630000] usb 1-1: generic converter now attached to ttyUSB2
Jan  1 00:11:31 Pineapple kern.info kernel: [  691.640000] scsi32 : usb-storage 1-1:1.3
Jan  1 00:11:31 Pineapple kern.info kernel: [  691.650000] scsi33 : usb-storage 1-1:1.4
Jan  1 00:11:31 Pineapple syslog.notice usb_modeswitch: switched to 12d1:1c05 on 001/026
Jan  1 00:11:31 Pineapple user.notice usb-modeswitch: 1-1:1.1: Manufacturer=HUAWEI Product=HUAWEI_Mobile Serial=?
Jan  1 00:11:32 Pineapple user.notice root: 3G: Connection Script here, searching for modems
Jan  1 00:11:32 Pineapple user.notice usb-modeswitch: 1-1:1.0: Manufacturer=HUAWEI Product=HUAWEI_Mobile Serial=?
Jan  1 00:11:32 Pineapple user.notice 3g-hotplug: Starting interface wan2 for device ttyUSB0
Jan  1 00:11:32 Pineapple user.notice usb-modeswitch: 1-1:1.1: Manufacturer=HUAWEI Product=HUAWEI_Mobile Serial=?
Jan  1 00:11:33 Pineapple user.notice usb-modeswitch: 1-1:1.2: Manufacturer=HUAWEI Product=HUAWEI_Mobile Serial=?
Jan  1 00:11:33 Pineapple user.notice usb-modeswitch: 1-1:1.3: Manufacturer=HUAWEI Product=HUAWEI_Mobile Serial=?
Jan  1 00:11:34 Pineapple user.notice usb-modeswitch: 1-1:1.4: Manufacturer=HUAWEI Product=HUAWEI_Mobile Serial=?
Jan  1 00:11:34 Pineapple kern.notice kernel: [  694.180000] scsi 32:0:0:0: CD-ROM            HUAWEI   Mass Storage     2.31 PQ: 0 ANSI: 2
Jan  1 00:11:34 Pineapple kern.notice kernel: [  694.190000] scsi 32:0:0:0: Attached scsi generic sg0 type 5
Jan  1 00:11:34 Pineapple kern.notice kernel: [  694.200000] scsi 33:0:0:0: Direct-Access     HUAWEI   SD Storage       2.31 PQ: 0 ANSI: 2
Jan  1 00:11:34 Pineapple kern.notice kernel: [  694.200000] sd 33:0:0:0: Attached scsi generic sg1 type 0
Jan  1 00:11:34 Pineapple kern.notice kernel: [  694.220000] sd 33:0:0:0: [sda] Attached SCSI removable disk
Jan  1 00:11:36 Pineapple daemon.notice pppd[4629]: pppd 2.4.5 started by root, uid 0
Jan  1 00:11:37 Pineapple local2.info chat[4634]: abort on (BUSY)
Jan  1 00:11:37 Pineapple local2.info chat[4634]: abort on (NO CARRIER)
Jan  1 00:11:37 Pineapple local2.info chat[4634]: abort on (ERROR)
Jan  1 00:11:37 Pineapple local2.info chat[4634]: report (CONNECT)
Jan  1 00:11:37 Pineapple local2.info chat[4634]: timeout set to 10 seconds
Jan  1 00:11:37 Pineapple local2.info chat[4634]: send (AT&amp;F^M)
Jan  1 00:11:37 Pineapple local2.info chat[4634]: expect (OK)
Jan  1 00:11:39 Pineapple local2.info chat[4634]: ^M
Jan  1 00:11:39 Pineapple local2.info chat[4634]: ^STIN: 0, 0, 0^M
Jan  1 00:11:39 Pineapple local2.info chat[4634]: AT&amp;F^M^M
Jan  1 00:11:39 Pineapple local2.info chat[4634]: OK
Jan  1 00:11:39 Pineapple local2.info chat[4634]:  -- got it
Jan  1 00:11:39 Pineapple local2.info chat[4634]: send (ATE1^M)
Jan  1 00:11:39 Pineapple local2.info chat[4634]: expect (OK)
Jan  1 00:11:39 Pineapple local2.info chat[4634]: ^M
Jan  1 00:11:39 Pineapple local2.info chat[4634]: ATE1^M^M
Jan  1 00:11:39 Pineapple local2.info chat[4634]: OK
Jan  1 00:11:39 Pineapple local2.info chat[4634]:  -- got it
Jan  1 00:11:39 Pineapple local2.info chat[4634]: send (AT+CGDCONT=1,"IP","internet.movistar.com.co"^M)
Jan  1 00:11:39 Pineapple local2.info chat[4634]: timeout set to 30 seconds
Jan  1 00:11:39 Pineapple local2.info chat[4634]: expect (OK)
Jan  1 00:11:39 Pineapple local2.info chat[4634]: ^M
Jan  1 00:11:39 Pineapple local2.info chat[4634]: AT+CGDCONT=1,"IP","i^M
Jan  1 00:11:39 Pineapple local2.info chat[4634]: ^STIN: 99, 0, 0^M
Jan  1 00:11:40 Pineapple local2.info chat[4634]: nternet.movistar.com.co"^M^M
Jan  1 00:11:40 Pineapple local2.info chat[4634]: OK
Jan  1 00:11:40 Pineapple local2.info chat[4634]:  -- got it
Jan  1 00:11:40 Pineapple local2.info chat[4634]: send (ATD*99***1#^M)
Jan  1 00:11:40 Pineapple local2.info chat[4634]: expect (CONNECT)
Jan  1 00:11:40 Pineapple local2.info chat[4634]: ^M
Jan  1 00:11:40 Pineapple local2.info chat[4634]: ATD*99***1#^M^M
Jan  1 00:11:40 Pineapple local2.info chat[4634]: CONNECT
Jan  1 00:11:40 Pineapple local2.info chat[4634]:  -- got it
Jan  1 00:11:40 Pineapple local2.info chat[4634]: send ( ^M)
Jan  1 00:11:40 Pineapple daemon.info pppd[4629]: Serial connection established.
Jan  1 00:11:40 Pineapple daemon.info pppd[4629]: Using interface 3g-wan2
Jan  1 00:11:40 Pineapple daemon.notice pppd[4629]: Connect: 3g-wan2 &lt;--&gt; /dev/ttyUSB0
Jan  1 00:11:41 Pineapple daemon.info pppd[4629]: CHAP authentication succeeded: Welcome!!
Jan  1 00:11:41 Pineapple daemon.notice pppd[4629]: CHAP authentication succeeded
Jan  1 00:11:44 Pineapple kern.info kernel: [  704.920000] usb 1-1: USB disconnect, device number 27
Jan  1 00:11:44 Pineapple daemon.info pppd[4629]: Hangup (SIGHUP)
Jan  1 00:11:44 Pineapple daemon.notice pppd[4629]: Modem hangup
Jan  1 00:11:44 Pineapple daemon.notice pppd[4629]: Connection terminated.
Jan  1 00:11:45 Pineapple kern.info kernel: [  704.920000] generic ttyUSB0: generic converter now disconnected from ttyUSB0
Jan  1 00:11:45 Pineapple kern.info kernel: [  704.930000] usbserial_generic 1-1:1.0: device disconnected
Jan  1 00:11:45 Pineapple kern.info kernel: [  704.940000] generic ttyUSB1: generic converter now disconnected from ttyUSB1
Jan  1 00:11:45 Pineapple kern.info kernel: [  704.940000] usbserial_generic 1-1:1.1: device disconnected
Jan  1 00:11:45 Pineapple kern.info kernel: [  704.950000] generic ttyUSB2: generic converter now disconnected from ttyUSB2
Jan  1 00:11:45 Pineapple kern.info kernel: [  704.950000] usbserial_generic 1-1:1.2: device disconnected
Jan  1 00:11:45 Pineapple user.notice 3g-hotplug: Stopping interface wan2 for device ttyUSB0
Jan  1 00:11:45 Pineapple daemon.info pppd[4629]: Terminating on signal 15
Jan  1 00:11:45 Pineapple daemon.info pppd[4629]: Exit.
Jan  1 00:11:45 Pineapple kern.info kernel: [  705.270000] usb 1-1: new high-speed USB device number 28 using ath79-ehci
Jan  1 00:11:45 Pineapple kern.err kernel: [  705.430000] hub 1-0:1.0: unable to enumerate USB device on port 1
Jan  1 00:11:53 Pineapple user.notice root: 3G: firewall stopped

Has anyone had this problem?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...