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

nixos: add support for Ubuntu Fan Networking #9188

Closed
wants to merge 1 commit into from

Conversation

cstrahan
Copy link
Contributor

@cstrahan cstrahan commented Aug 9, 2015

This provides patches (for iproute2 and the kernel) to support Ubuntu Fan Networking.

This is currently based off of the latest nixos-unstable channel; if you'd like to play around with this, it shouldn't require rebuilding too many packages.

A note about ubuntu-fan-4.0.patch and ubuntu-fan-4.1.patch: when this is ready to merge, I'll rebase onto master, remove the former and keep the latter. The master branch has iproute 4.1.1, which requires a slightly different patch than version 4.0.0.

I'm currently patching iproute and linux_3_18 unconditionally; that's only temporary while I'm testing things out.

For reference:

@cstrahan
Copy link
Contributor Author

I've rebased this onto the latest master, and split the kernel patch into two versions, one for 3.x versions of the kernel (tested with 3.18), and one for 4.x versions (I had to resolve one minor conflict).

@cstrahan
Copy link
Contributor Author

Here's an example of how Fan networking can be used with Docker:

{ config, lib, pkgs, ... }:

{
  # Enable the Fan:
  networking.ubuntu-fan.enable = true;

  # The ubuntu-fan service will load /etc/network/fan if it exists,
  # so we can configure our fans here:
  environment.etc."network/fan".text = ''
    10.0.0.0/8 172.16.3.4/16 dhcp
  '';

  # Alternatively:
  #networking.localCommands = ''
  #  ${pkgs.fanctl}/bin/fanctl up 10.0.0.0/8 172.16.3.4/16 dhcp
  #'';

  # Start docker, and use the Fan bridge:
  virtualisation.docker.enable = true;
  virtualisation.docker.extraOptions = "--bridge=fan-10-3-4 --mtu=1480 --iptables=false";

  # Use the Fan Networking patches from Ubuntu:
  nixpkgs.config.packageOverrides = super: let self = super.pkgs; in rec {
    linux_3_18 = super.linux_3_18.override {
      kernelPatches = super.linux_3_18.kernelPatches ++ [ self.kernelPatches.ubuntu_fan ];
    };
  }
}

This provides support for Ubuntu Fan Networking [1].

This includes:

* The fanctl package, and a corresponding NixOS service.
* iproute patches.
* kernel patches.

closes NixOS#9188

1: https://wiki.ubuntu.com/FanNetworking
cstrahan added a commit to cstrahan/nixpkgs that referenced this pull request Aug 13, 2015
This provides support for Ubuntu Fan Networking [1].

This includes:

* The fanctl package, and a corresponding NixOS service.
* iproute patches.
* kernel patches.

closes NixOS#9188

1: https://wiki.ubuntu.com/FanNetworking
@cstrahan
Copy link
Contributor Author

I've tested this pretty thoroughly so I'm going to merge this in now.

@cstrahan cstrahan removed their assignment Aug 13, 2015
@cstrahan cstrahan closed this in c1ee8fe Aug 13, 2015
@cstrahan cstrahan mentioned this pull request Mar 30, 2016
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant