Configuring a network comes down to four settings on every device: an IP address, a subnet mask, a default gateway and DNS servers. Get those right, give servers a fixed address and keep the router secure, and most networks just work. This page covers the configuration steps; the terms themselves are explained in a separate guide.
Let the router hand out addresses by DHCP, and give printers, NAS boxes and servers a fixed address, ideally through a DHCP reservation. Every device needs an address in the router's subnet, the router as its default gateway, and working DNS servers. On a VPS, the provider sets the network up for you; change it only if you know exactly what you're doing, because a mistake cuts off your SSH access.
Start with Demystifying network terms: IP, gateway, subnet, netmask, DNS and more. It explains each term, CIDR notation, NAT and how to see your current settings.
1. The four settings every device needs
| Setting | Example (home or office) | What it does |
|---|---|---|
| IP address | 192.168.1.50 | Identifies the device on the local network |
| Subnet mask | 255.255.255.0 (/24) | Says which addresses are local |
| Default gateway | 192.168.1.1 | The router that carries traffic to other networks |
| DNS servers | The router, or a public resolver | Turns domain names into IP addresses |
A device can get these automatically from a DHCP server (usually your router) or you can type them in by hand.
2. Set up the router first
- Change the admin passwordand update the router's firmware.
- Choose the local subnet, for example
192.168.1.0/24, with the router at192.168.1.1. - Set the DHCP range, for example
.100to.200, leaving the addresses below it free for fixed devices. - Secure the Wi-Fiwith WPA3, or WPA2/WPA3 mixed mode for older devices, and a long passphrase. Turn off WPS.
- Put guests on a separate networkif the router supports it, so visitors can't see your office devices.
3. Static address or DHCP reservation?
Laptops and phones should stay on DHCP. Devices that others connect to (printers, NAS boxes, cameras, local servers) need an address that doesn't change.
The simplest way is a DHCP reservation: in the router, tie the device's MAC address to a fixed IP. The device still uses DHCP, but always gets the same address, and all settings stay in one place.
If you set a static address on the device itself instead, pick one outside the DHCP range and enter the mask, gateway and DNS servers by hand. Two devices with the same address cause an IP conflict, and both lose connection.
4. Configure a Linux server's network
Current Linux releases configure the network through a management tool, not by editing old files such as /etc/network/interfaces:
# Ubuntu: /etc/netplan/01-static.yaml
network:
version: 2
ethernets:
eth0:
addresses: [192.168.1.20/24]
routes:
- to: default
via: 192.168.1.1
nameservers:
addresses: [192.168.1.1]Apply it with sudo netplan try, which rolls the change back automatically unless you confirm it. On AlmaLinux and Rocky Linux use NetworkManager:
sudo nmcli con mod eth0 ipv4.method manual ipv4.addresses 192.168.1.20/24 \
ipv4.gateway 192.168.1.1 ipv4.dns 192.168.1.1
sudo nmcli con up eth0Check the result with ip addr, ip route and resolvectl status, then test with ping and dig.
A VPS's IP address, gateway and routes are set up by the provider. If you change them and get something wrong, the server drops off the network and you lose SSH access. Back up the configuration file before any change, use netplan try where you can, and open a support ticket if you need help with your VPS's network.
5. Security and maintenance
- Allow only the traffic you need through the firewall on each server; see the VPS security and optimization tips.
- Use a VPN such as WireGuard for remote access to office systems instead of opening their ports to the internet.
- Keep router and switch firmware updated, and write down your address plan (which device has which IP).
- Troubleshoot from the bottom up: link lights, then
ip addr(has the device got an address?), thenpingthe gateway, thenpinga public IP, then a DNS lookup. The step that fails tells you where the problem is.
6. Where Domain India fits
For a website, you don't configure any of this yourself on shared hosting: your domain's A record points to the hosting server, and the server's network is managed for you. See how to change your domain's DNS settings. A VPS comes with its own IPv4 address and root access when you want to manage a server's firewall and services yourself. On 19 September 2026, Domain India list prices started at ₹552 a month for VPS Starter, excluding 18% GST.
Should I use a static IP or DHCP for my devices?
Use DHCP for laptops and phones. For printers, NAS boxes and servers, use a DHCP reservation on the router so the device always receives the same address.
What default gateway should I enter?
Enter the router's address on your local network, often 192.168.1.1 or 192.168.0.1. You can confirm it with ipconfig on Windows or ip route on Linux.
Why do two devices keep losing connection at the same time?
They probably have the same IP address. Give fixed addresses only from outside the DHCP range, or use DHCP reservations.
How do I set a static IP on Ubuntu?
Create a netplan file under /etc/netplan with the address, default route and nameservers, then run sudo netplan try so the change rolls back automatically if you lose connection.
Can I change my VPS's IP address settings?
You have root access, but the IP, gateway and routes are set by the provider, and a wrong change cuts off SSH. Back up the configuration first, and ask support before changing the network on your VPS.
Ready to put a site online? Register a domain, compare cPanel hosting, or choose a VPS if you want to manage the server yourself.
Register your domain with a NIXI-accredited .IN registrar and point it at your hosting from one account.
Search domains