Dennis Wood
Senior Member
Setup for APC UPS where QNAP box is MASTER, Pfsense box is SLAVE.
Just posting this for reference. If you are using for example a Pfsense based router, QNAP NAS, and an APC UPS, then you can take advantage of QNAP's UPS "server" to signal a router shutdown in case of power failure. You normally can only plug one device into a USB signaling UPS, so the ability for one device to act as a UPS server is very useful. QNAP uses the NUT package to manage UPS which means you can interface with it from Linux, Windows etc. QNAP in this case is running QTS 4.1, and Pfsense 2.3
Here's how you do it:
1. Make sure your NAS, network switch, router etc. are connected to the UPS(s) you want to control. If power goes out and the switch immediately powers off, the process below won't work!
1. Make sure your NAS is connected to the APC UPS using USB cable. On the NAS, enable UPS server (System Settings -> External Device -> UPS), and add the IP address of your router, or workstation that you want to signal. You can use this same function to signal other NAS units as well..just add them to the IP list. If all is working, the UPS model and battery capacity should appear in the NAS GUI.
2. In my example, Pfsense, download and install NUT using the Pfsense package manager. Under Pfsense services, fire up NUT and click the setup tab. Make sure NUT is set under "UPS Monitoring" to "Remote Nut UPS". At the bottom of the NUT settings page, in the "Remote Nut UPS Settings" area, enter the following:
Remote Nut UPS Name: qnapups (this is the trick...don't change this name!)
Remote NUT UPS Address: Your_NAS_IP_Address
Remote NUT UPS User: Your_NAS_admin_userID
Remote NUT UPS Password: Your_NAS_admin_password
From the pfsense dashboard, start the NUT service. That's it. The NUT status page should now display the UPS information provided by the QNAP NAS...and can respond to orderly shutdown requests in case of power outages.
Setup for Pfsense as MASTER, and QNAP UPS as SLAVE:
If you want to use the pfsense box as MASTER, and QNAP UPS as slave, this is how you do it:
Again, for reference, if you want the the pfsense box to be plugged into the UPS, and use the pfsense box as a master (so APC USB cable is attached to pfsense), to shutdown QNAP UPS or others, then here is process.
1. Download and install NUT on pfsense using the package manager. Plug the APC USB cable into your pfsense router box. Configure NUT for your local UPS, and make sure it is working.
Under NUT's "Local UPS settings":
Local UPS Name: qnapups (this is important!)
Local UPS Model: APC Back-UPS ES USB (for my UPS)
Local UPS Port: auto (USB only) (for my UPS)
Don't bother with the Remote Access settings as they don't matter.
You must set up a NAT rule to allow remote access to NUT on your pfsense box, even from your local network. Under Firewall - NAT, add a rule like this:
If: LAN
Proto: TCP
Scr. addr/Ports: * / *
Dest Addr/Ports: 192.168.2.1/3493 (change to match your LAN IP)
NAT IP/Ports: 127.0.0.1/3493
Now set your QNAP UPS to "Network UPS Slave" mode and you should see the UPS information/runtime etc.
Cheers,
Dennis.
Just posting this for reference. If you are using for example a Pfsense based router, QNAP NAS, and an APC UPS, then you can take advantage of QNAP's UPS "server" to signal a router shutdown in case of power failure. You normally can only plug one device into a USB signaling UPS, so the ability for one device to act as a UPS server is very useful. QNAP uses the NUT package to manage UPS which means you can interface with it from Linux, Windows etc. QNAP in this case is running QTS 4.1, and Pfsense 2.3
Here's how you do it:
1. Make sure your NAS, network switch, router etc. are connected to the UPS(s) you want to control. If power goes out and the switch immediately powers off, the process below won't work!
1. Make sure your NAS is connected to the APC UPS using USB cable. On the NAS, enable UPS server (System Settings -> External Device -> UPS), and add the IP address of your router, or workstation that you want to signal. You can use this same function to signal other NAS units as well..just add them to the IP list. If all is working, the UPS model and battery capacity should appear in the NAS GUI.
2. In my example, Pfsense, download and install NUT using the Pfsense package manager. Under Pfsense services, fire up NUT and click the setup tab. Make sure NUT is set under "UPS Monitoring" to "Remote Nut UPS". At the bottom of the NUT settings page, in the "Remote Nut UPS Settings" area, enter the following:
Remote Nut UPS Name: qnapups (this is the trick...don't change this name!)
Remote NUT UPS Address: Your_NAS_IP_Address
Remote NUT UPS User: Your_NAS_admin_userID
Remote NUT UPS Password: Your_NAS_admin_password
From the pfsense dashboard, start the NUT service. That's it. The NUT status page should now display the UPS information provided by the QNAP NAS...and can respond to orderly shutdown requests in case of power outages.
Setup for Pfsense as MASTER, and QNAP UPS as SLAVE:
If you want to use the pfsense box as MASTER, and QNAP UPS as slave, this is how you do it:
Again, for reference, if you want the the pfsense box to be plugged into the UPS, and use the pfsense box as a master (so APC USB cable is attached to pfsense), to shutdown QNAP UPS or others, then here is process.
1. Download and install NUT on pfsense using the package manager. Plug the APC USB cable into your pfsense router box. Configure NUT for your local UPS, and make sure it is working.
Under NUT's "Local UPS settings":
Local UPS Name: qnapups (this is important!)
Local UPS Model: APC Back-UPS ES USB (for my UPS)
Local UPS Port: auto (USB only) (for my UPS)
Don't bother with the Remote Access settings as they don't matter.
You must set up a NAT rule to allow remote access to NUT on your pfsense box, even from your local network. Under Firewall - NAT, add a rule like this:
If: LAN
Proto: TCP
Scr. addr/Ports: * / *
Dest Addr/Ports: 192.168.2.1/3493 (change to match your LAN IP)
NAT IP/Ports: 127.0.0.1/3493
Now set your QNAP UPS to "Network UPS Slave" mode and you should see the UPS information/runtime etc.
Cheers,
Dennis.
Last edited: