# Templatefile with fixed IP

**URL:** https://forum.opennebula.io/t/templatefile-with-fixed-ip/1434
**Category:** Product Support
**Created:** [November 5, 2015, 1:58pm UTC](https://forum.opennebula.io/t/templatefile-with-fixed-ip/1434 "2015-11-05T13:58:50Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Brave](https://avatars.discourse-cdn.com/v4/letter/b/76d3ee/32.png) [@Brave](https://forum.opennebula.io/u/Brave)
#### Post date: [November 5, 2015, 1:58pm UTC](https://forum.opennebula.io/t/templatefile-with-fixed-ip/1434/1 "2015-11-05T13:58:50Z")

</div>

Hi guys,  
I am pretty sure my question is really basic but for some how I could not figure out how to achieve that from the documentation. I do some development with opennebula, therefore I need to know the IP address the vm is going to have after the deployment. Currently I am using dhcp and my vnet got 8 leases which are used randomly from my point of view!?  
Can anybody tell my what exactly to use in the template file to define a fixed IP there?

---

<div class="post-metadata">

### Author: ![knawnd](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/knawnd/32/6119_2.png) [@knawnd](https://forum.opennebula.io/u/knawnd)
#### Post date: [November 7, 2015, 10:00am UTC](https://forum.opennebula.io/t/templatefile-with-fixed-ip/1434/2 "2015-11-07T10:00:56Z")

</div>

In order to assign a certain IP address to VM I specify the following lines in VM template:

```
NIC=[
  IP="123.45.67.89",
  NETWORK_ID="2" ]
```

---

<div class="post-metadata">

### Author: ![Brave](https://avatars.discourse-cdn.com/v4/letter/b/76d3ee/32.png) [@Brave](https://forum.opennebula.io/u/Brave)
#### Post date: [November 10, 2015, 4:18pm UTC](https://forum.opennebula.io/t/templatefile-with-fixed-ip/1434/3 "2015-11-10T16:18:38Z")

</div>

Thank you!
