• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login
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 Dec 27, 2011, 7:40 PM

    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 Dec 27, 2011, 10:12 PM

      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 Dec 27, 2011, 10:43 PM

        @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 Dec 27, 2011, 11:17 PM

          @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 May 20, 2012, 1:41 AM

            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
            • S
              stephenw10 Netgate Administrator
              last edited by May 20, 2012, 12:11 PM

              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 Jun 13, 2015, 9:35 AM

                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 Jan 4, 2022, 1:12 PM
                • First post
                  Last post
                Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
                  This community forum collects and processes your personal information.
                  consent.not_received