commit
a92cfb5725
|
@ -11,6 +11,7 @@ let
|
||||||
let
|
let
|
||||||
vlanIfs = range 1 (length config.virtualisation.vlans);
|
vlanIfs = range 1 (length config.virtualisation.vlans);
|
||||||
in {
|
in {
|
||||||
|
environment.systemPackages = [ pkgs.iptables ]; # to debug firewall rules
|
||||||
virtualisation.vlans = [ 1 2 3 ];
|
virtualisation.vlans = [ 1 2 3 ];
|
||||||
boot.kernel.sysctl."net.ipv6.conf.all.forwarding" = true;
|
boot.kernel.sysctl."net.ipv6.conf.all.forwarding" = true;
|
||||||
networking = {
|
networking = {
|
||||||
|
@ -320,9 +321,14 @@ let
|
||||||
name = "MACVLAN";
|
name = "MACVLAN";
|
||||||
nodes.router = router;
|
nodes.router = router;
|
||||||
nodes.client = { pkgs, ... }: with pkgs.lib; {
|
nodes.client = { pkgs, ... }: with pkgs.lib; {
|
||||||
|
environment.systemPackages = [ pkgs.iptables ]; # to debug firewall rules
|
||||||
virtualisation.vlans = [ 1 ];
|
virtualisation.vlans = [ 1 ];
|
||||||
networking = {
|
networking = {
|
||||||
useNetworkd = networkd;
|
useNetworkd = networkd;
|
||||||
|
firewall.logReversePathDrops = true; # to debug firewall rules
|
||||||
|
# reverse path filtering rules for the macvlan interface seem
|
||||||
|
# to be incorrect, causing the test to fail. Disable temporarily.
|
||||||
|
firewall.checkReversePath = false;
|
||||||
firewall.allowPing = true;
|
firewall.allowPing = true;
|
||||||
useDHCP = true;
|
useDHCP = true;
|
||||||
macvlans.macvlan.interface = "eth1";
|
macvlans.macvlan.interface = "eth1";
|
||||||
|
@ -341,9 +347,16 @@ let
|
||||||
$client->waitUntilSucceeds("ip addr show dev eth1 | grep -q '192.168.1'");
|
$client->waitUntilSucceeds("ip addr show dev eth1 | grep -q '192.168.1'");
|
||||||
$client->waitUntilSucceeds("ip addr show dev macvlan | grep -q '192.168.1'");
|
$client->waitUntilSucceeds("ip addr show dev macvlan | grep -q '192.168.1'");
|
||||||
|
|
||||||
# Print diagnosting information
|
# Print lots of diagnostic information
|
||||||
|
$router->log('**********************************************');
|
||||||
$router->succeed("ip addr >&2");
|
$router->succeed("ip addr >&2");
|
||||||
|
$router->succeed("ip route >&2");
|
||||||
|
$router->execute("iptables-save >&2");
|
||||||
|
$client->log('==============================================');
|
||||||
$client->succeed("ip addr >&2");
|
$client->succeed("ip addr >&2");
|
||||||
|
$client->succeed("ip route >&2");
|
||||||
|
$client->execute("iptables-save >&2");
|
||||||
|
$client->log('##############################################');
|
||||||
|
|
||||||
# Test macvlan creates routable ips
|
# Test macvlan creates routable ips
|
||||||
$client->waitUntilSucceeds("ping -c 1 192.168.1.1");
|
$client->waitUntilSucceeds("ping -c 1 192.168.1.1");
|
||||||
|
|
|
@ -3,11 +3,11 @@
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
# when updating this to >=7, check, see previous reverts:
|
# when updating this to >=7, check, see previous reverts:
|
||||||
# nix-build -A nixos.tests.networking.scripted.macvlan.x86_64-linux nixos/release-combined.nix
|
# nix-build -A nixos.tests.networking.scripted.macvlan.x86_64-linux nixos/release-combined.nix
|
||||||
name = "dhcpcd-6.11.5";
|
name = "dhcpcd-7.0.8";
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = "mirror://roy/dhcpcd/${name}.tar.xz";
|
url = "mirror://roy/dhcpcd/${name}.tar.xz";
|
||||||
sha256 = "17nnhxmbdcc7k2mh6sgvxisqcqbic5540xbig363ds97gvf795kg";
|
sha256 = "1df95lv3cbs3dk718a2vyvzmv7qhpgcxzagb27ylmav96f48x5ln";
|
||||||
};
|
};
|
||||||
|
|
||||||
nativeBuildInputs = [ pkgconfig ];
|
nativeBuildInputs = [ pkgconfig ];
|
||||||
|
|
Loading…
Reference in New Issue