How to Add Static Route in Linux | Ubuntu & RHEL | ip route add Command Explained

preview_player
Показать описание
In this quick and practical Linux tutorial, you will learn how to add static route in Linux — both temporarily and permanently — using the ip route add command.

We will walk through examples on Ubuntu 24.04 Server and Red Hat Enterprise Linux 9 (RHEL 9).

✅ In This Video You’ll Learn:

📌 What is a Static Route?
📌 When and why you need static routing in Linux
📌 How to use ip route add to set a temporary route
📌 How to make routes permanent with:
🟢 Netplan on Ubuntu
🔴 nmcli on RHEL / Rocky Linux

🖥️ Example Command:

sudo ip route add 192.168.50.0/24 via 192.168.1.1 dev enp0s3

📂 For Permanent Static Routes:

Ubuntu/Debian → Edit /etc/netplan/*.yaml

RHEL/Rocky Linux → Use nmcli connection modify

🔎 Use ip route show to verify static routes.

💡 Whether you're configuring Linux VMs in the cloud or an on-prem network, this guide has you covered!

👍 If you found this helpful,
✨ Like | 🔔 Subscribe | 💬 Comment below!

#Linux #Ubuntu #rhel9 #Networking #iproute #LinuxNetworking #StaticRoute #nmcli #Netplan #linuxcommands #Ubuntu24 #RHEL9 #rockylinux
Рекомендации по теме
visit shbcf.ru