# Is it possible to change network config without internet

**URL:** https://discourse.nixos.org/t/is-it-possible-to-change-network-config-without-internet/14757
**Category:** Help
**Created:** [August 28, 2021, 12:38pm UTC](https://discourse.nixos.org/t/is-it-possible-to-change-network-config-without-internet/14757 "2021-08-28T12:38:43Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![mackenzie](https://discourse.nixos.org/letter_avatar_proxy/v4/letter/m/3da27b/32.png) [@mackenzie](https://discourse.nixos.org/u/mackenzie)
#### Post date: [August 28, 2021, 12:38pm UTC](https://discourse.nixos.org/t/is-it-possible-to-change-network-config-without-internet/14757/1 "2021-08-28T12:38:44Z")

</div>

Situation\_1:  
computer connected to the internet.  
Used for configuring and updating the device with the latest flake config.

```nix
  networking.useDHCP = false;
  networking.defaultGateway = "192.168.1.1";
  networking.nameservers = ["192.168.1.1"];
  networking.interfaces."enp2s0f0".ipv4.addresses = [
    {
      address = "192.168.1.121";
      prefixLength = 24;
    }
  ];

```

Situation\_2:  
computer, poe switch, ipcameras, no internet access  
Used in “production”

```nix
  networking.useDHCP = false;
  networking.interfaces."enp2s0f0".ipv4.addresses = [
    {
      # Our ipcamera subnet: 172.17.246.0/24
      address = "172.17.246.10";
      prefixLength = 24;
    }
  ];

```

If I had 2 physical interfaces they both work at the same time. But the rpi4(which will eventually run this config) has only 1.

I could:

- Test/run “Offline-configuration”
- Rollback to the “Internet configuration”  
`sudo nixos-rebuild switch --rollback`
- Remove all but current-internet-config  
`sudo nix-collect-garbage -d`
- Deploy the new configuration  
`sudo nixos-rebuild switch --flake ".#"`

Is there a way to `nixos-rebuild switch` without internet access? It’s only to change the network settings. Nothing new gets installed.

---

<div class="post-metadata">

### Author: ![TLATER](https://discourse.nixos.org/user_avatar/discourse.nixos.org/tlater/32/4257_2.png) [@TLATER](https://discourse.nixos.org/u/TLATER)
#### Post date: [August 28, 2021, 2:52pm UTC](https://discourse.nixos.org/t/is-it-possible-to-change-network-config-without-internet/14757/2 "2021-08-28T14:52:56Z")

</div>

So it’s available on your LAN and you could connect to it, it’s just blocked from the internet?

Assuming yes, you could use:

```auto
nixos-rebuild --flake --target-host 172.17.246.10 --build-host localhost --use-remote-sudo switch

```

To build on a internet-connected machine and push the results to your camera, assuming you have SSH access to it.

You’ll need to set [nix.trustedUsers](https://search.nixos.org/options?channel=21.05&show=nix.trustedUsers&from=0&size=50&sort=relevance&type=packages&query=trustedUsers) on the camera too.

If it’s completely airgapped there’s probably a way too, I thought it should work but clearly you have tried and it does not.
