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

Add routed network mode #6175

Open
tomponline opened this issue Sep 9, 2019 · 7 comments

Comments

@tomponline
Copy link
Member

commented Sep 9, 2019

Add support for LXC's router network mode to LXD.

lxc/lxc#2921

Propose the follow:

  • New network nic type called routed (to align with existing bridged type).
  • Have it require a parent property and one or more of ipv4.address or ipv6.address (support comma delimited for multiple addresses like ipvlan).
  • If >0 IPv4 addresses supplied, then check for the same sysctls that LXC does and then configure router mode and l2proxy, with an IPv4 gateway value of "auto".
  • If >0 IPv6 addresses supplied, then check for the same sysctls that LXC does and then configure router mode and l2proxy, with an IPv6 gateway value of "auto".
@tomponline tomponline added the Feature label Sep 9, 2019
@tomponline tomponline self-assigned this Sep 9, 2019
@tomponline tomponline added this to the soon milestone Sep 11, 2019
@lxc lxc deleted a comment from zzlinwq Sep 17, 2019
@tomponline tomponline self-assigned this Sep 26, 2019
@stgraber stgraber added the Easy label Oct 3, 2019
@najeal

This comment has been minimized.

Copy link

commented Oct 3, 2019

This issue is assigned on github but is marked has "not assigned" on the forum (https://discuss.linuxcontainers.org/t/lxd-contribution/5792/4). If it's still not assigned, I would like to pick it

@stgraber stgraber assigned najeal and unassigned tomponline Oct 3, 2019
@stgraber

This comment has been minimized.

Copy link
Member

commented Oct 3, 2019

Have assigned it to you, I'm sure @tomponline will be happy to help with any question you may have, given he did the liblxc side of this work.

I think this should lead to about 5 commits, roughly doing:

  • Add a device_routed API extension to doc/api-extensions.md and shared/version/api.go
  • Extend the list of lxcExtensions in lxd/daemon.go to cover network_veth_router as needed for this feature
  • Add the implementation as lxd/device/nic_routed.go and hook it up in nic.go
  • Update the documentation in doc/containers.md
  • Add a testsuite as test/suites/container_devices_nic_routed.sh and hook it up in main.sh

nic_ipvlan.go is probably your best starting point as a template of how to add such a device, since both ipvlan and routed rely heavily on liblxc to do the setup.

The logic in nic_routed.go should be checking for that network_veth_router extension and fail environment validation if missing.

@stgraber stgraber modified the milestones: soon, lxd-3.19 Oct 3, 2019
@tomponline

This comment has been minimized.

Copy link
Member Author

commented Oct 3, 2019

@stgraber yep sounds good. Any questions @najeal let me know.

@najeal

This comment has been minimized.

Copy link

commented Oct 3, 2019

Thank!

@tomponline

This comment has been minimized.

Copy link
Member Author

commented Oct 14, 2019

Hi @najeal, how are you getting on with this change, did you manage to get LXC up and running? If not then you could try using the "edge" channel of LXD via snap (which comes with the latest version of LXC inside it) and then sideload your LXD binary into it:

move lxd binary to /var/snap/lxd/common/lxd.debug
systemctl reload snap.lxd.daemon
@najeal

This comment has been minimized.

Copy link

commented Oct 20, 2019

I will try to catch you on IRC :)

@tomponline

This comment has been minimized.

Copy link
Member Author

commented Oct 21, 2019

@najeal great, let me know any questions you have.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants
You can’t perform that action at this time.