I'm not using DHCP Option 82 agent-id but I would like to apply some transformation to ifname interface so accel sends a custom username to radius.
by example:
eth0.100.9
I would like to strip out eth0.100 and create a username like ipoe9
сat /etc/accel-ppp.lua
#!lua
function username(pkt)
local interfacename=pkt:getifnameexists()?
return mytransformationfunction(interfacename)
end
But for it I need to get the interface name. So are there a way that I get ifame in lua script?
Lua script for ifname
Re: Lua script for ifname
Code: Select all
function username_iface(pkt)
local username = pkt:ifname()
return username
end