Permanently Changing the Default Route for Ethernet in Fedora 41
In this article, we will discuss how to change the default route for Ethernet in a Fedora 41 workstation. We will cover key concepts related to networking, default routes, and the changes required to make the new route permanent.
Default Routes
A default route, also known as the gateway, is the network node that serves as the final destination for packets that cannot be delivered to their intended destination. The default route is used to forward packets to other networks.
Changing the Default Route
To change the default route for Ethernet in Fedora 41, you can use the following steps:
- Open a terminal and enter the following command:
sudo nmcli device status - Identify the Ethernet device by looking for the "TYPE" column labeled "ethernet". Let's assume the Ethernet device is called "enp0s3".
- To set the default route, you can use the following command:
sudo ip route add default viadev enp0s3 - Replace
with the IP address of the gateway you want to use as the default route.
Making the Change Permanent
To make the change permanent, you need to modify the network configuration file. Here are the steps:
- Open the network configuration file in a text editor using the following command:
sudo nano /etc/sysconfig/network-scripts/ifcfg-enp0s3 - Add the following line to the file:
GATEWAY= - Replace
with the IP address of the gateway you want to use as the default route. - Save and close the file.
- Restart the networking service using the following command:
sudo systemctl restart network
Testing the New Default Route
To test the new default route, you can use the following command: ip route show
The new default route should be displayed as "default via
- A default route, or gateway, is used to forward packets to other networks.
- To change the default route for Ethernet in Fedora 41, you can use the
ip routecommand. - To make the change permanent, modify the network configuration file and restart the networking service.
References
- Fedora Project. (2020). Network configuration. https://docs.fedoraproject.org/en-US/fedora/f33/network-guide/
- Red Hat. (2020). Networking concepts. https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/networking_guide/concepts