freeradius 2.0.4, rlm_passwd and dhcp
Hi! I've installed freeradius 2.0.4, configured dhcp. In fact, i leave all sample configuration. from modules{} : passwd mac2ip { filename = /usr/local/freeradius204/etc/raddb/dhcppasswd format = "*DHCP-Client-Hardware-Address:=DHCP-Your-IP-Address" delimiter = "," } deb30# cat /usr/local/freeradius204/etc/raddb/dhcppasswd 2a:00:3e:50:32:d2,93.84.246.130 From debug output: server dhcp { modules { Module: Checking dhcp DHCP-Discover {...} for more modules to load Module: Linked to module rlm_always Module: Instantiating ok always ok { rcode = "ok" simulcount = 0 mpp = no } Module: Checking dhcp DHCP-Request {...} for more modules to load Module: Linked to module rlm_passwd Module: Instantiating mac2ip passwd mac2ip { filename = "/usr/local/freeradius204/etc/raddb/dhcppasswd" format = "*DHCP-Client-Hardware-Address:=DHCP-Your-IP-Address" delimiter = "," ignorenislike = yes ignoreempty = yes allowmultiplekeys = no hashsize = 100 } rlm_passwd: nfields: 2 keyfield 0(DHCP-Client-Hardware-Address) listable: no Module: Checking dhcp (null) {...} for more modules to load /usr/local/freeradius204/etc/raddb/sites-enabled/dhcp[202]: No name specified for Post-Auth-Type block } } But when packet arrived, rlm_passwd says NOTFOUND: Received DHCP-Discover of id 22424 from 0.0.0.0:68 to 0.0.0.0:67 DHCP-Opcode = Client-Message DHCP-Hardware-Type = Ethernet DHCP-Hardware-Address-Length = 6 DHCP-Hop-Count = 0 DHCP-Transaction-Id = 22424 DHCP-Number-of-Seconds = 0 DHCP-Flags = Broadcast 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 = 0.0.0.0 DHCP-Client-Hardware-Address = 2a:00:3e:50:32:d2 DHCP-Message-Type = DHCP-Discover DHCP-Client-Identifier = 2a:00:3e:50:32:d2 DHCP-Parameter-Request-List = DHCP-Subnet-Mask DHCP-Parameter-Request-List = DHCP-Router-Address DHCP-Parameter-Request-List = DHCP-Time-Server DHCP-Parameter-Request-List = DHCP-IEN-116-Name-Server DHCP-Parameter-Request-List = DHCP-Domain-Name-Server DHCP-Parameter-Request-List = DHCP-Log-Server DHCP-Parameter-Request-List = DHCP-Quotes-Server DHCP-Parameter-Request-List = DHCP-LPR-Server DHCP-Parameter-Request-List = DHCP-Impress-Server DHCP-Parameter-Request-List = DHCP-RLP-Server DHCP-Parameter-Request-List = DHCP-Domain-Name DHCP-Parameter-Request-List = DHCP-Swap-Server DHCP-Parameter-Request-List = DHCP-NIS-Domain-Name DHCP-Parameter-Request-List = DHCP-NIS-Servers DHCP-Parameter-Request-List = DHCP-NTP-Servers DHCP-Parameter-Request-List = DHCP-X-Window-Font-Server DHCP-Parameter-Request-List = DHCP-X-Window-Display-Mgr server dhcp { Trying sub-section dhcp DHCP-Discover {...} +- entering group DHCP-Discover ++[reply] returns noop ++[reply] returns noop ++[reply] returns noop ++[mac2ip] returns notfound ++[ok] returns ok } # server dhcp Sending DHCP-Offer of id 22424 from 0.0.0.0:67 to 0.0.0.0:68 DHCP-Opcode = Server-Message DHCP-Hardware-Type = Ethernet DHCP-Hardware-Address-Length = 6 DHCP-Hop-Count = 0 DHCP-Transaction-Id = 22424 DHCP-Number-of-Seconds = 0 DHCP-Flags = Broadcast 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 = 0.0.0.0 DHCP-Client-Hardware-Address = 0x2a003e5032d2 DHCP-Server-Host-Name = "" DHCP-Boot-Filename = "" DHCP-Subnet-Mask = 255.255.255.128 DHCP-Router-Address = 93.84.246.129 DHCP-Domain-Name-Server = 82.209.240.241 DHCP-Domain-Name-Server = 82.209.243.241 DHCP-IP-Address-Lease-Time = 60 DHCP-DHCP-Server-Identifier = 93.84.246.129 Finished request 0. Cleaning up request 0 ID 22424 with timestamp +8 Going to the next request Ready to process requests. Also i've tried to add such update section: dhcp DHCP-Discover { update reply { DHCP-Message-Type = DHCP-Offer } # The contents here are invented. Change them! update reply { DHCP-Domain-Name-Server = 82.209.240.241 DHCP-Domain-Name-Server = 82.209.243.241 DHCP-Subnet-Mask = 255.255.255.128 DHCP-Router-Address = 93.84.246.129 DHCP-IP-Address-Lease-Time = 60 DHCP-DHCP-Server-Identifier = 93.84.246.129 } # This part ---> update reply { DHCP-Your-IP-Address = 93.84.246.130 DHCP-Client-IP-Address = 93.84.246.130 } # <--- but it updates only DHCP-Your-IP-Address, not DHCP-Client-IP-Address: Sending DHCP-Offer of id 10898 from 0.0.0.0:67 to 0.0.0.0:68 DHCP-Opcode = Server-Message DHCP-Hardware-Type = Ethernet DHCP-Hardware-Address-Length = 6 DHCP-Hop-Count = 0 DHCP-Transaction-Id = 10898 DHCP-Number-of-Seconds = 0 DHCP-Flags = Broadcast DHCP-Client-IP-Address = 0.0.0.0 DHCP-Your-IP-Address = 93.84.246.130 DHCP-Server-IP-Address = 0.0.0.0 DHCP-Gateway-IP-Address = 0.0.0.0 DHCP-Client-Hardware-Address = 0x2a003e5032d2 DHCP-Server-Host-Name = "" DHCP-Boot-Filename = "" DHCP-Subnet-Mask = 255.255.255.128 DHCP-Router-Address = 93.84.246.129 DHCP-Domain-Name-Server = 82.209.240.241 DHCP-Domain-Name-Server = 82.209.243.241 DHCP-IP-Address-Lease-Time = 60 DHCP-DHCP-Server-Identifier = 93.84.246.129 Finished request 13. Cleaning up request 13 ID 10898 with timestamp +212 What am i doing wrong? -- With best regards, Evgeniy Kozhuhovskiy, Leader of Services team, Minsk State Phony Network, RUE Beltelecom.
Alan DeKok wrote:
I've committed a few fixes to CVS which should help with this. Yeah, it works, thanks
One more problem. fr sends dhcp replies via routing, not via interface it recievied it :-) I.e. it recieves request via eth.940 for example, and replyes via eth0 (default route goes via it) deb30# tcpdump -n -i eth1.940 tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on eth1.940, link-type EN10MB (Ethernet), capture size 96 bytes 12:05:34.211116 IP 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from 2a:00:3e:50:32:d2, length 272 deb30# tcpdump -n -i eth0 not tcp tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes .... 12:04:19.215242 IP 93.84.246.2.67 > 255.255.255.255.68: BOOTP/DHCP, Reply, length 576 Is it possible to fix this behaverior? -- With best regards, Evgeniy Kozhuhovskiy, Leader of Services team, Minsk State Phony Network, RUE Beltelecom.
Alan DeKok wrote:
Put "interface = eth0.960" in the listen{} section. This lets you bind the listen{} section to a named interface. This is documented in radiusd.conf.
thanks, i'm newbee to 2.x :-) -- With best regards, Evgeniy Kozhuhovskiy, Leader of Services team, Minsk State Phony Network, RUE Beltelecom.
Alan DeKok wrote:
Evgeniy Kozhuhovskiy wrote:
thanks, i'm newbee to 2.x :-)
It's OK. Please give any feedback on the new DHCP code... I think it's useful, but we'll never know for sure until people start using it heavily.
One more trouble (?) I've configured lease time to 60 sec. Client (Windows XP SP3) gets an ip address, lease expires and when it tries to renew ip - radius says: Received DHCP-Request of id 1583096998 from 93.84.246.131:68 to 0.0.0.0:67 Ignoring request from unknown client 93.84.246.131 port 68 Ready to process requests. I'm doing ipconfig /release and ipconfig /renew - it resends request from 0.0.0.0 and it works for one minute again :-) In server dhcp {} there is only one client: client any { ipaddr = 0.0.0.0 netmask = 0 dhcp = yes } -- With best regards, Evgeniy Kozhuhovskiy, Leader of Services team, Minsk State Phony Network, RUE Beltelecom.
Evgeniy Kozhuhovskiy wrote:
Client (Windows XP SP3) gets an ip address, lease expires and when it tries to renew ip - radius says: Received DHCP-Request of id 1583096998 from 93.84.246.131:68 to 0.0.0.0:67 Ignoring request from unknown client 93.84.246.131 port 68 Ready to process requests.
I had ran into that, too. I though I had committed a fix already, but I guess not. In any case, a fix is now in src/main/client.c. Do a 'cvs upgrade' and re-build. Alan DeKok.
I'll try it and I will post my results. Right now I working on a small isolated system for testing purposes. Stay tuned :) Alan DeKok wrote:
Evgeniy Kozhuhovskiy wrote:
thanks, i'm newbee to 2.x :-)
It's OK. Please give any feedback on the new DHCP code... I think it's useful, but we'll never know for sure until people start using it heavily.
Alan DeKok. - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
participants (3)
-
Alan DeKok -
Evgeniy Kozhuhovskiy -
Marinko Tarlac