I’m very new to this and I did read some of the manual but yet not sure on how I should approach this
I have 760 pppoe users with static ip
The user network is 172.19.x.x/18
I need to change it to something else let’s say 192.19.x.x but keeping the last 2 pair of digits the same. Maybe this can be tho e with a simple script
You want something that automatically change all ppp/secret//remote-address from 172.19.x.x to 192.19.x.x ??? but why /18 is present on what you write for remote address?
you specify the /18 just because you have the 172.19.x.x/18 range and you want change only the users with 172.19.x.x?
You want something that automatically change all ppp/secret//remote-address from 172.19.x.x to 192.19.x.x ??? but why /18 is present on what you write for remote address?
you specify the /18 just because you have the 172.19.x.x/18 range and you want change only the users with 172.19.x.x?
[/quote]
Actually I think that is /16
I specified it because I have group of client with ip addresses all from 172.19.0.0 to 172.19.64.254
And I need to change all those to 192.19.x.x
On first step backup & expor the config, check if this simulate the correct results, this do nothig, simple print what must we do.
:foreach user in=[/ppp secret find where (remote-address in 172.19.0.0/18)] do={
:local usr [/ppp secret get $user name]
:set usr [:pick "$usr " 0 30]
:local old [/ppp secret get $user remote-address]
:local new (($old & 0.0.255.255) | 192.19.0.0)
:put "$usr$old\t->\t$new"
# /ppp secret set $user remote-address=$new
}
But 172.19.0.0/18 is go from 172.19.0.0 to 172.19.63.255, 172.19.64.0/24 is not covered…
You need also the 172.19.64.0/24 from 172.19.64.0.0 to 172.19.64.255?
Replace
(remote-address in 172.19.0.0/18)
with
((remote-address in 172.19.0.0/18) or (remote-address in 172.19.64.0/24))
Triple check the results.
All is at your own risk.
If all is working as expected, apply the changes relaunching the script removing the comment “#” in front of /ppp…
it was from 172.19.0.0 to 172./19.63.255, my bad. so /18.
i created the script on the rb and run it. the run count went up by one but i dont see any output in the log.
i haven’t remove the “#” as you suggested so i can check that things are actually going well. not sure on where i should look for the output tho.
thanks for your time and help i do really appreciate it!
I never say to run as script, open terminal, and paste it,
you see on terminal what change the script do, before you remove the # for make the change.
No log (read what the script do…), only as terminal results.
Please do not quote uselessly all the block, edit and remove on previous post the quoted part, please…