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

    How to bring interface up from pfsense commandline?

    Scheduled Pinned Locked Moved General pfSense Questions
    7 Posts 5 Posters 26.2k 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.
    • G
      GrandmasterB
      last edited by

      Hi all,

      I think i have a simple question.
      How can I bring up an interface from the pfsense commandline?

      I tried:

      [2.0.1-RELEASE][root@firewall]/(74): php ./status_interfaces.php?action=Connect&if=opt1
      

      But that doesn't work.
      Who can help me?

      thanks,
      Bas

      1 Reply Last reply Reply Quote 0
      • W
        wallabybob
        last edited by

        Why?

        If the interface has already been enabled in the web GUI it should come "up" automatically if it sees carrier from the interface on the other end of the cable. Maybe you have  a cable fault.

        1 Reply Last reply Reply Quote 0
        • G
          GrandmasterB
          last edited by

          @wallabybob:

          Why?

          If the interface has already been enabled in the web GUI it should come "up" automatically if it sees carrier from the interface on the other end of the cable. Maybe you have  a cable fault.

          It's for my UMTS 3G modem. Once in a while it disconnects itself, and pfsense is not able to bring it up again.
          If i then disconnect and connect again, the ppp-connection is up again.

          and i want to automate that via the command interface (cron-job or so)

          1 Reply Last reply Reply Quote 0
          • W
            wallabybob
            last edited by

            @GrandmasterB:

            It's for my UMTS 3G modem. Once in a while it disconnects itself, and pfsense is not able to bring it up again.

            You mean pfSense doesn't automatically recover? Have you tried the Disconnect and Reconnect buttons in the appropriate interface section of the Status -> Interfaces page?

            @GrandmasterB:

            If i then disconnect and connect again, the ppp-connection is up again.

            By "disconnect and connect again" do you mean "remove the modem from USB connector and reinsert"? If not, what do you mean?

            @GrandmasterB:

            and i want to automate that via the command interface (cron-job or so)

            You'll run a crob job every few minutes to stop/start ppp on the modem?

            1 Reply Last reply Reply Quote 0
            • R
              ramaramadingding
              last edited by

              maybe you could try some command like this in your crontab file:
              /sbin/ifconfig ppp0 | /usr/bin/egrep '10.[12].*' || /sbin/ifconfig ppp0 up >/dev/null 2>&1

              ramaramadingding

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

                I don't think it will work using ifconfig directly.
                Try using:

                /etc/rc.linkup opt1 start
                

                Steve

                1 Reply Last reply Reply Quote 0
                • E
                  esq
                  last edited by

                  I have modified Steve's solution as follows and it works on [2.2.2-RELEASE]:

                  /etc/rc.linkup interface=opt1 action=start
                  

                  Matt

                  1 Reply Last reply Reply Quote 2
                  • J jdh referenced this topic on
                  • First post
                    Last post
                  Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.