Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for bridged networking (e.g. to Wi-Fi) #342

Open
kdrag0n opened this issue Jun 13, 2023 · 8 comments
Open

Support for bridged networking (e.g. to Wi-Fi) #342

kdrag0n opened this issue Jun 13, 2023 · 8 comments
Labels
f/containers Affects container users f/machines Affects Linux machine users t/feature New feature

Comments

@kdrag0n
Copy link
Member

kdrag0n commented Jun 13, 2023

Add an option to bridge machines and containers (via macvlan) to an external network interface, such as the host Mac's Wi-Fi or Ethernet. This would make Linux machines and Docker containers appear as devices on the LAN.

This is not the best networking method in most cases, so it won't be the default and generally wouldn't be recommended unless necessary. There will always be inherent compatibility issues with certain networks, for example.

@kdrag0n kdrag0n added the t/feature New feature label Jun 13, 2023
@kdrag0n kdrag0n added f/containers Affects container users f/machines Affects Linux machine users labels Jun 15, 2023
@hululu1068
Copy link

Add an option to bridge machines and containers (via macvlan) to an external network interface, such as the host Mac's Wi-Fi or Ethernet. This would make Linux machines and Docker containers appear as devices on the LAN.

This is not the best networking method in most cases, so it won't be the default and generally wouldn't be recommended unless necessary. There will always be inherent compatibility issues with certain networks, for example.在大多数情况下,这不是最好的网络方法,因此它不会是默认设置,除非必要,否则通常不会推荐。例如,某些网络总是存在固有的兼容性问题。

As you said, bridging the network allows the web host to have a separate ip address. However, it's better not to use macvlan, configuring routes can be a pain.
For example, I use the bridge mode of the NIC on my Parallels desktop and the virtual host has a separate ip address on the LAN. Other devices in the LAN can access and provide other services directly.
I hope it will be implemented soon. Go for it!

image

@gnattu
Copy link

gnattu commented Sep 1, 2023

As you said, bridging the network allows the web host to have a separate ip address. However, it's better not to use macvlan, configuring routes can be a pain. For example, I use the bridge mode of the NIC on my Parallels desktop and the virtual host has a separate ip address on the LAN. Other devices in the LAN can access and provide other services directly. I hope it will be implemented soon. Go for it!

A bridged interface have to use macOS's system bridge and by using that, you will lose the performance benefit of the orbstack's networking stack because that bridge is much slower than orbstack's.

@kdrag0n kdrag0n changed the title Support for bridging network to Wi-Fi Support for bridged networking (e.g. to Wi-Fi) Sep 5, 2023
@PilchardFriendly
Copy link

+1 for this. Homebridge is main usecase (for me).

linux example here

This example currently doesn't work in orbstack 0.17.1. Containers c1 and c2 have the right IP addresses, but there isn't a path from router to containers (or back).

@kdrag0n mentioned elsewhere this is due to NATing in the vm.

Also, docker complains about the parent interface 'en0', and expects it in the format 'eth.XX', which is linuxese. I suspect this is a feature of the libnetworking library.

To be thorough, i also added a added a 'static' ARP route in my gateway setup, to aid external discovery, but that was probably premature.

@donavanbecker
Copy link

donavanbecker commented Sep 5, 2023

+1 for any HAP projects. Homebridge/Scrypted (HomeKit Plugin)/HomeAssistant (HomeKit Integration)

@lijinghengforrest
Copy link

+1

1 similar comment
@mirkokg
Copy link

mirkokg commented Sep 24, 2023

+1

@helmut72
Copy link

For Docker containers NAT is ok, but for VMs NAT isn't always the best joice. Continue using Multipass.

@SuperKenVery
Copy link

+1 please 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
f/containers Affects container users f/machines Affects Linux machine users t/feature New feature
Projects
None yet
Development

No branches or pull requests

9 participants