Networking: Difference between revisions
| Line 120: | Line 120: | ||
=== Virtualization === | === Virtualization === | ||
Sometimes | Sometimes complex network configurations with VPNs or firewall rules you may need extra configurations in order for your VMs to have network access. It is recommended to use more granular control over the ports instead of simply allowing the entire interface.<syntaxhighlight lang="nix">networking = { | ||
networking = { | |||
firewall = { | firewall = { | ||
enable = true; | enable = true; | ||
trustedInterfaces = [ | # Allows the entire interface through the firewall. | ||
# trustedInterfaces = [ | |||
]; | # "virbr0" | ||
# ]; | |||
# Allows individual ports through the firewall. | |||
interfaces = { | |||
virbr0 = { | |||
allowedUDPPorts = [ | |||
# DNS | |||
53 | |||
# DHCP | |||
67 | |||
# You may want to allow more ports such as ipv6 and other services here. | |||
]; | |||
}; | |||
}; | |||
}; | }; | ||
nat = { | nat = { | ||
| Line 136: | Line 149: | ||
]; | ]; | ||
}; | }; | ||
}; | };</syntaxhighlight> | ||
</syntaxhighlight> | |||
== IPv6 == | == IPv6 == | ||