awk \'BEGIN{p=1000} $1=="local-ip"{$4=p++} 1\' input.cfg > output.cfg
input
local-ip 155.165.170.10 port 0 remote-ip 155.16.