Yes I was aware that my IP address can and does change because I do check my IP address occasionally. It was more a question of manually doing it, how to do it and doing it as easily as possible when needed.
You could easily write a powershell script to trigger a scheduled task that runs as administrator or system to disable and re-enable the NIC. There are also utilities to enable standard users to run specified tasks as administrator.
Really we need to understand what you're trying to do (cycle IP on demand? Every 30 mins? When a website blocks you?) and why (you think it makes you more secure? You're trying to evade a ban?) if you want people to be able to give you a proper solution.
For example, if addresses are assigned by SLAAC and RA, and you have a delegated /56, the router is providing a preferred and valid lifetime to the clients in the RA, and this can be changed at the router (assuming the router allows it, a locked down ISP provided router probably does not).
One way to allow a standard user to disable and reenable nics on demand would be to create a scheduled task with no triggers that runs as system with something like this:
# PowerShell script to disable and re-enable all active NICs
Get-NetAdapter | Where-Object {$_.Status -eq "Up"} | ForEach-Object {
$nicName = $_.Name
Write-Host "Disabling NIC: $nicName"
Disable-NetAdapter -Name $nicName -Confirm:$false
Start-Sleep -Seconds 5 # Wait for a few seconds before re-enabling
Write-Host "Enabling NIC: $nicName"
Enable-NetAdapter -Name $nicName -Confirm:$false
}
And then trigger that task with a second script that runs as a standard user:
# PowerShell script to trigger the scheduled task
Start-ScheduledTask -TaskName "RefreshNIC"
But I'd suggest you don't just run code from the internet posted by a random forum user. This will obviously lead to a few seconds of lost internet.
Really we need to know what you're doing and why.
Edited by nemeth782 (Thu 09-Nov-23 13:53:36)