In this episode, you’ll learn how to set up basic networking in VMware Workstation, and how to configure IP addresses in RHEL or Rocky Linux 9 using the command line — exactly like you’ll do in the RHCSA exam.
🧩 How Networking Works in VMware Workstation
VMware creates virtual network adapters to connect your VM to the real world.
Most common options:
Mode | Description | Use Case |
---|---|---|
NAT | VM uses host’s IP to access internet | Default mode, works for browsing |
Bridged | VM gets its own IP from your LAN/router | ✅ Best for RHCSA labs |
Host-only | VM only talks to host, no internet | For isolated labs |
✅ Recommendation: Use Bridged Adapter so your VM behaves like a real server on your network.
🛠️ Step 1: Set VM to Bridged Mode in VMware Workstation
-
Shut down your VM
-
Right-click → Settings
-
Go to Network Adapter
-
Select Bridged: Connected directly to the physical network
-
(Optional) Check: Replicate physical network connection state
-
Click OK, then Power ON the VM
🖥️ Step 2: Check Network Inside Linux (RHEL / Rocky 9)
nmcli
stands for:
Network Manager Command Line Interface
1. Check Interface Status
nmcli device status
Look for interfaces like
ens33
,enp0s3
, oreth0
2. Show IP Address
ip a
✅ If DHCP is working, your VM should get an IP like 192.168.1.X
or similar from your router.
⚙️ Step 3: Enable Interface (if no IP)
nmcli connection show
nmcli connection up ens33
Replace
ens33
with your actual interface name
If still not working:
systemctl restart NetworkManager
🔧 Step 4: Set Static IP Address (RHCSA Requirement)
In the RHCSA exam, you must know how to set a static IP using CLI.
Example (using nmcli
):
nmcli con mod ens33 ipv4.addresses 192.168.1.100/24
nmcli con mod ens33 ipv4.gateway 192.168.1.1
nmcli con mod ens33 ipv4.dns 8.8.8.8
nmcli con mod ens33 ipv4.method manual
nmcli con up ens33
🔍 Replace
ens33
with your actual interface name.
🔍 Step 5: Test & Verify Network
ip a
ping -c 3 google.com
✅ If you can ping, your networking is working.
🧠 Common Networking CLI Commands
Command | Purpose |
---|---|
| Check device status |
| List saved connections |
| Modify connection |
| Activate interface |
| View IP address |
| Check connectivity |
| Restart networking service |
🎁 Bonus: Basic Static Routing in Linux
🧠 Why Add a Static Route?
Sometimes, your VM/server needs to reach a different subnet (e.g., 10.10.10.0/24), and the default gateway (example: R1) doesn’t know where that is.
A static route tells your Linux system:
“To reach this network, send traffic through this gateway.”
🔧 1. Add Static Route – Non-Persistent (Temporary)
Pro-Tips:
Use Non persistent first and use specific route for example 10.10.10.100/32 for less destructive. In production
This method adds the route immediately, but it will be lost after reboot.
🔹 Command:
ip route add 10.10.10.0/24 via 192.168.19.1 dev ens34
Field | Meaning |
---|---|
| Destination network you want to reach |
| Gateway to reach that network |
| Your active network interface |
🔹 Check the route:
ip route show
🔐 2. Make Static Route Persistent (Survives Reboot)
For RHCSA and real servers, persistent routing is preferred.
There are two ways depending on RHEL/Rocky version:
✅ Option A: Use nmcli
(recommended for RHCSA)
nmcli connection modify ens33 +ipv4.routes "10.10.10.0/24 192.168.19.1"
nmcli connection up ens33
The
+
appends the route (so you don’t overwrite existing config)
🔍 Then check:
nmcli connection show ens33 | grep ipv4.routes
✅ Option B: Edit config file (alternative method)
For interface ens33
, edit this file:
sudo nano /etc/sysconfig/network-scripts/route-ens33
Add this line:
10.10.10.0/24 via 192.168.19.1 dev ens33
Save and exit.
Then:
sudo systemctl restart NetworkManager
🛠️ Troubleshooting Commands
Check command | What it does |
---|---|
| View current routing table |
| View active network profile |
| Reload modified connection |
| Test if route is working |
| See the routing path |