hi i need script for ( hotspot >user profile > script > on login & on logout)
that add nat masquerade (ip firewall nat add action=masquerade chain=srcnat src-address=userIP)
and remote it after user logout
i use 2 ip pool for hotspot first dhcp assign ip to user when he connect to wlan , second hotspot assign ip to logged in users form another ip pool
i need nat for second ip pool
nice help guys ![]()
on login
:local "hotspot_user" $user;
:local "hotspot_address" $address;
/ip firewall nat add action=masquerade chain=srcnat hotspot=auth comment="NAT for $user" src-address=$address;
:log info "User $user with ip-address $address logged in!"
on logout
:local "hotspot_user" $user;
:local "hotspot_address" $address;
/ip firewall nat remove [/ip firewall nat find src-address=$address];
:log info "User $user with ip-address $address logged out!"
Hello, looks like this is what i’ve been looking for. can you please help further by explaining on how to apply this script? Are we going to apply it to /system script and schedule it?
Hi, I’m working on this script, but I need to push the script from API to hotspot user profile. How can I do that. I can not found on login and logout field on api.
. Thanks for your advance.