Loading...

Lab 60: Basic Static IPv4 Setup & Connectivity Test

Configure a static IPv4 address using ip tooling, bring the interface online, and add a default route. Validate end-to-end connectivity with a controlled ping test.

network core troubleshooting

Scenario

You have been asked to configure enp1s0 with a static IPv4 address for a staging subnet and confirm the host can reach the network beyond its default gateway. Target configuration: 192.168.50.10/24 with default gateway 192.168.50.1.

Operator context

This workflow is common when validating connectivity during provisioning, temporary migrations, or controlled network testing. You are making direct, explicit changes using ip, then verifying the outcome immediately.

Objective

  • Assign 192.168.50.10/24 to enp1s0.
  • Bring enp1s0 to an UP state.
  • Add a default route via 192.168.50.1.
  • Verify external reachability with a single ICMP echo.

What You’ll Practice

  • Assigning addresses with ip addr add.
  • Managing interface state with ip link set.
  • Configuring routes with ip route add.
  • Connectivity confirmation using ping -c.

Walkthrough

Step 1 : Assign 192.168.50.10/24 to enp1s0.
Command
ip addr add 192.168.50.10/24 dev enp1s0

This adds the address to the interface. If the same address already exists, the command will fail, which is useful feedback during repeatable testing.

# Quick verification:
ip -br addr show dev enp1s0
# Expected to include:
# enp1s0 ... 192.168.50.10/24
Step 2 : Bring enp1s0 up.
Command
ip link set enp1s0 up

The interface must be UP to send/receive traffic. This is the first thing to validate before diagnosing routing or reachability.

# Confirm state:
                        ip -br link show dev enp1s0
                        # Expected:
                        # enp1s0 UP ...
                    
Step 3 : Add the default route via 192.168.50.1.
Command
ip route add default via 192.168.50.1

The default route determines where traffic goes when no more specific route matches. Without it, external pings may fail even when local addressing is correct.

# Verify routing table:
                        ip route
                        # Expected to include:
                        # default via 192.168.50.1 dev enp1s0
                    
Step 4 : Verify connectivity with one ICMP echo.
Command
ping -c 1 8.8.8.8

This confirms basic reachability beyond the local subnet. If this fails, the next checks are typically gateway reach, DNS (if pinging a name), firewall policy, and upstream routing.


                        # Expected pattern:
                        # 1 packets transmitted, 1 received, 0% packet loss

Reference

  • ip addr add <ip>/<prefix> dev <iface> : Adds an IPv4/IPv6 address to an interface.
  • ip link set <iface> up : Brings an interface up (enables link layer operation).
  • ip route add default via <gateway> : Adds a default route for outbound traffic.
  • ip -br addr show dev <iface> : Compact view of addresses assigned to a specific interface.
    • -br : Brief output format.
  • ip route : Displays the active routing table.
  • ping -c 1 <ip> : Sends a controlled number of ICMP echo requests.
    • -c 1 : Send exactly one packet (fast validation).