Captiveportal - ubuntu as radius server and for MySQL, pfsense as captive portal
-
somehow i successfully authenticate and able to login with 'test' pass '12345678'
new problem come out. Captive portal pages does no come out automatically.
i need to type in '192.168.3.11:8000' on browser to view my captive portal page.after successfully login with 'test' id ..still i cannot access to google.com. page not found.
im lost here.. anyone got any idea?
-
Glad you got the auth. working.
The CP should work ok, except that there is a bug in the captive portal redirect where the first "/" character is removed from the URL and you get a page not found. You can get around this by forcing a redirect to google.com (or any other site) for all successful logins, rather than the page the user requested. -
thanks ..
Normally whatever site u try to access. Whatever u type into web browser address bar. Its will point back to captive portal page and asked for username and password.Thats kind of thing does not happen to my pfsense box. Whatever site i try to access its keep showing me page not found. My captive portal page does not show up as its suppose to be.
Any idea?
-
First:
The DNS server of your hosts must be the pfsense CP interface IP address.Second:
CP will only appear if your host is brwosing to a http address. httpS will not be recognized and CP will not appear. So if a user wants to auth he needs to browse to a http page.Third:
If you want to redirect a user to another page, type in the complete URL like http://www.google.com -
First:
The DNS server of your hosts must be the pfsense CP interface IP address.pfsense box LAN ip is set as dhcp. So i juz connect to my laptop without problem. Or u mean something else?
-
The DNS of the clients is pfsense ? Do not use any other DNS. That is important that CP can work.
-
here my diagram ..for better understanding
The DNS of the clients is pfsense ?
YES ..clients DNS is CP ip address.
i tried to access http://192.168.1.90/phpmyadmin ..CP did show up. its work!!
BUT, whenever i login into CP. Once again my browser show me 'page not found'
'ping time out' form my laptop(192.168.3.10) to Radius Server(192.168.1.90) ..however, each time i tried to access google page or other website on internet.
CP did not come out ..and browser show me 'page not found' instantly.im lost here ..something to do with firewall rules or pfsense CP configuration?
-
Hi,
on firewall you must allow HTTP (80) traffic, DNS (53), and port 8000 which is the Captiveportal. Best would be if you first create an "allow any to any" rule on the CP interface to make sure that your firewall is not the reason for your problems. If all is working you can try to play with firewall rules.
Further you should remember:
CP is only showing up if you connect to an http web-page. httpS webpages cannot be redirected by CP as far as I know. If I am not wrong - google is using httpS in some cases ? Please try with another webpage which is for sure just using http. This should make the CP portal come up. -
thanks for ur time and advice
once i tried set firewall to * * * * , i alllowed any to any. As u said i did "allow any to any" rule.
nothing change, i got same problem. Then i disable all rules at my LAN(CP) ..nothing good happen.i will try this ..whish me luck guys :
on firewall you must allow HTTP (80) traffic, DNS (53), and port 8000 which is the Captiveportal
-
after disable CP. I got no problem surfing the internet with my laptop.
whenever i enable CP. CP page come out and asking for username and password.however ..
after successfully login to CP. My browser show me 'can't connect to server'.
again, i can not access any website on the internet.from pfsense box i successfully ping to router, radius server and internet.
could be connection from pfsense to radius server having some problem?
or my radius server need some more configuration to allow user access to internet?
or WAN firewall rules need to do some rules? -
That's a really strange behaviour I think.
The RADIUS problem:
-
On CP you have to set RADIUS as authentication and the RADIUS IP address, the RADIUS port for authentication (1812) and the shared secret. And then a littel below on the CP page there is something like "NAS identifier", this should be probably set to your WAN IP address of pfsense. That is the minimum you have to do if I remember correct.
-
On RADIUS you have to add the client/NAS, which is your pfsense CP, with the same shared secret. RADIUS auth listening on port 1812 and of course add a user with username and password. To make sure that RADIUS is getting the access-request from CP and is sending back an access-accept to CP you should run freeradius in debug mode. This can be done with:
radiusd -X
You should see the auth request from CP and the accept/reject from RADIUS. And you should see the IP address to where the RADIUS is sending it.
While writing this text I am thinking about a possible problem if you have running NAT on pfsense WAN interface. Not sure if this could cause problems.
Another possibility could be that you try the freeradius2 package for pfsense. You can install it on pfsense using the package manager. And this freeradius server on pfsense can be connected to MySQL and PostgreSQL database.
Or you are able to put you external RADIUS server into the LAN. (For testing, if NAT is the problem).Perhaps this documentation can help you a little bit with your RADIUS server:
http://doc.pfsense.org/index.php/FreeRADIUS_2.x_package#Check_if_your_configuration_worksAnd at least you could try to use CP with the "Local User database" which is in SYSTEM –> User Manager on pfsense. And then try to authenticate with a client and test if you can browse the web so that you can say at the end: My client is ok, firewall is ok, CP is ok, but connection between RADIUS and CP is not working properly.
Good luck! :-)
-
-
yup ..its strange ..thanks for ur suggestion. i will do as u suggest me.
if anything come out ..i will post it here. wish me luck guys. -
What is your captive portal page content ?
the form should be like this
here "action="$PORTAL_ACTION$">" is important.
-
Your WAN is on private IP space, do you have allow Private Net/bogons on the WAN interface?
Looking at the radius debugging output would have shown that there was no connection to the radius server.