WgServerforWindows
WgServerforWindows copied to clipboard
Autoconfiguration ipv4 on wg server networkcard its getting random ip addres not gatway of the range of ip i set up
Hi @gbtech-org,
Just to make sure I understand the problem, are you using NAT Routing? And are you saying that the IP address assigned to the wg_server
interface is not the first address in the server address range?
Yes i have set up correctly but i dont know why the wg-server get an random ip apipa
Can you run these commands in PowerShell to see if it helps?
Remove-NetIPAddress -Confirm:$false -InterfaceIndex (Get-NetIPInterface -InterfaceAlias wg_server)[0].ifIndex
New-NetIPAddress -IPAddress 10.253.0.1 -PrefixLength 24 -InterfaceIndex (Get-NetIPInterface -InterfaceAlias wg_server)[0].ifIndex
Of course you can change the IPAddress
as needed
Yes it works thank you
You're welcome. Those should be the exact commands that WS4W runs. You can see the code.
https://github.com/micahmo/WgServerforWindows/blob/913f6a298f5d285a5bc62ec728a18116c987c648/WgServerforWindows/Models/NewNetNatPrerequisite.cs#L88
https://github.com/micahmo/WgServerforWindows/blob/913f6a298f5d285a5bc62ec728a18116c987c648/WgServerforWindows/Models/NewNetNatPrerequisite.cs#L94
I have a similar Problem. NAT is disabled and I get a 169... IP Adress on the WireGuard Adapter.. Then I manually change it to 10.253.0.1 but after Restart (guess the Interface is removed and created again each reboot) I have the same problem.. I don't want Clients to have Network and Internet Access, they should only have access to the WireGuard Server Computer..