Navigation

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

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

    General pfSense Questions
    2
    5
    755
    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
      • jimp
        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

        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
            • jimp
              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.

              1 Reply Last reply Reply Quote 0
              • First post
                Last post

              Products

              • Platform Overview
              • TNSR
              • pfSense Plus
              • Appliances

              Services

              • Training
              • Professional Services

              Support

              • Subscription Plans
              • Contact Support
              • Product Lifecycle
              • Documentation

              News

              • Media Coverage
              • Press
              • Events

              Resources

              • Blog
              • FAQ
              • Find a Partner
              • Resource Library
              • Security Information

              Company

              • About Us
              • Careers
              • Partners
              • Contact Us
              • Legal
              Our Mission

              We provide leading-edge network security at a fair price - regardless of organizational size or network sophistication. We believe that an open-source security model offers disruptive pricing along with the agility required to quickly address emerging threats.

              Subscribe to our Newsletter

              Product information, software announcements, and special offers. See our newsletter archive to sign up for future newsletters and to read past announcements.

              © 2021 Rubicon Communications, LLC | Privacy Policy