I have a virtual machine with windows server 2012 R2 OS. This VM has 12 usable public IP addresses.

I have installed DHCP server on this machine and added IP range in Scope of DHCP.

After this, I set "Obtain IP address automatically" in network card to enable DHCP on this network interface. When I run ipconfig /all, I am seeing DHCP enabled on the network interface. But, it assigns random IP address which is neither allocated to the VM nor added in DHCP scope. Due to this VM/VPN is not accessible.

Any idea how do I assign IP from the DHCP scope to machine?

Thanks, Hardik

  • is the assigned address in the 169.254 range? An interface providing DHCP services must have a static IP, so you either need multiple interfaces (one with a static IP upon which DHCP services can reside, on the same network as the interface configured for DHCP) or assign a static to the interface in question. The DHCP client cannot reach the server port (68) until the server process loads, but it can't open a port on an interface that is not bound to an IP, so you end up with an existential loop. – Frank Thomas Sep 24 '16 at 6:46
  • Thanks, Frank. Yes, it automatically allocates random IP from range 169.254 which is completely unknown range.. I have two NIC both with static IPs (Public IPs).. A few questions: (1) Do I need Active directory to install VPN and configure DHCP? (2) Do I need to configure local IPs for VPN Or it can work on public IPs? Thanks. – Hardik V. Sep 25 '16 at 8:52
  • 169.254 addresses are a special range dedicated to zeroconf networking, and are a fallback used when no DHCP server can be reached. I don't know enough about your VPN situation, and in no way does ActiveDirectory appear to be involved. What is important is not that the IP be public or private (DHCP is all about the network segment) but that it be statically defined. I would generally recommend that an interface for a DHCP server be in the same IP range as the pool it distributes. – Frank Thomas Sep 25 '16 at 19:02
  • Here is how my VPN is setup: → I have RRAS installed in a virtual machine(Windows Server 2012 R2 OS) with 10 static IP addresses. I have two NICs on this machine. Earlier OS i.e. Windows server 2008 needed two NICs to configure VPN server. So, I added two NICs in this machine. Both NICs have static public IP addresses. RRAS is installed with NAT routing. → Now, I am connecting to this VPN server from Win 2008 machine with PPTP. I can connect to VPN without any issue. But, it assigns such Apipa IP address to client machine and I am unable to get internet access for this client machine. – Hardik V. Sep 26 '16 at 15:09
  • What I want to do is: (1) VPN should assign static public IP address from the range I have in VPN NIC(10 IP addresses ). (2) Client machine must have an internet connection and if client browses whatismyip site, it should show VPS server's IP address instead of his VPS's public IP address. – Hardik V. Sep 26 '16 at 15:09

Finally, got this fixed.. Here are the steps if someone faces the same issue.

→ Add two network cards on the machine. Keep one static with public IP addresses. And Add few local IP addresses on second network card. Set naming convention like 'Internal' and 'External' to avoid any confusion at the time of VPN configuration. → Install RRAS role and make sure that you SELECT ROUTING feature while installing RRAS role. → Once the role is installed, you will be asked for post configuration. Right click on server name on RRAS configuration wizard, select 'Configure and enable Routing and remote access'. Follow the steps on installation wizard. → In configuration, select “Virtual Private Network (VPN) access and NAT”.

→ While installation, you will be asked to select network card. Select external network that has public IPs with Internet and proceed. → In IPV4 assignment, select static IP address. Set start and end IP address. For example: to

Restart RRAS service once and try to connect from client machine. DO NOT forget to allow access to user (Which will be used for VPN connection) in network access permission.

For those, who is looking for the detailed steps by step guidance, click here. I found complete solution from this blog.

  • The link you mentioned, really helped. Thanks – Imtiaz Mar 31 '18 at 13:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.