How to manually setup networking in Linux?
How to manually setup networking in Linux?
That is only for the live environment. One question though, they have systemd-networkd and systemd-resolved services listed. They are supposed to give me DHCP and that's it? I did enable those 2 services in my Arch install but I still couldn't ping. I probably didn't take the effort to restart though.
I initially needed to configure my Ethernet connection for it to function. I activated systemd-networkd and systemd-resolved, and everything worked with successful pings. Now I want a more manual setup. The AI overlords recommended assigning a static IP, optionally setting a default gateway, and specifying DNS in /etc/resolv.conf. I followed their steps: "ip addr add 192.168.1.10/24 dev <name>" which uses a /24 subnet mask (255.255.255.0). I understand my LAN is on 192.168.1.X, as the router is accessible at 192.168.1.1. I didn’t set a default gateway since it’s optional, but I’ll try this time. In /etc/resolv.conf I added "nameserver 8.8.8.8" for Google DNS. I’m writing this because it didn’t work and I couldn’t ping. Are the configurations applied immediately after editing resolv.conf, or do I need to start both services? Is a default gateway required?
Yes, you can connect beyond your local network. Being part of a network isn't required if you aim to access the internet. Going low-level gives you precise guidance, while reaching the internet isn't essential for linking computers together.
Using iproute2 means relying on an external tool, which is included in the kernel but isn't permanent. Keep in mind that without a DNS server, systemd-resolved lacks DNSSEC support or caching. It's also worth noting that systemd-networkd depends on iproute2, similar to how it relies on base.
Refer to the networkd documentation; these guides often fall short but work in simple scenarios. For basic IP and gateway setup, you're good. If you don't need networkd running, automate your IP commands and create a service that boots the script at startup. A static resolv.conf file works fine for DNS settings. To enable Wi-Fi, tools like wpa_supplicant can help—wrap it in a sudo script and add a desktop button for toggling. Using systemd doesn't lock you into its services.
You're asking about choosing between dhcpcd and systemd-networkd for network configuration.