Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Scripting the behaviour of Status --> Interfaces --> DHCP renew button

    Scheduled Pinned Locked Moved General pfSense Questions
    42 Posts 4 Posters 6.7k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • stephenw10S
      stephenw10 Netgate Administrator
      last edited by

      @jly2680 said in Scripting the behaviour of Status --> Interfaces --> DHCP renew button:

      But when I load Freebsd 10.3 also on vmware,,no ncm and ue0 int showed,,

      That doesn't bode well. It's probably just not supported there then.

      You can use kldstat to see what kernel modules are being used.

      Steve

      1 Reply Last reply Reply Quote 0
      • B
        bradtpt @jly2680
        last edited by bradtpt

        @jly2680 said in Scripting the behaviour of Status --> Interfaces --> DHCP renew button:

        i got my e3372 and switch its firmware to stick mode..but my pfsense is based on 2.3.5 running on alix 2d13..I check the dmesg when I put my modem:

        ugen1.2: <HUAWEIMOBILE> at usbus1 (disconnected)
        u3g0: at uhub1, port 1, addr 2 (disconnected)
        ugen1.2: <HUAWEIMOBILE> at usbus1
        u3g0: <HUAWEIMOBILE HUAWEIMOBILE, class 0/0, rev 2.10/1.02, addr 2> on usbus1
        u3g0: Found 2 ports.
        
        
        
        

        no ue0 device at /dev .. doesnt show the NCM interface..Can I load the NCM driver using 2.3.5??

        Yes you can, you need to use the setport command from the AT command set for the modem to enable the NCM interface. I have another post with some details thrown in contained here: https://forum.netgate.com/topic/137637/huawei-e3372-will-not-reconnect-ppp-after-manual-disconnect-under-status-interfaces

        In summary what you need to do is jump into the console and talk directly to the modem via the emulated serial port by running: cu -l /dev/cuaU0.0 or cu -l /dev/cuaU0.1 depending on which port it created and wants to talk on. Once in there run the command AT^SETPORT="FF;10,12,16" and then AT^RESET to reboot the stick. After having done this once, from herein the stick should present the NCM interface which is defined by the 16 in the command above.

        PS - I can confirm this works on 2.3.x as I had a client on that version a while ago and utilized ones of these.

        J 1 Reply Last reply Reply Quote 1
        • stephenw10S
          stephenw10 Netgate Administrator
          last edited by

          Nice!

          1 Reply Last reply Reply Quote 0
          • J
            jly2680 @bradtpt
            last edited by

            @bradtpt said in Scripting the behaviour of Status --> Interfaces --> DHCP renew button:

            @jly2680 said in Scripting the behaviour of Status --> Interfaces --> DHCP renew button:

            i got my e3372 and switch its firmware to stick mode..but my pfsense is based on 2.3.5 running on alix 2d13..I check the dmesg when I put my modem:

            ugen1.2: <HUAWEIMOBILE> at usbus1 (disconnected)
            u3g0: at uhub1, port 1, addr 2 (disconnected)
            ugen1.2: <HUAWEIMOBILE> at usbus1
            u3g0: <HUAWEIMOBILE HUAWEIMOBILE, class 0/0, rev 2.10/1.02, addr 2> on usbus1
            u3g0: Found 2 ports.
            
            
            
            

            no ue0 device at /dev .. doesnt show the NCM interface..Can I load the NCM driver using 2.3.5??

            Yes you can, you need to use the setport command from the AT command set for the modem to enable the NCM interface. I have another post with some details thrown in contained here: https://forum.netgate.com/topic/137637/huawei-e3372-will-not-reconnect-ppp-after-manual-disconnect-under-status-interfaces

            In summary what you need to do is jump into the console and talk directly to the modem via the emulated serial port by running: cu -l /dev/cuaU0.0 or cu -l /dev/cuaU0.1 depending on which port it created and wants to talk on. Once in there run the command AT^SETPORT="FF;10,12,16" and then AT^RESET to reboot the stick. After having done this once, from herein the stick should present the NCM interface which is defined by the 16 in the command above.

            PS - I can confirm this works on 2.3.x as I had a client on that version a while ago and utilized ones of these.

            [2.3.5-RELEASE][root@pfSense.local]/root: cu -l /dev/cuaU0.0
            Connected
            
            Manufacturer: huawei
            Model: E3372
            Revision: 21.200.07.00.805
            IMEI: 866785033259671
            +GCAP: +CGSM,+DS,+ES
            
            OK
            
            OK
            
            OK
            ugen1.2: <HUAWEIMOBILE> at usbus1 (disconnected)
            u3g0: at uhub1, port 1, addr 2 (disconnected)
            [2.3.5-RELEASE][root@pfSense.local]/root: ugen1.2: <HUAWEIMOBILE> at usbus1
            u3g0: <HUAWEIMOBILE HUAWEIMOBILE, class 0/0, rev 2.10/1.02, addr 2> on usbus1
            u3g0: Found 2 ports.
            
            
            

            Same no ncm interface after issuing these commands..

            1 Reply Last reply Reply Quote 0
            • B
              bradtpt
              last edited by

              Ok can you show me the output of the following:

              cu -l /dev/cuaU0.0
              AT^SETPORT=?
              AT^SETPORT?

              Unfortunately I don't have one with me to check the config directly, however have you modeswitched the device out of mass storage mode? If not, you'll need to download and install usbmodeswitch by running this (from memory 2.3.x is on FreeBSD10 so this should be the correct version):
              pkg add http://pkg.freebsd.org/FreeBSD:10:amd64/release_4/All/usb_modeswitch-2.5.0.txz
              and then running this:
              /usr/local/sbin/usb_modeswitch -J -v0x12d1 -p0x1f01

              Running that will cause the device to drop out of mass storage mode and should present the interfaces. Let us know how you go. If I had a stick with me I'd go through the motions and post it up for you but unfortunately I can only go off some notes I have here from the last one I did quite a while back.

              J 1 Reply Last reply Reply Quote 0
              • J
                jly2680 @bradtpt
                last edited by jly2680

                [2.3.5-RELEASE][root@pfSense.local]/root: cu -l /dev/cuaU0.0
                Connected
                
                ERROR
                
                ^SETPORT:FF;10,12,16
                
                OK
                
                
                

                Issuing this AT^SETPORT=? command got an error answer from modem..here's the message after usbmodeswitch

                [2.3.5-RELEASE][root@pfSense.local]/root: usb_modeswitch -J -v0x12d1 -p0x1506   Look for default devices ...
                   product ID matched
                 Found devices in default mode (1)
                Access device 002 on bus 001
                Get the current device configuration ...
                Current configuration number is 1
                Use interface number 0
                 with class 255
                Error: can't use storage command in MessageContent with interface 0; interface class is 255, expected 8. Abort
                
                
                
                echo 'AT^NDISDUP=1,1,"jawalnet.com.sa"' > /dev/cuaU0.1
                
                

                this modem command gave me a solid blue light on the modem,,but no ue0 or cde interface showed up..

                1 Reply Last reply Reply Quote 0
                • B
                  bradtpt
                  last edited by

                  The error from usbmodeswitch makes sense now I think about it, you have the stick firmware loaded so as such the device when inserted won't present as a mass storage device. I have an e3372 with the stick firmware loaded at work, if I get a chance tomorrow I'll fire up a machine with 2.3.5 and see if I can make it work. As I'm not familiar with your Alix hardware the closest I can go to replicating your environment would be to install an archived version of pfSense-CE-memstick-2.3.3-RELEASE-amd64.img I have here on an amd machine. Is your alix similar or a totally different platform?

                  J 1 Reply Last reply Reply Quote 0
                  • J
                    jly2680 @bradtpt
                    last edited by

                    @bradtpt said in Scripting the behaviour of Status --> Interfaces --> DHCP renew button:

                    The error from usbmodeswitch makes sense now I think about it, you have the stick firmware loaded so as such the device when inserted won't present as a mass storage device. I have an e3372 with the stick firmware loaded at work, if I get a chance tomorrow I'll fire up a machine with 2.3.5 and see if I can make it work. As I'm not familiar with your Alix hardware the closest I can go to replicating your environment would be to install an archived version of pfSense-CE-memstick-2.3.3-RELEASE-amd64.img I have here on an amd machine. Is your alix similar or a totally different platform?

                    Oh thanks..its an old alix 2d13 i386..I think 2.3.5 doesnt work with 3372 in stick mode

                    1 Reply Last reply Reply Quote 0
                    • B
                      bradtpt
                      last edited by bradtpt

                      Ahh ok, unfortunately netgate don't leave old versions online, I'll have to go digging and see if I can find a i386 installer kicking around somewhere. If you have a link or can dropbox it to me or similar let me know.
                      -edit- I just found this: https://mirrors.xmission.com/pfsense/downloads/pfSense-CE-2.3.5-RELEASE-i386.iso.gz and this: https://mirrors.xmission.com/pfsense/downloads/pfSense-CE-memstick-2.3.5-RELEASE-i386.img.gz so it looks like we're in luck.

                      1 Reply Last reply Reply Quote 0
                      • stephenw10S
                        stephenw10 Netgate Administrator
                        last edited by

                        I would be surprised if there's any difference between the 32bit and 64bit versions as far as this modem is concerned. The available tools should be identical.

                        Steve

                        J 1 Reply Last reply Reply Quote 0
                        • J
                          jly2680 @stephenw10
                          last edited by stephenw10

                          @stephenw10 said in Scripting the behaviour of Status --> Interfaces --> DHCP renew button:

                          I would be surprised if there's any difference between the 32bit and 64bit versions as far as this modem is concerned. The available tools should be identical.

                          Steve

                          I test this modem through vm pfsense 2.4 , ue0 and cdc showed up..I wonder if there is any new patch from 2.4 if_cdce.ko that was not included in 2.3.5

                          can you look at this: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=192345

                          1 Reply Last reply Reply Quote 0
                          • stephenw10S
                            stephenw10 Netgate Administrator
                            last edited by

                            There are many, many differences between FreeBSD 10.3 and 11.1 which is what you're comparing there.

                            That link is broken.

                            Steve

                            J 1 Reply Last reply Reply Quote 0
                            • J
                              jly2680 @stephenw10
                              last edited by

                              @stephenw10 said in Scripting the behaviour of Status --> Interfaces --> DHCP renew button:

                              There are many, many differences between FreeBSD 10.3 and 11.1 which is what you're comparing there.

                              That link is broken.

                              Steve

                              the patch includes

                              head/sys/dev/usb/net/if_cdce.c
                              head/sys/dev/usb/serial/u3g.c
                              head/sys/dev/usb/serial/umodem.c
                              

                              hope someone could port this patch on 2.3.5

                              1 Reply Last reply Reply Quote 0
                              • stephenw10S
                                stephenw10 Netgate Administrator
                                last edited by

                                Your link was actually good, the bug server was down at that exact moment I tested.

                                Porting that is non trivial. You would have to rebuild a whole number of things there. You cannot just load a replacement module. And even after you had done that you would still be running unsupported, unpatched, 2.3.5.

                                Is there some reason you cannot just replace that ALIX with something vaguely current?

                                Steve

                                J 1 Reply Last reply Reply Quote 0
                                • J
                                  jly2680 @stephenw10
                                  last edited by jly2680

                                  @stephenw10 said in Scripting the behaviour of Status --> Interfaces --> DHCP renew button:

                                  Your link was actually good, the bug server was down at that exact moment I tested.

                                  Porting that is non trivial. You would have to rebuild a whole number of things there. You cannot just load a replacement module. And even after you had done that you would still be running unsupported, unpatched, 2.3.5.

                                  Is there some reason you cannot just replace that ALIX with something vaguely current?

                                  Steve

                                  This alix will be deployed on our client’s remote area maybe this end of the month.I’ll convince him if he can rather buy a new hardware..I may use openwrt with this 4g stick if he refuse to shell out some $

                                  1 Reply Last reply Reply Quote 0
                                  • stephenw10S
                                    stephenw10 Netgate Administrator
                                    last edited by

                                    If you need to use the ALIX that is what I would do. At least you can have a current build on there that will be relatively secure.

                                    Steve

                                    J 1 Reply Last reply Reply Quote 0
                                    • J
                                      jly2680 @stephenw10
                                      last edited by jly2680

                                      @stephenw10 said in Scripting the behaviour of Status --> Interfaces --> DHCP renew button:

                                      If you need to use the ALIX that is what I would do. At least you can have a current build on there that will be relatively secure.

                                      Steve

                                      hmm can you please look at this,,upon setting this modem AT^SETPORT="FF;16,12,10" suddenly I have this in my log:

                                      ugen1.2: <HUAWEIMOBILE> at usbus1
                                      u3g0: <NCM Network Control Model> on usbus1
                                      u3g0: Found 2 ports.
                                      
                                      

                                      previously I dont have this log when I set this AT^SETPORT="FF;10,12,16" on my modem..But still no ue0 interface![alt text]

                                      on my vm pf 2.4.4 :
                                      Untitled.png

                                      1 Reply Last reply Reply Quote 0
                                      • stephenw10S
                                        stephenw10 Netgate Administrator
                                        last edited by

                                        You probably still need the newer cdce driver.

                                        Steve

                                        J 1 Reply Last reply Reply Quote 0
                                        • J
                                          jly2680 @stephenw10
                                          last edited by

                                          @stephenw10
                                          I compare 2.3.5 dev.d/usb.conf from 2.4.4 , my modem intsubclass and intproto is included on 2.4.4 usb conf and missing on 2.3.5 ..can I add this on my 2.3.5 usbconf??

                                          nomatch 32 {
                                          	match "bus" "uhub[0-9]+";
                                          	match "mode" "host";
                                          	match "vendor" "0x12d1";
                                          	match "intclass" "0xff";
                                          	match "intsubclass" "0x03";
                                          	match "intprotocol" "0x16";
                                          	action "kldload -n if_cdce";
                                          
                                          1 Reply Last reply Reply Quote 0
                                          • stephenw10S
                                            stephenw10 Netgate Administrator
                                            last edited by

                                            As a test I can't see why not. I've never tried that myself though...

                                            J 1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post
                                            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.