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

    Run Script on Interface Status Change (to re-enable 3g usb modem)

    General pfSense Questions
    2
    5
    1.1k
    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.
    • K
      kujina
      last edited by

      Hello I have a Huawei E367 3G Dongle and it regularly drops out (showing a red X in the Interfaces box in the dashboard) unplugging it and plugging it back in fixes it.

      But I did just learn how to power the 3G dongle off and then on with usbconfig -u 4 -a 2 power_off and usbconfig -u 4 -a 2 power_on which gets this connection up and working again!

      What I'd like to do is to automate this usbconfig command with a script, that will run when this interface goes down to get it working again, I'm not familiar with freebsd and so would really appreciate some help.

      Thanks.

      1 Reply Last reply Reply Quote 0
      • jimpJ
        jimp Rebel Alliance Developer Netgate
        last edited by

        There's no quick/easy way to trigger that without explaining a lot (either devd or scripting it in PHP) – you could probably drop some commands in /etc/rc.newwanip to make that happen but you'd need to be sure it only happens when that is triggered by the 3g interface

        Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

        Need help fast? Netgate Global Support!

        Do not Chat/PM for help!

        1 Reply Last reply Reply Quote 0
        • K
          kujina
          last edited by

          @jimp:

          There's no quick/easy way to trigger that without explaining a lot (either devd or scripting it in PHP) – you could probably drop some commands in /etc/rc.newwanip to make that happen but you'd need to be sure it only happens when that is triggered by the 3g interface

          Hi Jimp, I appreciate the response. What is devd? Have you seen a script written for this purpose that I could adapt or get adapted?

          …Thanks...

          1 Reply Last reply Reply Quote 0
          • K
            kujina
            last edited by

            @jimp:

            There's no quick/easy way to trigger that without explaining a lot (either devd or scripting it in PHP) – you could probably drop some commands in /etc/rc.newwanip to make that happen but you'd need to be sure it only happens when that is triggered by the 3g interface

            If I was to use Embedded (NanoBSD) could I still use devd or scripting it in PHP?

            1 Reply Last reply Reply Quote 0
            • jimpJ
              jimp Rebel Alliance Developer Netgate
              last edited by

              Yes, the same mechanisms work on NanoBSD and a full install, the only difference is that if you edit files on the NanoBSD filesystem you have to flip it to Read/Write mode first.

              Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

              Need help fast? Netgate Global Support!

              Do not Chat/PM for help!

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