Skip to content

Instantly share code, notes, and snippets.

@apeyroux
Last active October 8, 2018 13:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save apeyroux/2b54c8db090be6b882b02aae30dcb32f to your computer and use it in GitHub Desktop.
Save apeyroux/2b54c8db090be6b882b02aae30dcb32f to your computer and use it in GitHub Desktop.
networking.dhcpcd.enable = false;
networking.useDHCP = false;
networking.bridges.br0.interfaces = ["eno1"];
networking.interfaces.br0.ipv4.addresses = [ { address = "62.xxx.xxx.xxx"; prefixLength = 24; } ];
networking.defaultGateway = { address = "62.210.75.1"; interface = "br0"; };
containers.test = {
autoStart = true;
privateNetwork = true;
hostBridge = "br0";
localAddress = "212.xxx.xxx.xxx"; # ipfo
config = { config, pkgs, ... }: {
networking.firewall.allowedTCPPorts = [ 80 443 22 ];
networking.firewall.allowPing = true;
services.openssh.enable = true;
services.nginx = {
enable = true;
};
};
};
@apeyroux
Copy link
Author

apeyroux commented Oct 8, 2018

also try:

  containers.gitlab = {
    autoStart = true;
    privateNetwork = true;
    hostBridge = "br0";
    config = { config, pkgs, ... }: {
      networking.firewall.allowedTCPPorts = [ 80 22 ];
      networking.firewall.allowPing = true;
      networking.interfaces.eth0.ipv4.addresses = [{address = "212.xxx.xxx.xxx"; prefixLength = 32;}];
      networking.interfaces.eth0.macAddress = "xx:xx:00:00:xx:xx";
      networking.defaultGateway = { address = "62.210.0.1"; interface = "eth0"; };

      services.openssh.enable = true;
      services.nginx = { ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment