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

Restart pfsense remotely? from anther machine

Scheduled Pinned Locked Moved Hardware
16 Posts 9 Posters 4.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.
  • A
    automate
    last edited by Jul 5, 2019, 11:32 PM

    OK, sounds like I need to do the SSH key

    Because sometimes the wan interface fails to get an IP from the modem so i need a restart

    1 Reply Last reply Reply Quote 0
    • A
      akuma1x
      last edited by akuma1x Jul 6, 2019, 1:58 AM Jul 6, 2019, 1:57 AM

      I’m thinking if your WAN interface isn’t getting an IP address, you’re not going to be able to get in remotely to do a reboot... am I right?

      Jeff

      1 Reply Last reply Reply Quote 0
      • S
        swarm
        last edited by Jul 6, 2019, 2:47 AM

        Really hacky but theoretically you could write a script and run it as a cron job every 10 seconds or something that checks if the WAN has an IP or not and either restarts the DHCP service or just reboots the system (YOLO)

        1 Reply Last reply Reply Quote 0
        • A
          automate
          last edited by Jul 6, 2019, 3:56 AM

          Its run from the LAN side, not the WAN side.

          S 1 Reply Last reply Jul 6, 2019, 4:54 AM Reply Quote 0
          • S
            swarm @automate
            last edited by Jul 6, 2019, 4:54 AM

            @automate Alright so if you're in range of the pfSense then you can setup an AP on the LAN side. Or just physically connected a cable via switch or direct LAN port.

            1 Reply Last reply Reply Quote 0
            • S
              stephenw10 Netgate Administrator
              last edited by Jul 6, 2019, 12:52 PM

              Really you should not be doing that. It shouldn't fail to get an IP via DHCP but even if it does you should not need to reboot to get one. Re-running the dhcp client or down/up-ing the interface should brinh it back.

              Some tests you can do there are to just unplug and replig the WAN cable, does that allow it to pull an IP?

              Or reboot the modem, does that correct it.

              What error logs do you see? What does the WAN interface look like in ifconfig when it fails.

              Steve

              1 Reply Last reply Reply Quote 0
              • G
                gcu_greyarea
                last edited by Jul 6, 2019, 11:48 PM

                I would also investigate the root cause of the problem (DHCP) instead of the reboot workaround.
                Previously i also had a problem with DHCP as i would randomly not receive an IP from my ISP (via cable modem).
                I phoned my ISP and he disabled CG-NAT ( carrier grade NAT ). Not sure how & why, but DHCP worked fine after that....

                1 Reply Last reply Reply Quote 0
                • A
                  automate
                  last edited by Jul 7, 2019, 12:11 AM

                  Im happy to down the WAN/restart dhcp but it needs to be via command line , the intention is to link the command into a home automation system so the user (non technical) can press a button in the UI to restart the box, or dhcp

                  J 1 Reply Last reply Jul 7, 2019, 1:30 AM Reply Quote 0
                  • J
                    jahonix @automate
                    last edited by Jul 7, 2019, 1:30 AM

                    @automate said in Restart pfsense remotely? from anther machine:

                    command into a home automation system

                    Which HA system do you use?
                    You're ACE/CAIP/CSP/EQIP?

                    1 Reply Last reply Reply Quote 0
                    • A
                      automate
                      last edited by Jul 7, 2019, 8:40 AM

                      OpenHab for this project

                      1 Reply Last reply Reply Quote 0
                      • A
                        automate
                        last edited by Jul 11, 2019, 5:46 AM

                        Any ideas guys??

                        1 Reply Last reply Reply Quote 0
                        • T
                          tomashk
                          last edited by Jul 11, 2019, 6:28 AM

                          Maybe check this script. I'm not sure if this will work for you, but it might give you some ideas for solution.
                          https://forum.netgate.com/topic/127403/auto-renew-dhcp-after-outage/23

                          A 1 Reply Last reply Jul 11, 2019, 11:20 PM Reply Quote 0
                          • A
                            automate @tomashk
                            last edited by Jul 11, 2019, 11:20 PM

                            @tomashk fantastic! i think this will do it.

                            Ive installed it so ill see how that goes, appreciated.

                            1 Reply Last reply Reply Quote 0
                            • N
                              NollipfSense
                              last edited by Jul 14, 2019, 3:20 PM

                              You could use this: https://www.ebay.com/itm/MSNSwitch-Internet-Enabled-IP-Remote-Power-Switch-with-Reboot/392301437447?ssPageName=STRK%3AMEBIDX%3AIT&_trksid=p2060353.m1438.l2649

                              pfSense+ 23.09 Lenovo Thinkcentre M93P SFF Quadcore i7 dual Raid-ZFS 128GB-SSD 32GB-RAM PCI-Intel i350-t4 NIC, -Intel QAT 8950.
                              pfSense+ 23.09 VM-Proxmox, Dell Precision Xeon-W2155 Nvme 500GB-ZFS 128GB-RAM PCIe-Intel i350-t4, Intel QAT-8950, P-cloud.

                              1 Reply Last reply Reply Quote 0
                              12 out of 16
                              • First post
                                12/16
                                Last post
                              Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
                                This community forum collects and processes your personal information.
                                consent.not_received