# How to assign static IP to Pynq board?

**URL:** <https://discuss.pynq.io/t/how-to-assign-static-ip-to-pynq-board/1344>\
**Category:** Support\
**Created:** [June 11, 2020, 6:48am UTC](https://discuss.pynq.io/t/how-to-assign-static-ip-to-pynq-board/1344 "2020-06-11T06:48:09Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![awais980](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/awais980/32/955_2.png) [@awais980](https://discuss.pynq.io/u/awais980)\
**Post date:** [June 11, 2020, 6:48am UTC](https://discuss.pynq.io/t/how-to-assign-static-ip-to-pynq-board/1344/1 "2020-06-11T06:48:09Z")

</div>

I have connected Pynq Z2 board with my lab’s Ethernet port. And I have got static IP from the network administrator to assign to my Pynq board. How can I assign the static IP to Pynq board.  
If I see the current output of `ifconfig`, I see `eth0` and `lo` only. `eth0` has some inet address which can not be pinged from Windows.

Any help is appreciated.

---

<div class="post-metadata">

**Author:** ![rock](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/rock/32/32_2.png) [@rock](https://discuss.pynq.io/u/rock)\
**Post date:** [June 11, 2020, 3:18pm UTC](https://discuss.pynq.io/t/how-to-assign-static-ip-to-pynq-board/1344/2 "2020-06-11T15:18:26Z")

</div>

Check `/etc/network/interfaces.d/eth0` on your board. And adjust it based on your need.

---

<div class="post-metadata">

**Author:** ![awais980](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/awais980/32/955_2.png) [@awais980](https://discuss.pynq.io/u/awais980)\
**Post date:** [June 12, 2020, 6:24am UTC](https://discuss.pynq.io/t/how-to-assign-static-ip-to-pynq-board/1344/3 "2020-06-12T06:24:11Z")

</div>

I have tried over there. I changed the address to static IP provided by administrator but it did not work. The board is not able to connect to internet. The file looks like this.

```
auto eth0
iface eth0 inet dhcp
auto eth0
iface eth0 inet static
address 192.168.2.99 (Changed this with the provided static IP)
netmask 255.255.255.0

```

---

<div class="post-metadata">

**Author:** ![cathalmccabe](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/cathalmccabe/32/3348_2.png) [@cathalmccabe](https://discuss.pynq.io/u/cathalmccabe)\
**Post date:** [June 12, 2020, 6:44am UTC](https://discuss.pynq.io/t/how-to-assign-static-ip-to-pynq-board/1344/4 "2020-06-12T06:44:42Z")

</div>

What do you mean “The board is not able to connect to internet”? Do you mean external internet, or that you can’t connect to the board over the network i.e. from Jupyter?  
If external internet, check if there is a proxy on your lab network that you need to config settings for on the board.

If you can’t connect to the board from Jupyter, for the IP, did you reboot and verify your changes?  
Did you check what the IP address is?

```auto
   ifconfig

```

Cathal

---

<div class="post-metadata">

**Author:** ![awais980](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/awais980/32/955_2.png) [@awais980](https://discuss.pynq.io/u/awais980)\
**Post date:** [June 12, 2020, 7:04am UTC](https://discuss.pynq.io/t/how-to-assign-static-ip-to-pynq-board/1344/5 "2020-06-12T07:04:09Z")

</div>

“The board is not able to connect to internet”, I cannot ping any IP from terminal which means there is no internet.  
“If external internet, check if there is a proxy on your lab network that you need to config settings for on the board.” There is no proxy on the lab’s network. We just assign static IP to PC and we can connect to internet.

“If you can’t connect to the board from Jupyter, for the IP, did you reboot and verify your changes? Did you check what the IP address is?” Yes. I rebooted the system and I can see that IP gets updated to the IP that I assign.

---

<div class="post-metadata">

**Author:** ![cathalmccabe](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/cathalmccabe/32/3348_2.png) [@cathalmccabe](https://discuss.pynq.io/u/cathalmccabe)\
**Post date:** [June 12, 2020, 7:22am UTC](https://discuss.pynq.io/t/how-to-assign-static-ip-to-pynq-board/1344/6 "2020-06-12T07:22:38Z")

</div>

This isn’t accurate, ping can be blocked on a network.

> > “The board is not able to connect to internet”, I cannot ping any IP from terminal which means there is no internet.

It might help if you can post the output of ipconfig. Can you ping the board from your host computer, and can you share the IP details of both board and computer?

If you have set the IP correctly, then this is all you need to do on the board. You might need to check with your system administrators.

Cathal

---

<div class="post-metadata">

**Author:** ![awais980](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/awais980/32/955_2.png) [@awais980](https://discuss.pynq.io/u/awais980)\
**Post date:** [June 12, 2020, 8:48am UTC](https://discuss.pynq.io/t/how-to-assign-static-ip-to-pynq-board/1344/7 "2020-06-12T08:48:53Z")

</div>

Here is the output of ifconfig:

```
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
    inet 140.115.72.167 netmask 255.255.255.0 broadcast 140.115.72.255
    inet6 2001:288:3001:70:205:6bff:fe00:c404 prefixlen 64 scopeid 0x0<global>
    inet6 fe80::205:6bff:fe00:c404 prefixlen 64 scopeid 0x20<link>
    ether 00:05:6b:00:c4:04 txqueuelen 1000 (Ethernet)
    RX packets 5639 bytes 604444 (604.4 KB)
    RX errors 0 dropped 0 overruns 0 frame 0
    TX packets 71 bytes 9744 (9.7 KB)
    TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
    device interrupt 29 base 0xb000

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
    inet 127.0.0.1 netmask 255.0.0.0
    inet6 ::1 prefixlen 128 scopeid 0x10<host>
    loop txqueuelen 1000 (Local Loopback)
    RX packets 223 bytes 22084 (22.0 KB)
    RX errors 0 dropped 0 overruns 0 frame 0
    TX packets 223 bytes 22084 (22.0 KB)
    TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

```

---

<div class="post-metadata">

**Author:** ![awais980](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/awais980/32/955_2.png) [@awais980](https://discuss.pynq.io/u/awais980)\
**Post date:** [June 12, 2020, 8:50am UTC](https://discuss.pynq.io/t/how-to-assign-static-ip-to-pynq-board/1344/8 "2020-06-12T08:50:48Z")

</div>

And here is ping result, if I try to ping [Google.com](http://Google.com)

```
ping 172.217.168.196
connect: Network is unreachable

```

---

<div class="post-metadata">

**Author:** ![marioruiz](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/marioruiz/32/2177_2.png) [@marioruiz](https://discuss.pynq.io/u/marioruiz)\
**Post date:** [June 12, 2020, 10:40am UTC](https://discuss.pynq.io/t/how-to-assign-static-ip-to-pynq-board/1344/9 "2020-06-12T10:40:30Z")

</div>

The IP address you are trying to access is not in the same subnetwork as the board IP. Have you configured the gateway? This also should be provided by the sysadmin. [https://www.cyberciti.biz/faq/linux-setup-default-gateway-with-route-command/](https://www.cyberciti.biz/faq/linux-setup-default-gateway-with-route-command/)  
What is the output of `route -n`?

Mario

---

<div class="post-metadata">

**Author:** ![awais980](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/awais980/32/955_2.png) [@awais980](https://discuss.pynq.io/u/awais980)\
**Post date:** [June 13, 2020, 3:35am UTC](https://discuss.pynq.io/t/how-to-assign-static-ip-to-pynq-board/1344/11 "2020-06-13T03:35:45Z")

</div>

Thank you. I solved the issue by flushing all IPs of `eth0` and then adding static IP with gateway.
