Hi, this is a very basic guide on how to setup static ipv4 addressing in linux using the iproute2 tools (ip command).
I wanted to do something for the Artix community as I like this distro. First it was a FDE install guide that I had in mind, but we already have that in the wiki, so I figured this might me a good alternative.
Why do this?
Less bloat: No more network management software.
Knowledge is always a good thing to have.
Important: this doesn’t cover a lot of networking fundamentals it is just the very bare minimum to be able to do static ip address configuration.
I believe one must learn some basic concepts: binary, IPv4 address to binary conversion, and then IPv4 address structure, routing(gateway) and private addresses. This resource guide will cover that.
I hope that what I'm trying to convey/teach reaches because the restrictions for me are: Easy to understand even for grade school level, yet as accurate as possible, while also trying to make it not a wall of text as much as possible. This take about 30 minutes overall to absorb. Good luck!
Binary
Each IPv4 address you see is made up of 4 groups of numbers ranging from 0-255 separated by decimals(this is known as the dotted-decimal notation format). And each of these sections are 8 bits in length. These sections are called octets (or octet individually).
Note on octets: Some bytes have different bit sizes (due to historical reasons). So to make a clear distinction that we’re referring to eight-bit byte and for networking as well, the term octet is used. So IPv4 addreses are 4 octets or 4 bytes in length
Figure A. (ipv4 to binary)

In reality IP addresses are really just binary numbers (this includes IPv6), but is presented in a way that’s more human-readable.
So to understand an IP address structure one must first understand on how to count/read/write in binary.
Here is a very good resource on how to read or write binary:
https://www.youtube.com/watch?v=R8bdSWiBsfw (4-minute video)
Note for the video above: IP addresses uses 8 bits while the video only includes the 6 bits. Even if the numbers are zeroes it is still included. See the binaries in figure A, B, or C.
More resources (if the first isn’t enough) for learning binary:
https://www.youtube.com/watch?v=puaaRoWL-Ec (6-minute video)
https://en.wikipedia.org/wiki/Binary_number#Counting_in_binary (2 to 4-minute read) (More detailed too.)
Address Conversion
Let’s use what we learned(binary) for in IP addresses
IPv4 address to/from binary conversion:
https://www.youtube.com/watch?v=SDG3exslzio (5-minute video. It is slow, but it is good. Try watching at 1.5 speed or faster.)
More resources (if the first isn’t enough) for IPv4 address to/from binary conversion:
https://www.youtube.com/watch?v=kHceSB1X-R0 (2 and a half-minute video.)
https://www.youtube.com/watch?v=sqyW3W1Wpsw (2 and a half-minute video. No audio, but is self explanatory.)
Practice:
I recommend doing IPv4 to binary conversion of 3-5 ip addresses everyday for 1-2 weeks.
A reference point for practice:

Use random ip address generator: https://whatismyip.org/random-ip-generator/
And then check your answers with: https://whatismyip.org/binary-to-ip-converter/
IPv4 address structure
Figure B.

Figure C.

