Hello. FreeRADIUS Version 2.1.10 (from git sources). I'm using dhcp feature of freeradius to assign static ips to computers dynamically. Sometimes its needed to reply to dhcp packets with same opt82 as in request. For example, cisco uses opt82 from replied packet to know from which port request has arrived (IP source guard, "ip verify source port-security" interface command). For this scenario, I added following to dhcp update sections: DHCP-Agent-Circuit-Id := "%{request:DHCP-Agent-Circuit-Id}" DHCP-Agent-Remote-Id := "%{request:DHCP-Agent-Remote-Id}" In this case, radius debug output shows correct assignment of options: Sending DHCP-Offer of id 7c0f40cd from 0.0.0.0:67 to x.x.x.1:67 DHCP-Subnet-Mask = 255.255.255.0 DHCP-Router-Address = x.x.x.1 DHCP-Domain-Name-Server = y.y.y.y DHCP-IP-Address-Lease-Time = 86400 DHCP-DHCP-Server-Identifier = z.z.z.z DHCP-Agent-Circuit-Id = 0x000401e30420 DHCP-Agent-Remote-Id = 0x000600FFFFFFFF00 Finished request 10. but both this two values (0x000401e30420 and 0x000600FFFFFFFF00) are assigned to DHCP-Relay-Agent-Information. tcpdump shows both as opt82 suboption 0: 5206000401e30420 5208000600FFFFFFFF00 Need help in setting this options correctly.
Alex wrote:
FreeRADIUS Version 2.1.10 (from git sources). I'm using dhcp feature of freeradius to assign static ips to computers dynamically.
$ git pull $ (cd src/lib;make) && (cd src/main;make)
but both this two values (0x000401e30420 and 0x000600FFFFFFFF00) are assigned to DHCP-Relay-Agent-Information. tcpdump shows both as opt82 suboption 0: 5206000401e30420 5208000600FFFFFFFF00
Need help in setting this options correctly.
Double-check that you're using the "dictionary.dhcp" file that comes with 2.1.10. *Don't* use the file that comes with 2.1.9. Alan DeKok.
Thanks Alan, but git pull said that local sources are up to date. I've even downloaded them again to another server (no previous versions of freeradius at it) according to http://git.freeradius.org/ $ git clone git://git.freeradius.org/freeradius-server.git $ cd freeradius-server $ git fetch origin v2.1.x:v2.1.x $ git checkout v2.1.x dhcp.c has this changes: http://github.com/alandekok/freeradius-server/commit/7d44b0a545a50012aaa60ba... dictionary.dhcp is from 2.1.10 but result is the same (tcpdump): Agent-Information Option 82, length 6: Unknown SubOption 0, length 4: 0x0000: 01e3 0420 Agent-Information Option 82, length 8: Unknown SubOption 0, length 6: 0x0000: 001f cab0 ef00 What am I doing wrong? ----- Original Message ----- From: "Alan DeKok" <aland@deployingradius.com> To: "FreeRadius users mailing list" <freeradius-users@lists.freeradius.org> Sent: Tuesday, July 20, 2010 01:54 Subject: Re: DHCP reply with opt82
Alex wrote:
FreeRADIUS Version 2.1.10 (from git sources). I'm using dhcp feature of freeradius to assign static ips to computers dynamically.
$ git pull $ (cd src/lib;make) && (cd src/main;make)
but both this two values (0x000401e30420 and 0x000600FFFFFFFF00) are assigned to DHCP-Relay-Agent-Information. tcpdump shows both as opt82 suboption 0: 5206000401e30420 5208000600FFFFFFFF00
Need help in setting this options correctly.
Double-check that you're using the "dictionary.dhcp" file that comes with 2.1.10. *Don't* use the file that comes with 2.1.9.
Alan DeKok. - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
Alex wrote:
Thanks Alan,
but git pull said that local sources are up to date.
Or... git pull origin v2.1.x:v2.1.x
dhcp.c has this changes: http://github.com/alandekok/freeradius-server/commit/7d44b0a545a50012aaa60ba...
Yes, that should be it.
dictionary.dhcp is from 2.1.10
Are you *sure*? The version in the source is from 2.1.10. What about the installed version? (/usr/local/share/freeradius/...) Go *check*.
but result is the same (tcpdump): Agent-Information Option 82, length 6: Unknown SubOption 0, length 4: 0x0000: 01e3 0420 Agent-Information Option 82, length 8: Unknown SubOption 0, length 6: 0x0000: 001f cab0 ef00
What am I doing wrong?
Probably not using the right dictionary, or the right version of the server. When I perform the test that's in the git commit message, I get the correct sub-option format. Please try that. If you don't get the correct suboptions, then you need to use the right dictionary and/or the right source code. Alan DeKok.
Sources, server version and dictionary was ok. The problem was in using "old" attributes: DHCP-Agent-Circuit-Id := "%{request:DHCP-Agent-Circuit-Id}" DHCP-Agent-Remote-Id := "%{request:DHCP-Agent-Remote-Id}" Changed them to: DHCP-Relay-Circuit-Id := "%{request:DHCP-Relay-Circuit-Id}" DHCP-Relay-Remote-Id := "%{request:DHCP-Relay-Remote-Id}" and now it works without any problem. Debug still shows old attibute DHCP-Agent-Circuit-Id and doesn't show remote id at all: Received DHCP-Discover of id 4a76b25e from 1.1.1.1:67 to 0.0.0.0:67 DHCP-Opcode = Client-Message DHCP-Hardware-Type = Ethernet DHCP-Hardware-Address-Length = 6 DHCP-Hop-Count = 1 DHCP-Transaction-Id = 1249292894 DHCP-Number-of-Seconds = 0 DHCP-Flags = 0 DHCP-Client-IP-Address = 0.0.0.0 DHCP-Your-IP-Address = 0.0.0.0 DHCP-Server-IP-Address = 0.0.0.0 DHCP-Gateway-IP-Address = 1.1.1.1 DHCP-Client-Hardware-Address = 00:11:22:33:44:55 DHCP-Message-Type = DHCP-Discover DHCP-Client-Identifier = 00:11:22:33:44:55 DHCP-Hostname = "test" DHCP-Parameter-Request-List = DHCP-Subnet-Mask DHCP-Parameter-Request-List = DHCP-Broadcast-Address DHCP-Parameter-Request-List = DHCP-Time-Offset DHCP-Parameter-Request-List = DHCP-Classless-Static-Route DHCP-Parameter-Request-List = DHCP-Router-Address DHCP-Parameter-Request-List = DHCP-Domain-Name DHCP-Parameter-Request-List = DHCP-Domain-Name-Server DHCP-Parameter-Request-List = DHCP-Hostname DHCP-Agent-Circuit-Id = 0x000401e30420 ----- Original Message ----- From: "Alan DeKok" <aland@deployingradius.com> To: "FreeRadius users mailing list" <freeradius-users@lists.freeradius.org> Sent: Tuesday, July 20, 2010 16:01 Subject: Re: DHCP reply with opt82
Alex wrote:
Thanks Alan,
but git pull said that local sources are up to date.
Or... git pull origin v2.1.x:v2.1.x
dhcp.c has this changes: http://github.com/alandekok/freeradius-server/commit/7d44b0a545a50012aaa60ba...
Yes, that should be it.
dictionary.dhcp is from 2.1.10
Are you *sure*? The version in the source is from 2.1.10. What about the installed version? (/usr/local/share/freeradius/...) Go *check*.
but result is the same (tcpdump): Agent-Information Option 82, length 6: Unknown SubOption 0, length 4: 0x0000: 01e3 0420 Agent-Information Option 82, length 8: Unknown SubOption 0, length 6: 0x0000: 001f cab0 ef00
What am I doing wrong?
Probably not using the right dictionary, or the right version of the server.
When I perform the test that's in the git commit message, I get the correct sub-option format. Please try that. If you don't get the correct suboptions, then you need to use the right dictionary and/or the right source code.
Alan DeKok. - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
Alex Jaliashvili wrote:
The problem was in using "old" attributes: DHCP-Agent-Circuit-Id := "%{request:DHCP-Agent-Circuit-Id}" DHCP-Agent-Remote-Id := "%{request:DHCP-Agent-Remote-Id}"
Uh... no. The dictionary.dhcp that is included with 2.1.10 has the *same* definition for those attributes. ATTRIBUTE DHCP-Agent-Circuit-Id 1 octets ATTRIBUTE DHCP-Agent-Remote-Id 2 octets ATTRIBUTE DHCP-Relay-Circuit-Id 1 octets ATTRIBUTE DHCP-Relay-Remote-Id 2 octets They are in the DHCP-Relay-Agent-Information TLV. If you have ANYTHING ELSE for these attributes, then you are not using the correct dictionary.
Changed them to: DHCP-Relay-Circuit-Id := "%{request:DHCP-Relay-Circuit-Id}" DHCP-Relay-Remote-Id := "%{request:DHCP-Relay-Remote-Id}" and now it works without any problem.
Which indicates that you're not using the correct dictionary.dhcp file.
Debug still shows old attibute DHCP-Agent-Circuit-Id and doesn't show remote id at all:
If the debug log shows DHCP-Agent-Circuit-Id, it's because you are using the OLD dictionary.dhcp file. Go fix that. The OLD file had "DHCP-Agent-*" listed LAST, which over-rode any previous definitions. The only issue left in the version you have is that it looks like the *first* attribute inside of option 82 is printed in debug mode, and the others aren't printed. But a "tcpdump" shows that all of them are in the packet. I'll put a fix for the debug output for 2.1.10. Alan DeKok.
participants (3)
-
Alan DeKok -
Alex -
Alex Jaliashvili