Lua script for ifname

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

Lua script for ifname

Post by hugleo » 05 Dec 2016, 20:38

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:

I would like to strip out eth0.100 and create a username like ipoe9

сat /etc/accel-ppp.lua
function username(pkt)
local interfacename=pkt:getifnameexists()?
return mytransformationfunction(interfacename)

But for it I need to get the interface name. So are there a way that I get ifame in lua script?

Posts: 104
Joined: 11 Oct 2014, 15:57

Re: Lua script for ifname

Post by nik247 » 06 Dec 2016, 07:01

Code: Select all

function username_iface(pkt)
    local username = pkt:ifname()
    return username

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest