Lua script for ifname

IPoE related questions
Post Reply
hugleo
Posts: 59
Joined: 13 Apr 2016, 14:28

Lua script for ifname

Post by hugleo »

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?
nik247
Posts: 108
Joined: 11 Oct 2014, 15:57

Re: Lua script for ifname

Post by nik247 »

Code: Select all

function username_iface(pkt)
    local username = pkt:ifname()
    return username
end
Post Reply