Learn to set a static IPv4 address, verify connectivity, and make the change persistent on a Linux system. 16.11.2025 | reading time: 2 min On the command line you can take full control: bring an interface up, assign an address, set a gateway, and test connectivity in seconds; this short guide shows the exact commands and what to check next. Hands-on example Assign 192.168.50.10/24 to interface enp0s3, set the default route and add a DNS entry like this: ```sudo ip link set dev enp0s3 up sudo ip addr add 192.168.50.10/24 dev enp0s3 sudo ip route add default via 192.168.50.1 echo "nameserver 8.8.8.8" | sudo tee /etc/resolv.conf # Verify address and route ip addr show enp0s3 ip route show default ping -c 3 8.8.8.8``` The first three commands change runtime state; the verification commands show the assigned IP, the default route and confirm reachability. Important parameters to watch Use CIDR notation for the prefix length (for example "/24"), always set a gateway when this host must reach other subnets, check the broadcast and MTU only if you face fragmentation or legacy hardware, and remember that manual changes like this are not persistent across reboots unless written to the distribution's network configuration files. Other tools worth knowing Many systems use higher-level managers: netplan on Ubuntu translates YAML to systemd-networkd or NetworkManager, systemd-networkd provides declarative unit files, NetworkManager and nmcli manage desktops and roaming, and dhclient or dhcpcd handle DHCP leases when a static address is not desired. Next steps After you can set and verify an address manually, practice making the change persistent for your distribution, explore IPv4 troubleshooting with arp and tcpdump, and script repetitive setups to speed deployment; building these skills is a concrete step toward advanced Linux networking and certifications like CompTIA Linux+ or LPIC-1, and intensive exam preparation is available at bitsandbytes.academy. Join Bits & Bytes Academy First class LINUX exam preparation. network troubleshooting infrastructure setup