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

Add DHCp reservations by script

Scheduled Pinned Locked Moved DHCP and DNS
1 Posts 1 Posters 719 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.
  • O
    osja
    last edited by Jan 15, 2017, 4:47 PM

    Hello,

    I have a script for creating Linux containers. I want to make it add DHCP reservations to pfSense for the hostname and IP number that the new container is given. After a lot of searching on the Internet and reading documentation, I've realized there are multiple ways. I've come closest to my goal with the following method.

    Create new user with administrator privileges. Add user to wheel group. Let the script ssh onto the pfSense machine and modify the DHCP reservation part of config.xml. Restart the DHCP service using "pfSsh.php playback restartdhcpd". However, this gives an error message, saying no processes belonging to me were found.

    If I log in as root I get the menu, instead of a prompt. That is why I am using a different account. I was assuming when going through the pfSsh.php script it would only matter whether the user belonged to the admin group, but that is obviously not the case.

    I'm sure the bright people here have a suggestion for how to do what I'm looking for, possibly even in a completely different way. Suggestions are very welcome!

    While I'm posting, I'd also like to ask if changes to the home directories are volatile. I have put my public key on the pfSense box using the ssh-copy-id command, but after a reboot of my pfSense machine it has disappeared. Must keys be added through the web interface?

    Many thanks in advance!

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