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

    Adding a field to the WebGUI config screen

    Scheduled Pinned Locked Moved webGUI
    2 Posts 2 Posters 867 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.
    • R
      rjdza
      last edited by

      ISPs in South Africa provide static IP addresses using L2TP that is authenticated with a shared secret.  pfSense can not set the shared secret on the PPP interfaces add screen.

      pfSense uses MPD5 for L2TP, and MPD has supported shared secrets since 4.1.  It seems that simply adding a field to the config file will work.

      Is there an easy way for me to edit the webgui that manages the l2tp interface to add the field, get the secret to be stored in the xml file, and then fix the scripts that turns the xml into the config file?

      Alternately, would it not be best to add a generic section to the config section where you can add what additional parameters you want passed to mpd?

      Thanks in advance for the help, and a final note - ALL ISPs in South Africa do this for static IPs over DSL.  Every person who uses pfSense in South Africa is potentially affected by this problem.

      Regards,

      Jason

      1 Reply Last reply Reply Quote 0
      • P
        phil.davis
        last edited by

        The code for all that is just PHP. It is all in GitHub at https://github.com/pfsense/pfsense and in your pfSense box (Diagnostics->Edit File). Copy the relevant files, edit them, save them on a system you can play with, get it working…

        /usr/local/www/interfaces.php - has some stuff for entering directly PPTP/L2TP username password...
        /usr/local/www/interfaces_ppps_edit.php - entering username password... for L2TP on PPP (I think that is what you want)

        It sounds like you understand what is needed, so have a look at that code and you can add an extra field for the shared secret.

        Then look in
        /etc/inc/interfaces.inc function interface_ppps_configure($interface)

        That writes the config file/s for that stuff.

        Lines like:

        set auth authname "{$ppp['username']}"
        

        Put the parameters in the config file.
        Add your new parameter there somewhere.

        When it is working, make a pull request online in GitHub (just make the few edits in the GitHub webGUI is easy).

        Then everyone in South Africa and elsewhere gets the benefit.

        As the Greek philosopher Isosceles used to say, "There are 3 sides to every triangle."
        If I helped you, then help someone else - buy someone a gift from the INF catalog http://secure.inf.org/gifts/usd/

        1 Reply Last reply Reply Quote 0
        • First post
          Last post
        Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.