No internet connection
  1. Home
  2. General

Setting static IP address

By @Lb12021-04-21 13:13:24.287Z

Hello, we have an environment where all of the IP addresses on our networks have to be static. I'm readying two Tiny Pilots to send to a remote location, and they need to have the IPs set for the network where they will live (no DNS). Everything is set up, except for setting the IPs for the destination network, and disabling writing to the MicroSD cards. The problem is that after I set the IP, I won't be able to test it again on the network here, and I won't have access to it in the remote location. I'm not that familiar with Linux, so is there someone who can help me set the IP addresses, and any other network information (default gateways, subnet masks, etc.) that has to be correct on the first try, when they boot it up there? Also, once I set the static IP here, can I still SSH in using the host name, and a wireless router with a different IP network than the static IP for the Tiny Pilot, to disable writing to the MicroSD card?
Thanks for your help.

  • 1 replies
  1. Michael Lynch @michael2021-04-21 21:43:48.032Z

    Interesting scenario!

    To set up a static IP, you can open /etc/dhcpcd.conf and add lines to specify the network configuration.

    In this example, the static IP I'm requesting is 10.0.0.222 and the router is at 10.0.01.

    interface eth0
    static ip_address=10.0.0.222
    static routers=10.0.0.1
    static domain_name_servers=10.0.0.1
    

    If you look in the examples of that file, you can see another option for a hybrid configuration where it tries DHCP first and falls back to a static IP if DHCP is unavailable. That might be useful for your scenario.

    Also, once I set the static IP here, can I still SSH in using the host name, and a wireless router with a different IP network than the static IP for the Tiny Pilot, to disable writing to the MicroSD card?

    No, if you're on a different network, you won't be able to access the device by hostname unless you configure the TinyPilot to join your VPN.

    Does the remote location have Internet access? If it does, I'd recommend setting up Tailscale on the TinyPilot and on your client machine. That way, you'll still be able to access the TinyPilot securely even when it's on a different network. If you want more control over the infrastructure, you could also use WireGuard, as Tailscale is just a friendly abstraction over WireGuard.

    You can also disable microSD writes before you ship. If you configure a static IP and then disable microSD writes, everything should still work when they boot it up at the remote location.

    I'd also recommend trying this process on a test network where you can still access the TinyPilot before you ship it off. You can set up a separate router that has the same IP subnet as the remote network you're shipping to, and that will provide an opportunity to verify that this will work how you expect.