[libfreeradius-client] Send request to non-standard ports
Hi, I'm trying to send radius auth request to the 11812 port. So i've placed 11812 as second parameter of the rc_auth function. On my server's log, I can see that the NAS-PORT is set, in the request, to 11812. But the request itself is sent to the standard 1812 port .. How can I change that ? I need to send some request to 1812 and some others to 11812 (two radius servers are running). I've looked at the example code but they are just using the port parameter of rc_auth, so I can't find a way to make it work. (I'll need to do the same with accounting too) Thanks
On Fri, Sep 30, 2011 at 03:15:13PM +0200, Kevin Lemonnier wrote:
I'm trying to send radius auth request to the 11812 port. So i've placed 11812 as second parameter of the rc_auth function.
On my server's log, I can see that the NAS-PORT is set, in the request, to 11812.
I think you are confusing two things: the UDP port to which the packet is sent, and the NAS-Port, which is a RADIUS attribute *within* the packet, and is intended to identify which physical connection on the NAS the user has connected on.
I'm not confusing, I want to change the UDP port to which the paquet is sent, the request itself. I just want to sent it to 11812 instead of 1812, and I can't find how to do this ..
On 10/03/2011 10:54 AM, Alan DeKok wrote:
Kevin Lemonnier wrote:
I'm not confusing, I want to change the UDP port to which the paquet is sent, the request itself.
I just want to sent it to 11812 instead of 1812, and I can't find how to do this ..
Use "hostname:port"
Alan DeKok. - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/devel.html
Where ? In the radiusclient.conf file ? But if I do that, I will not be able to send some paquets to 1812 and some others to 11812, right ?
So there is absolutly no way to send paquet to one port or an other at runtime ? Mh, I have no idea of how I will make my program work .. I guess I could use two separate install of radiusclient with two conf files, and then load the one I need each time. Thanks On 10/03/2011 11:03 AM, Alan DeKok wrote:
Kevin Lemonnier wrote:
Where ? In the radiusclient.conf file ?
Yes.
But if I do that, I will not be able to send some paquets to 1812 and some others to 11812, right ?
Yes.
Alan DeKok. - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/devel.html
On 3 Oct 2011, at 12:08, Kevin Lemonnier wrote:
On 10/03/2011 10:54 AM, Alan DeKok wrote:
Kevin Lemonnier wrote:
I'm not confusing, I want to change the UDP port to which the paquet is sent, the request itself.
I just want to sent it to 11812 instead of 1812, and I can't find how to do this ..
Use "hostname:port"
Alan DeKok. - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/devel.html
Where ? In the radiusclient.conf file ? But if I do that, I will not be able to send some paquets to 1812 and some others to 11812, right ?
Wherever you specify the IP address for the RADIUS server, just use the format <IP | Hostname>:<Port>. This is widely accepted practice, this is not specific to the RADIUS client library. I'm not sure why you didn't try it first instead of posting to the list... -Arran Arran Cudbard-Bell a.cudbardb@freeradius.org Betelwiki, Betelwiki, Betelwiki.... http://wiki.freeradius.org/ !
Because I need to be able to send paquets to different port at run time, changing the conf every time is just not possible. But I will try with two conf, and then load the one I need at run time. Pretty heavy but I guess I have no choice .. On 10/03/2011 11:22 AM, Arran Cudbard-Bell wrote:
On 3 Oct 2011, at 12:08, Kevin Lemonnier wrote:
On 10/03/2011 10:54 AM, Alan DeKok wrote:
Kevin Lemonnier wrote:
I'm not confusing, I want to change the UDP port to which the paquet is sent, the request itself.
I just want to sent it to 11812 instead of 1812, and I can't find how to do this ..
Use "hostname:port"
Alan DeKok. - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/devel.html
Where ? In the radiusclient.conf file ? But if I do that, I will not be able to send some paquets to 1812 and some others to 11812, right ?
Wherever you specify the IP address for the RADIUS server, just use the format <IP | Hostname>:<Port>. This is widely accepted practice, this is not specific to the RADIUS client library. I'm not sure why you didn't try it first instead of posting to the list...
-Arran
Arran Cudbard-Bell a.cudbardb@freeradius.org
Betelwiki, Betelwiki, Betelwiki.... http://wiki.freeradius.org/ !
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/devel.html
On Mon, Oct 03, 2011 at 12:33:41PM +0200, Kevin Lemonnier wrote:
Because I need to be able to send paquets to different port at run time, changing the conf every time is just not possible.
But I will try with two conf, and then load the one I need at run time. Pretty heavy but I guess I have no choice ..
No different than if you wanted to send the packet to either host X or host Y at runtime?
There is a way to do that ? I can't find a way to select the host at runtime, I searched on the example files but I don't see how. On 10/03/2011 12:08 PM, Brian Candler wrote:
On Mon, Oct 03, 2011 at 12:33:41PM +0200, Kevin Lemonnier wrote:
Because I need to be able to send paquets to different port at run time, changing the conf every time is just not possible.
But I will try with two conf, and then load the one I need at run time. Pretty heavy but I guess I have no choice ..
No different than if you wanted to send the packet to either host X or host Y at runtime? - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/devel.html
Okay, I tried some things. I tried to put 192.168.22.107:11812 as auth server in radiusclient.conf Without the port, the standard 1812 is used and all works fine. With the :11812 I have this error Oct 5 12:19:09 trixbox1 [FREERADIUS-CLIENT][3991]: rc_ip_hostname: couldn't look up host by addr: C0A8166B Oct 5 12:19:09 trixbox1 [FREERADIUS-CLIENT][3991]: rc_send_server: no reply from RADIUS server unknown:11812 No idea why. I also tried to modify the authserver->port[0] directly in the rc_handle, and I have exactly the same error. With both method, the exactly same result, these erros in /var/log/messages and the radius running on 11812 just drop the request, with an "unknown client" in the logs. I'm using the freeradius 1.1.4 because the 1.1.5 and 1.1.6 always segfaults with me. I searched on google, someone posted a patch for that segfault but after patching I have a different segfault .. The 1.1.4 version is the more recent working version when I searched a RADIUS librairy. May that be the problem ? 1.1.4 do not handle the non standard port correctly ? thanks
Kevin Lemonnier wrote:
I'm using the freeradius 1.1.4 because the 1.1.5 and 1.1.6 always segfaults with me. I searched on google, someone posted a patch for that segfault but after patching I have a different segfault .. The 1.1.4 version is the more recent working version when I searched a RADIUS librairy. May that be the problem ? 1.1.4 do not handle the non standard port correctly ?
I think that the freeradius-client code is not up to the same level of quality as the freeradius-server code. See the server, src/lib/ for a much better RADIUS library. Alan DeKok.
participants (4)
-
Alan DeKok -
Arran Cudbard-Bell -
Brian Candler -
Kevin Lemonnier