An IPv4 address has 2 parts: The network portion and the host portion.
Think of the network portion as a hotel/motel, and the host portion of being the overall amount of rooms it can rent out (maximum capacity).
The subnet mask defines which part of the IP address bits is the network bits and the host bits:
Bits set to 1 in the subnet mask = network bits
Bits set to 0 in the subnet mask = host bits
If you look at Figure B and C at the binary form of the subnet mask, you notice that all bits set to 1 are aligned with the network bits.
Then all bits set to 0 aligns with the host bits
The number after the slash(in red) is the subnet mask but in CIDR notation (see the note below).
Subnet mask configuration is done by flipping the binary to 1 from left to right. (See the binary bits of the subnet mask in Figure B and C).
Note: Depending on the program and/or the operating system, the subnet mask is presented and/or configured either in the /<prefix length> (this is known as the CIDR notation) or in the dotted decimal notation format.
Note: subnet mask, netmask, prefix length and network prefix length all refer to the same thing. Just different formats.
mask = dotted decimal format.
prefix = CIDR notation.
In an IPv4 address there are 2 addresses that are reserved and cannot be used:
When all host bits are set to 1, this is the broadcast address. (Used in protocols such as DHCP).
When all host bits are set to 0, this is the network address. (also called network prefix or network ID)
This IP address is for the network itself. For example: a device using the address 192.168.1.101/24 belongs to the 192.168.1.0 network.
Going back to the analogy earlier tenant 192.168.1.101/24 is from the 192.168.1.0 hotel.
Another example: tenant 10.135.7.46/8 is from the 10.0.0.0 hotel.
Anything else in between the reserved addresses is the usable addresses for that network that you can use for your device when configuring an IP address.
Routing
This is like sending a package from this hotel to someone from a different hotel.
Default Gateways tldr: they are the routers the clients goes to when they want to send data through an external network.
External network: the network that is outside of the network (outside of networks 192.168.1.0 and 10.0.0.0 from our examples) those clients belong to.
Perspective of how routing works on a macro scale:
Say tenant 192.168.1.101/24 from the 192.168.1.0 hotel wants to send a gift to 10.135.7.46/8 from the 10.0.0.0 hotel.
From the sender(192.168.1.101) side: send it to the on-site logistics office (like fedex office in hotel) (gateway router A) (gateway router ip 192.168.1.1)
From the logistics side (gateway router A): for this package to reach hotel F (10.0.0.0 network) send it to router B
router B: for this package to reach hotel F send it to router C.
router C: for this package to reach hotel F send it to router D.
router D: for this package to reach hotel F send it to router E.
router E: for this package to reach hotel F send it to router F (hotel F gateway router).
Gateway hotel router F: this package is addressed one of our tenants in this network/hotel, it is for tenant 10.135.7.46. So I will send this to tenant 10.135.7.46.
In the micro scale:
routers have a routing table.
Think of it as an address book/spreadsheet that tells them which router(also refered to as next-hop) to go to if they receive a package for which address.
Routing works by matching the destination ip address of the data(or package from the macro example) and by looking up it’s routing table.
Note: The subnet mask is important for routing as it tells the router the network address/ID and uses that to tell the router which destination network the destination client/target belongs to. Based on the macro example above: client 101 belongs to the 192.168.1.0/24 network and client 135.7.46 belong to the 10.0.0.0/8 network
In linux’s ip route command the table would look something like this:
10.0.0.0/8 via 192.168.1.1 dev eth0
means: to send to 10.0.0.0/8 network, send it to router 192.168.1.1 in interface eth0 (See the macro scale example)
there is a special route of 0.0.0.0/0. Notice that the prefix length is zero. Which means this is for all addresses. This is the default route. This is for the default gateway.
Default route in the routing table:
default via 192.168.1.1 dev eth0
which is the same as
0.0.0.0/0 via 192.168.1.1 eth0
means: to send to any address outside of the network 192.168.1.0 send it to router 192.168.1.1 in interface eth0
To elaborate on this (default route) and subnet masks in general: the network bits are locked: Whatever number is in those network bits are taken as it is. While the host bits allow any number that is matched within ranges of the host bits. As mentioned above an IPv4 address as 32 bits in length and the prefix length defines the network bits. So in a 192.168.1.0/24 network. 24 means 24 bits are the network bits. The remaining bits are the host bits
32 - 24 = 8 bits.
See the binary reference point image in the address conversion section:
8 bits = 256 total addresses,
A 192.168.1.0/24 network would be 192.168.1.1 – 192.168.1.254 usable addresses
so for a 172.16.1.0/25 network there would only be 128 total addresses.
172.16.1.0/25 = 172.16.1.1 – 172.16.1.126 usable addresses.
Reminder: .0 and .255 as well as .127 are reserved for the network and broadcast addresses. (See IPv4 address structure section.)
think of it as fixed search filters/globbing in shells (like bash).
To demonstrate a functional equivalent example:
Prepare the materials:
Create 256 files each that starts with “192.168.1.” and “10.0.0.0” in an empty folder for demo:
$ touch 192.168.1.{0..255}
$ touch 10.0.0.{0..255}
Demonstrate:
Shell script functional equivalent of 192.168.1.0/24 routing:
$ ls 192.168.1.*
or more accurately
$ ls 192.168.1.{0..255}
Shell script functional equivalent of a default route (0.0.0.0/0):
$ ls *
The point of this demo is to show how router will process this route: 192.168.1.0/24 and will only look up the addresses/files as demonstrated by $ ls 192.168.1.{0..255}
Delete the files when done:
$ rm -r empty-folder
Private IP addresses
These addresses are:
10.0.0.0/8
172.16.0.0/12
192.168.0.0/16
These IP addresses are for anyone to use within their own network.
These do not get routed outside to the internet. So for one to be able to connect to the internet router translates these ip addresses to make it useable (formally called network address translation(NAT)). But that’s outside of the scope of this guide.
These IP addresses are free for anyone to use. You cannot self host with this with the expectation for others outside of these networks(external network) being able to reach them. Atleast not without using a service like zerotier, tailscale, some other VPS/VPN to use as a proxy, or if you have a public ip you can use for NAT.
Bonus Practice: figure out the usable address ranges of these addresses.
IPv4 iproute2 configuration
(see https://wiki.archlinux.org/title/Network_configuration for reference)
You can set this up either in RC/service scripts at boot, or through shell scripts.
Let’s go with a few assumptions:
that your interface ID in eth0
You plan to configure your PC as 192.168.1.101 and belongs to the 192.168.1.0 network with 192.168.1.1 as it’s default gateway.
To show and check your interface(s) config with their ip addresses and interface status:
ip address
or
ip address show
make sure that it says UP:
eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
not DOWN
eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state DOWN group default qlen 1000
interfaces are usually in the down (disabled state by default)
enable it: (requires sudo/doas)
ip link set eth0 up
disable it:
ip link set eth0 down
Note: it is important to enable the interface before you configure any ip addresses.
IPv4 address configuration
set it up: (requires sudo/doas)
ip address add 192.168.1.101/24 broadcast + dev eth0
note the ‘broadcast +’ portion of this command automatically calculates and configures the broadcast address for you.
Delete it: (requires sudo/doas)
ip address del 192.168.1.101/24 broadcast + dev eth0
Delete all ip address configurations for this interface: (this includes ipv6 addresses) (requires sudo/doas)
ip address flush dev eth0
for ipv4 only:
ip -4 address flush dev eth0
for ipv6 only:
ip -6 address flush dev eth0
IPv4 route configuration: (requires sudo/doas)
Default gateway:
ip route add default via 192.168.1.1 dev eth0
or
ip route add 0.0.0.0/0 via 192.168.1.1 dev eth0
Custom route sample:
ip route add 10.0.0.0/8 via 192.168.1.1 dev eth0
End note:
I hope this was not confusing and is informative. Let me know if there's some typos needed to be corrected. Or some suggestions for this resource guide.
Edit(s):
Tue Sep 2 10:35 AM UTC 2025: Added more context to Routing and Private IP addresses.