Static IP & custom DNS servers
Set a static IP address and custom DNS nameservers for your MiniBolt.
Difficulty: Easy
The router reserves the IP address of the device for a time after going out, but if the device goes out soo time, the next time that the device starts, the router could assign a different IP and you could lose access to your node. To avoid this, you need to set a static IP to your node.
Be careful by setting this! If you change the router, could be the new router doesn't work in the same IP address range as the old router, the device won't be registered on the local network and will be completely out of the connection.
💡 To avoid this, you will need to enable the "Automatic (DHCP)" mode before changing the router, following the Set the DCHP (automatic) configuration to ensure that the DHCP server auto assigns an IP to the node in the range you are working on, and if you want, after router change, reconfigure the static IP address again following the Option 2 of this guide.
If you don't do this, you will have to attach the monitor screen or television and keyboard to fix this.
In addition, you can customize your DNS servers to improve your privacy, normally your ISP, gives you the router with its own DNS servers configured by default, and this does that you expose all of your navigation trackings to your ISP, affecting seriously your privacy.
Option 1: At the beginning, during the Ubuntu Server installation GUI
When you arrive at step 5 of the Ubuntu Server installation, you can want to choose set a static IP address and customize the DNS name server/s.
Wait for the router automatically assign the IP address to your MiniBolt node to find out what IP range the node is in, you will be able to assign the same or a different IP in the next step.
Subnet: your router subnet, e.g 192.168.1.0/24
Address: your assigned local IP address, eg. 192.168.1.29
Gateway: you router IP, eg. 192.168.1.1
Name servers: DNS servers choosen, eg. same of gateway (192.168.1.1,192.168.1.1) (your ISP DNS) or Cloudflare DNS server (1.1.1.1,1.0.0.1) <- (recommended)
Search domains: <left blank>
This is only an example if your local network IP range is 192.168.1.0-255,
because for this case, the router assigned to the device the IP address 192.168.1.29, but could be 192.168.0.29 (192.168.0.0-255)
, then you will need to set this instead:
Subnet: 192.168.0.0/24
Gateway: 192.168.0.1
In this step, you can set DNS name servers too, for this example, we have configured Cloudflare DNS name servers (1.1.1.1/1.0.0.1) but you could set others
Option 2: After Ubuntu Server installation (by command line)
After having done the 1.3 Remote access section, you could want to set a static IP address to your MiniBolt by the command line.
Preparations
Stay login with user admin, and check your current data network interface by doing
Check your own configuration, the next output is only an example of a concrete case, but in your case could be different:
Definitions in the case of before:
Take note of your case data, you will need it later
Check the current DNS server set, typing the next command
Example of expected output (more common):
In the case of before:
Configuration
Edit the content of the next file
Replace the content to match this template
Replace <interface>, <ipaddress>, <nameserver1>, <nameserver2> <-- (optional but recommended), and <gateway> to your own data. You can choose the DNS server (<nameserver1> + <nameserver2>) whatever you want, including the default one set in the DNS server of your router (normally DNS servers of your ISP), in this last case, you should type the <gateway> address in <nameserver1> and the same in <nameserver2>.
For this example, we have configured Cloudflare DNS name servers (1.1.1.1,1.0.0.1) <-- (recommended), but you could set others
Finally, type this command to apply the changes
Now you have set your static IP address and custom DNS servers
If you chose a different IP address than the router assigned you at first and has currently, this step could break the current SSH connection, reconnect using the new and chosen IP address
Check changes
To check the successful IP address change, type the next command
The output of this command may not change, depending on whether you chose the same IP that the router originally assigned you at first, or whether you chose to change to another
To check the successful DNS servers change, type the next command
Set the Automatic (DHCP) mode configuration (by command line)
If you go to change the router you could want to enable or check if you have enabled the automatic (DHCP) mode configuration to avoid problems
Edit the content of the next file
Replace the content to match this template, replacing <interface> with your data obtained in the Preparations section before
Finally, type this command to apply the changes
Check changes are applied correctly following the same step as before
You have gone back to the automatic (DHCP) mode configuration successfully
Last updated