Using bridges under NixOS: Difference between revisions

From NixOS Wiki
Klinger (talk | contribs)
Refactor page and propose deletion.
 
Line 1: Line 1:
==Using bridges under NixOS ==
{{Delete|The related bug has been fixed and the contents of this page no longer apply to a modern NixOS, which uses systemd-networkd.}}


In order to use macvtap bridges in KVM, LXC, Xen or another hypervisor on NixOS, you have to configure your DHCP server to not assign an IP address to that interface.


If you want to use macvtap bridges in KVM, LXC, Xen or $hypervisor on NixOS you have to tell your
By default, the DHCP server on NixOS configures every interface with an IP.
dhcp server to not configure that interface with an ip.
Yes exactly the dhcp server on NixOS configures every interface as long it has been told to not to.


If you are running dhcpcd then you have to define
== Configuration ==
networking.dhcpcd.denyInterfaces = [ "macvtap0@*" ]
for example.


What is the error you get when layer 2 bridges have IPs?
If you are running <code>dhcpcd</code>, then you have to define a <code>denyInterfaces</code> parameter:
[https://serverfault.com/questions/959667/kvm-bridge-networking-first-arp-packet-gets-answered-by-wrong-host stackoverflow issue]
{{file|configuration.nix|nix|
<nowiki>
{
  networking.dhcpcd.denyInterfaces = [ "macvtap0@*" ];
}
</nowiki>
}}
{{Evaluate}}


Open bug: https://github.com/NixOS/nixpkgs/issues/67966
 
Issue {{issue|67966}} is relevant for DHCP and bridging.


[[Category:Virtualization]]
[[Category:Virtualization]]

Latest revision as of 22:21, 27 October 2024

In order to use macvtap bridges in KVM, LXC, Xen or another hypervisor on NixOS, you have to configure your DHCP server to not assign an IP address to that interface.

By default, the DHCP server on NixOS configures every interface with an IP.

Configuration

If you are running dhcpcd, then you have to define a denyInterfaces parameter:

configuration.nix
{
  networking.dhcpcd.denyInterfaces = [ "macvtap0@*" ];
}


Issue #67966 is relevant for DHCP and bridging.