Hi, I'm wondering what would be the best method do to math on IP addresses. I want to build my returned ip address based on the username and the NAS IP address. The NAS IP is simply a mapping from the source ip to a number Z The layout of the username is: userX@Y.com The resulting IP address would then be 2Z.Y.X (where X is converted from a number to the last two subnets of the ip address) For example NAS IP: 10.10.10.10 -> maps to 3 (there's only four NAS'ses so a simply array or list will suffice) USERNAME: user500@4.com Resulting IP address : 23.4.2.244 ("2.244" being the 500th ip address if we start at counting "1.1") Do I need to use an external script for this? What would you recommend? Thanks, Sven. -- View this message in context: http://www.nabble.com/ip-address-manipulation-tp19630827p19630827.html Sent from the FreeRadius - User mailing list archive at Nabble.com.
I'm wondering what would be the best method do to math on IP addresses. I want to build my returned ip address based on the username and the NAS IP address. The NAS IP is simply a mapping from the source ip to a number Z The layout of the username is: userX@Y.com
The resulting IP address would then be 2Z.Y.X (where X is converted from a number to the last two subnets of the ip address) .. Do I need to use an external script for this? What would you recommend?
I would recommend that you run the script just once and populate your database/users file with required user-NAS-IP combinations. Ivan Kalik Kalik Informatika ISP
If you are thinking of MySQL for this purpose, you could try using stored procedures to create required IP combinations/pools. On Tue, Sep 23, 2008 at 6:37 PM, <tnt@kalik.net> wrote:
I'm wondering what would be the best method do to math on IP addresses. I want to build my returned ip address based on the username and the NAS IP address. The NAS IP is simply a mapping from the source ip to a number Z The layout of the username is: userX@Y.com
The resulting IP address would then be 2Z.Y.X (where X is converted from a number to the last two subnets of the ip address) .. Do I need to use an external script for this? What would you recommend?
I would recommend that you run the script just once and populate your database/users file with required user-NAS-IP combinations.
Ivan Kalik Kalik Informatika ISP
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
participants (3)
-
rsg -
slanckma -
tnt@kalik.net