Possible fix for networking issues on VMs
This commit is contained in:
parent
2765632fdc
commit
ae35363090
@ -1,5 +1,6 @@
|
|||||||
{ ip_address, hostname, open_ports, lib }:
|
{ ip_address, hostname, open_ports, lib }: let
|
||||||
{
|
gateway_ip = "192.168.100.1";
|
||||||
|
in {
|
||||||
# Configure hostname.
|
# Configure hostname.
|
||||||
networking.hostName = hostname;
|
networking.hostName = hostname;
|
||||||
|
|
||||||
@ -11,11 +12,11 @@
|
|||||||
systemd.services.systemd-networkd-wait-online.enable = lib.mkForce false;
|
systemd.services.systemd-networkd-wait-online.enable = lib.mkForce false;
|
||||||
|
|
||||||
networking.defaultGateway = {
|
networking.defaultGateway = {
|
||||||
address = ip_address;
|
address = gateway_ip;
|
||||||
interface = "enp6s18";
|
interface = "enp6s18";
|
||||||
};
|
};
|
||||||
|
|
||||||
networking.nameservers = [ "192.168.100.1" ];
|
networking.nameservers = [ gateway_ip ];
|
||||||
networking.firewall.allowedTCPPorts = open_ports;
|
networking.firewall.allowedTCPPorts = open_ports;
|
||||||
networking.interfaces.enp6s18.ipv4.addresses = [
|
networking.interfaces.enp6s18.ipv4.addresses = [
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user