SSH command to whitelist ("Allowed IP") a captive portal IP?



  • Hi,

    I'm trying to write a SSH script to whitelist an IP ("Allowed IP" in captive portal) –

    How would I best go about this? Thanks! As always, researching this as I post this .. if I find anything useful before an answer, I'll be sure to post it :) getting pretty good at this stuff


  • Banned

    None. Do it via GUI.



  • @doktornotor:

    None. Do it via GUI.

    You really don't think outside the box do you. You want to know how many times people said none in this forum and I found a way to code it in? Smite for you, troll.

    Anyone know where whitelisted IPs are saved for the captive portal?


  • LAYER 8 Netgate

    Until there's an API for this, the above post by doktornotor is spot on.  Sorry, but you have the captive portal you have, not the firewall you want.

    Anyone who can code this can get on github and figure out where they're stored for himself.  Look at etc/inc/captiveportal.inc for the functions you might be able to call to accomplish this. And usr/local/www/services_captiveportal_ip_edit.php for other examples.

    A programmer shouldn't need to be told this.

    Good luck.



  • @Derelict:

    Until there's an API for this, the above post by doktornotor is spot on.  Sorry, but you have the captive portal you have, not the firewall you want.

    Anyone who can code this can get on github and figure out where they're stored for himself.  Look at etc/inc/captiveportal.inc for the functions you might be able to call to accomplish this. And usr/local/www/services_captiveportal_ip_edit.php for other examples.

    A programmer shouldn't need to be told this.

    Good luck.

    A programmer shouldn't be told where certain files are located? Right, because if I told a pro traveler to go to certain coordinates, he wouldn't have to look at a map/GPS, right? Idiot.

    I've solved many puzzles like this and posted my code – feel free to use my findings to add to github -- it's there. Someone can feel free to spend 5 mins add it, if you'd like. I've done my part. That would make more use of your time than trolling. No need for an API if it's open source?

    Other than your trolls, thanks for the locations.

    That's also why I asked where to look, so that I CAN edit this. I'll post my findings later. Not for you, but for others.

    EDIT: This would be easy if can just edit the XML and reupload:

    (The highlighted section, specifically)

    Anyone know a decent way to obtain the XML and restore it remotely? Hmm.. Or where is this info in the XML physically stored – could just edit the file itself with sudo


  • LAYER 8 Netgate

    I point you in the right direction and for that I get a smite.  What a douche.

    Call the php functions that are called when someone adds an IP using the GUI and you'll have your "solution."

    I say again: what a douche.



  • @Derelict:

    I point you in the right direction and for that I get a smite.  What a douche.

    Call the php functions that are called when someone adds an IP using the GUI and you'll have your "solution."

    I say again: what a douche.

    A programmer shouldn't need to be told this.

    But a +1/thanks for the actual contribution.. even though your answer was wrapped in a box of douche (smite was for the blatent insult).. for that, you received both thanks and smite.

    Anyway, 2 thanks beats 1 smite – thanks for the the tip about php call ..


  • Banned


Log in to reply