I must be missing something. I'm building some monitoring to test various virtual servers with: client 127.0.0.1 { secret = testing virtual_server = serverA } client 127.0.0.2 { secret = testing virtual_server = serverB } But when I use radtest, only serverA responds regardless of which address I use. I can see in tcpdump the packet is sourced from the alternate IP. In the logs, I see: (9) Received Access-Request Id 182 from 127.0.0.1:33603 to 127.0.0.2:1812 length 80 So the server knows the correct address, but then later down: (9) Login OK: [testuser] (from client 127.0.0.1 port 1) (9) Sent Access-Accept Id 182 from 127.0.0.2:1812 to 127.0.0.1:33603 length 0 It seems radiusd aggregates these addresses. Is this by design? Thanks, schu
On Sep 23, 2019, at 3:32 PM, Matthew Schumacher <matt.s@aptalaska.net> wrote:
I must be missing something. I'm building some monitoring to test various virtual servers with:
client 127.0.0.1 { secret = testing virtual_server = serverA }
client 127.0.0.2 { secret = testing virtual_server = serverB }
But when I use radtest, only serverA responds regardless of which address I use. I can see in tcpdump the packet is sourced from the alternate IP.
IPs are just IPs. The server doesn't really do anything magic with them.
In the logs, I see:
(9) Received Access-Request Id 182 from 127.0.0.1:33603 to 127.0.0.2:1812 length 80
127.0.0.1 is the client IP. 127.0.0.2 is the server IP. So you've *also* configured the server to listen on 127.0.0.2.
So the server knows the correct address, but then later down:
(9) Login OK: [testuser] (from client 127.0.0.1 port 1) (9) Sent Access-Accept Id 182 from 127.0.0.2:1812 to 127.0.0.1:33603 length 0
Yes, FROM server address TO client address. That's fine.
It seems radiusd aggregates these addresses. Is this by design?
It doesn't get IP addresses confused. Alan DeKok.
On 9/23/19 11:36 AM, Alan DeKok wrote:
In the logs, I see:
(9) Received Access-Request Id 182 from 127.0.0.1:33603 to 127.0.0.2:1812 length 80 127.0.0.1 is the client IP. 127.0.0.2 is the server IP.
So you've *also* configured the server to listen on 127.0.0.2. Oh, right, duh... I don't know why that didn't occur to me...
So what I really want is radclient to support defining the source IP. I looked through the source, but it looks like this isn't something you can set. Any hints would be appreciated. schu
On Sep 23, 2019, at 3:56 PM, Matthew Schumacher <matt.s@aptalaska.net> wrote:
So what I really want is radclient to support defining the source IP. I looked through the source, but it looks like this isn't something you can set. Any hints would be appreciated.
It's a little wonky, but add this to the packet you're sending: Packet-Src-IP-Address = 127.0.0.2 radclient will look for that, and then bind to that IP for sending packets. Alan DeKok.
On Tue, Sep 24, 2019 at 7:58 AM Alan DeKok <aland@deployingradius.com> wrote:
On Sep 23, 2019, at 3:56 PM, Matthew Schumacher <matt.s@aptalaska.net> wrote:
So what I really want is radclient to support defining the source IP. I looked through the source, but it looks like this isn't something you can set. Any hints would be appreciated.
It's a little wonky, but add this to the packet you're sending:
Packet-Src-IP-Address = 127.0.0.2
I agree it is a bit wonky but have done this numerous times with a regression testing suite I built to allow me to simulate different NAS types based on the source IP address. I know the response would be "patches welcome" but if you are ever digging in the radclient code having it as a command line option would be fantastic :)
radclient will look for that, and then bind to that IP for sending packets.
Alan DeKok.
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
On 9/23/19 1:51 PM, Peter Lambrechtsen wrote:
On Tue, Sep 24, 2019 at 7:58 AM Alan DeKok <aland@deployingradius.com> wrote:
On Sep 23, 2019, at 3:56 PM, Matthew Schumacher <matt.s@aptalaska.net> wrote:
So what I really want is radclient to support defining the source IP. I looked through the source, but it looks like this isn't something you can set. Any hints would be appreciated.
It's a little wonky, but add this to the packet you're sending:
Packet-Src-IP-Address = 127.0.0.2
I agree it is a bit wonky but have done this numerous times with a regression testing suite I built to allow me to simulate different NAS types based on the source IP address.
I know the response would be "patches welcome" but if you are ever digging in the radclient code having it as a command line option would be fantastic :)
That works, appreciate the help!
participants (3)
-
Alan DeKok -
Matthew Schumacher -
Peter Lambrechtsen