> Hello all,
>
> Recently I found that omshell can be use to control the dhcpd server
> without restarting the server.
> So I'm thinking would there be a way to ask the freeradius to "Talk" to
> omshell when a users auth and assign an ip though omshell.
> When the users request the ip from dhcpd server, he will get the one
> that freeradius assign.
>
> Nice idea? :)
>
> Any Though.
>
> Thank You
> Chan Min Wai
>

Thats an interesting idea.  A long time ago I wrote an expect script to
change the IP address of a user.  This had nothing to do with freeradius,
but it could help.  This will basically just help you with the syntax that
omshell uses.  You would need to pull out the variables from freeradius
somewhere and execute this script with those variables.  I was just
setting the client name to the mac address, which is why both name and mac
pull from the same argv.  You would run the script like this (saying its
named something like dhcp.expect)

dhcp.expect 192.168.0.5 0:60:1d:f1:75:d

Hope this helps in getting you on your way.

#!/usr/local/bin/expect -df

set name [lindex $argv 1]
set mac [lindex $argv 1]
set ip [lindex $argv 0]

spawn /usr/local/bin/omshell
expect ">"
send "connect\r"
expect ">"
send "new host\r"
expect ">"
send "set name = \"$name\"\r"
expect ">"
send "set hardware-address = $mac\r"
expect ">"
send "set hardware-type = 1\r"
expect ">"
send "set ip-address = $ip\r"
expect ">"
send "create\r"
expect ">"

exit


- 
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

Reply via email to