# Create vitual ethernet Interface

**URL:** <https://forums.balena.io/t/create-vitual-ethernet-interface/6005>\
**Category:** Product support\
**Tags:** network\
**Created:** [April 13, 2019, 3:34pm UTC](https://forums.balena.io/t/create-vitual-ethernet-interface/6005 "2019-04-13T15:34:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![danielboe](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/danielboe/32/1755_2.png) [@danielboe](https://forums.balena.io/u/danielboe)\
**Post date:** [April 13, 2019, 3:34pm UTC](https://forums.balena.io/t/create-vitual-ethernet-interface/6005/1 "2019-04-13T15:34:00Z")

</div>

Hi,  
I would like to set up a Raspberry Pi with Network (eth0) and a virtual interface on this device. The reason is two applications running on port 80 and this would be the easiest way to solve this.  
I searched around but can´t find a solution to set it up via HOST (NetworkManager) or via container . Is there an easy solution to do this or am I simply wrong and there is no way to do this with balena at the moment?

Thanks for the help!

Daniel

---

<div class="post-metadata">

**Author:** ![CameronDiver](https://avatars.discourse-cdn.com/v4/letter/c/2acd7d/32.png) [@CameronDiver](https://forums.balena.io/u/CameronDiver)\
**Post date:** [April 15, 2019, 9:05am UTC](https://forums.balena.io/t/create-vitual-ethernet-interface/6005/4 "2019-04-15T09:05:05Z")

</div>

Hey Daniel,

If I’ve understood correctly, you have two containers, and both are running a process which listens on port 80?

If this is the case, you can use the ports field of the docker-compose to forward a different host port to the container’s port 80, like so:

```auto
services:
  service1:
    ...
    ports:
       - "80:80"
  service2:
    ...
    ports:
      - "8080:80"

```

In this simple example, service1 will have port 80 on the host OS open, and service2 will have port 8080 in the host OS forwarded to port 80 within the container.

Does this help?

---

<div class="post-metadata">

**Author:** ![danielboe](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/danielboe/32/1755_2.png) [@danielboe](https://forums.balena.io/u/danielboe)\
**Post date:** [April 15, 2019, 9:10am UTC](https://forums.balena.io/t/create-vitual-ethernet-interface/6005/5 "2019-04-15T09:10:44Z")

</div>

Thanks for those information. I am aware of those features but in my case it’s required to run in different up ranges.  
What I managed now is to create a virtual interface with ifconfig via host os. But if I wand to deploy devices it would be great to automate this.

---

<div class="post-metadata">

**Author:** ![majorz](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/majorz/32/639_2.png) [@majorz](https://forums.balena.io/u/majorz)\
**Post date:** [April 15, 2019, 2:30pm UTC](https://forums.balena.io/t/create-vitual-ethernet-interface/6005/14 "2019-04-15T14:30:43Z")

</div>

Hi Daniel,

So from what I understand, you are creating an alias with `ifconfig` or `ip` that is called `eth0:0`. This is an obsolete way for doing this, since you may assign multiple IP addresses on a single interface now. You can do that with NetworkManager. If you search for NetworkManager multiple IP addresses you will come across a lot of answers. If you have any difficulties please let us know.

---

<div class="post-metadata">

**Author:** ![danielboe](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/danielboe/32/1755_2.png) [@danielboe](https://forums.balena.io/u/danielboe)\
**Post date:** [April 16, 2019, 9:30pm UTC](https://forums.balena.io/t/create-vitual-ethernet-interface/6005/16 "2019-04-16T21:30:29Z")

</div>

Okay, i solved this problem now.  
I created a second IP for my interface:

```
nmcli connection modify my-ethernet1 ipv4.addresses $ip2
nmcli connection down my-ethernet1 && nmcli connection up my-ethernet1

```

Second I manged to connect the container to this specific IP with composer:

```
ports:
  - "192.168.101.200:53:53/tcp"
(...)

```

This now exactly work as expected.

Thanks for the support here btw!

Best regards
