Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversHalloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
World desk10 min

How to Use iproute2 to Manage Network Configuration on a Linux VPS

Learn a safe, repeatable iproute2 workflow for Linux VPS networking, from link and address setup through route testing, policy routing, diagnostics and reboot persistence.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use the ip command—the main iproute2 interface—to inspect and change links, addresses, routes, policy rules, neighbors, tunnels and network namespaces on a Linux VPS. A reliable workflow is to discover the provider’s interface, bring the link up, assign addresses, verify the route selected by the kernel, and only then make any policy-routing changes.

Commands run with ip change the running kernel state. They are usually temporary, so save a working configuration in the network manager or boot configuration used by your VPS distribution and provider. Keep an existing SSH session open while changing the interface or default route.

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What iproute2 controls on a VPS

iproute2 is the Linux networking toolkit that replaced most older net-tools workflows. Its central command, ip, can show or manipulate routing, network devices, interfaces and tunnels. The same command family covers several separate objects:

Object Command family What it controls
Link ip link Device state, MTU, MAC-related settings, virtual links and device creation or deletion
Address ip address (or ip addr) IPv4 and IPv6 addresses, prefixes and address lifetime information
Route ip route Destination prefixes, gateways, devices, metrics, source addresses and routing tables
Policy rule ip rule Which routing table is consulted for traffic matching source, destination, interface, mark, user or other selectors
Neighbor ip neigh ARP or IPv6 neighbor-cache entries used to resolve a next-hop link-layer address
Namespace and tunnel ip netns, ip tunnel and related subcommands Isolated network stacks and tunnel interfaces

The important operational distinction is that link state and addressing are different. An interface can be administratively up without having a usable IP address, and an address can exist on a link whose carrier or provider connection is unavailable. Route selection is a third layer: an address alone does not tell the kernel where to send traffic.

#1 Best Overall
Sale
TOZO A1 Wireless Earbuds Bluetooth 5.3 Light Weight in Ear Headphones | IPX5 Waterproof,2 Mics for AI Calls,Immersive Premium Sound Bass Headset with Charging Case,32 EQ via App Black
  • [Ultra-Lightweight Ear Buds Designed for Small Ears] Each earbud weighs only 3.7g and features a compact, ergonomic in-ear design made especially for small ears. Secure, low-profile, and comfortable for workouts, all-day wear or overnight sleeping.The ultra-slim profile sits flush in your ear with no hard edges poking or rubbing, so you can even sleep on your side without discomfort.
  • [Immersive Stereo Sound with TOZO OrigX Technology] TOZO OrigX tuning delivers clear vocals, balanced mids, and natural stereo sound for music, podcasts, and videos.
  • [Long Battery Life for Daily Use] Get up to 7 hours of playtime on a single charge, with up to 32 hours total using the charging case—ideal for workdays, commuting, and extended listening sessions.
  • [Bluetooth 5.3 & Stable Connection] Bluetooth 5.3 provides fast pairing, stable wireless performance, and reduced dropouts as you move around home or office.
  • [Deep Bass with Clear Vocals] High-performance drivers produce punchy bass while keeping vocals clean and detailed for everyday listening.

Prepare safely before changing the network

Confirm privileges and keep a recovery path

Most changes require root privileges. Use sudo for individual commands or a root shell during a planned maintenance window. Keep your current SSH connection open, and if your provider offers a serial, console or out-of-band terminal, make sure it is available before changing the management interface, address or default route.

Do not assume the interface is named eth0. VPS images commonly use predictable names such as ens3, but the provider can choose another name. Discover it first and substitute the actual device in every example.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Take a baseline snapshot

ip -br link
ip -br address
ip route show
ip rule show
ip neigh show

Save this output with your change ticket. It gives you a rollback reference and reveals whether the system already has multiple interfaces, secondary addresses, custom tables or non-default rules.

Discover interfaces and addresses

Read link state in a compact form

ip -br link

The compact output lists each device, its administrative state and a short description. Look for the provider-facing device and note whether it is UP. A device being up means the kernel has enabled it; it does not prove that the VPS provider has supplied carrier, an address or a working route.

For counters and detailed flags, inspect one device:

ip -s link show dev ens3

Packet and error counters help distinguish a local configuration problem from a failing or disconnected path. Increasing receive or transmit errors warrant checking the provider’s virtual NIC and MTU settings before changing routes.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Read assigned IPv4 and IPv6 addresses

ip -br address
ip address show dev ens3

Check the prefix length, not just the address. A /24 IPv4 address has a different directly connected network from a /32 host address. IPv6 addresses usually carry a much longer prefix and may include link-local addresses beginning with fe80::; those are useful for neighbor discovery but are not a public IPv6 address.

Rank #2
Sale
Smart Watch for Men Women Compatible with iPhone Samsung Android Phone 1.69 inch Full Touch Screen IP68 Waterproof Bluetooh Fitness Tracker Heart Rate/Sleep Monitor (Black)
  • 【IP68 Waterproof Multifunctinal Smart Watch】Torjalph fitness activity tracker smart watch is IP68 waterproof technology ,you can wear it when swimming,handwashing,it's rain-proof which means that you perform multiple exercise modes outside without worrying about sweat or rain corroding your fitness smart watch,and this watch equipped with a 230 mAh large capacity battery magnetic charging ,and this sports activity tracker watch can be used 5-7 days If fully charged.
  • 【Larger 1.83'' Full Screen Watch & Multi-dial Selection】1.83 inch full HD color touch screen smart watch for men / women provides excellent 240*284 resolution image quality ,This Bluetooth smart watch offers a better touch experience and remarkable immersion and ,more than 200 watch faces for you to choose from App"Da Fit ", you can change the dial style according to your mood to wear keeping the world on your wrist
  • 【Accurate Activity Tracker Smart Watch 】sports watch activity tracker uses sweat and dust resistant breathable silicone strap, our Fitness Tracker Smart Watch for Android iOS Phones supports 12 sports modes,walking,running,bicycle,swimming,badminton,basketball,football,rope skipping. This bluetooth calls smart watch for men women is lightweight and stylish, bringing more convenient and relaxing sports experience while also providing more protection.
  • 【Your 24 Hour Personal Daily Health Monitor】Fitness watch for women men full touch screen IP67 waterproof bluetooth smartwatch for Android iOS Phones with heart rate blood pressure monitor multifunction Andriod smart watch with steps counter sleep monitor sports fitness watch, monitoring blood oxygen saturation allows you to understand your physical condition in real time to track fitness progress ,to know your health status in time.
  • 【More Functions Bluetooth Call Smart Watch】This fitness activity smart watch full screen for iPhone and Android phones includes a bunch of new features including:The bluetooth smart watch can hang up the phone, receive and display WhatsAPP /Text /Facebook /Twitter /Messenger reminder.Support sedentary reminder, alarm clock, stopwatch, timer,weather information,music control, remote camera control compatible with Android 5.0 and above or iOS 9.0 and above smartphones.

Bring a link up or down

Enable the interface

sudo ip link set ens3 up

This changes the running link state immediately. Verify the result:

ip link show dev ens3

Disable the interface deliberately

sudo ip link set ens3 down

Taking down the SSH interface will normally terminate the session and remove connectivity through that device. Use it only from a console or when you have a second management path. The ip-link(8) manual documents these set and change operations along with creation and deletion of many virtual link types.

Add or remove IP addresses

Add a temporary address

sudo ip address add 192.0.2.10/24 dev ens3

The address is active immediately and can be tested with:

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
ip address show dev ens3
ip route show table local

The kernel normally creates a local-table entry for an assigned address and a connected route when the prefix permits one. The exact connected-route behavior depends on the prefix and existing configuration, so inspect the table rather than assuming it.

Remove an address

sudo ip address del 192.0.2.10/24 dev ens3

Delete the exact address and prefix you added. Removing the provider-assigned management address can disconnect every service, including your current SSH session.

Use IPv6 syntax correctly

sudo ip -6 address add 2001:db8:1234::10/64 dev ens3
ip -6 address show dev ens3

Use the -6 selector when you want IPv6-only output or operations. Do not copy an IPv4 gateway or prefix into an IPv6 command; IPv6 next hops and routes use IPv6 addresses and may require a link-local gateway with an explicit device.

Inspect and change routes

Read the main routing table

ip route show
ip -4 route show
ip -6 route show

By default, normal routes are inserted into the main table, table ID 254. A typical table contains one or more connected network routes and a default route. Each route can include a device, a gateway, a metric and an optional preferred source address.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
New Bee Guitar Cable 10ft Electric Instrument Bass AMP Cord
  • [Low Noise High Fidelity] New bee guitar cord with 22AWG oxygen-free-copper center conductors provides enhanced signal transfer, the PVC insulation material and the high-density stranded copper double shield provide noise rejection for quiet operation
  • [Ideal for Choice] New bee 1/4 straight and right angle metal connectors, ensures a secure connection in any instrument, pedal, or amp jack. L shape great fro on stage guitar stands
  • [Wide Compatible] Suitable for mixer, power amplifier, microphone, effector, decoder, equalizer, electoronic organ, electric guitar, electric bass and other electronic equipments. Widely used in the installation of smart home, karaoke speaker, professional stage audio, etc
  • [Easy Disassemble] Making incidental repairs quick and easy! Very nice, flexible cable
  • [Dont Hesite to Order] 24 hours customer services and professional technology team are standing by

Test the kernel’s actual path

ip route get 1.1.1.1
ip route get 8.8.8.8 from 192.0.2.10

ip route get performs a lookup for a hypothetical packet and reports the selected device, next hop, source address and table decision. It is more useful than reading a route list when several prefixes, metrics or policy rules overlap. For IPv6, use ip -6 route get 2001:4860:4860::8888.

Add or replace a route

Use replace when a configuration may already contain the route. It creates the route if absent and updates it if present, making repeated runs predictable:

sudo ip route replace 198.51.100.0/24 via 192.0.2.1 dev ens3

To set a default route temporarily:

sudo ip route replace default via 192.0.2.1 dev ens3

The gateway must be reachable through the specified device according to the address and connected routes. If the provider uses a host route or an unusual point-to-point setup, follow that provider’s documented gateway arrangement instead of forcing a conventional subnet assumption.

Delete a route

sudo ip route del 198.51.100.0/24 via 192.0.2.1 dev ens3

Specify enough attributes to identify the intended route. If multiple routes have different metrics or sources, first display the table and then remove the exact entry.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Save and restore route state for a maintenance task

The ip-route(8) manual documents save and restore. They can capture route objects for a controlled runtime rollback, but they are not a replacement for the distribution’s persistent network configuration. Treat saved output as an operational artifact, not as a boot-time service.

Understand policy routing before adding rules

Normal routing asks the main table for the longest matching destination prefix. Policy routing adds an ordered routing-policy database (RPDB): each rule tests selectors and directs matching traffic to a table. Use it when one main table cannot express the requirement, such as source-specific egress on multiple uplinks, separate tenant networks or a VPN path that should apply only to selected traffic.

Know the default rules and priorities

Priority Table Meaning
0 local (255) Local addresses, broadcast and locally connected destinations
32766 main (254) Normal administrator-managed routes
32767 default (253) Fallback table, normally empty unless you add routes

The kernel configures these three rules at startup. Lower numeric priorities run first. A custom rule with priority 100 therefore runs before the normal main-table rule at 32766. Always inspect the existing order:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
BSIMB 15.6" Digital Family Calendar & Chore Chart, No Subscription Fees
  • Digital Family Calendar: BSIMB digital calendar wall touch screen puts an end to your chaotic life. Designed for busy families, the digital calendar keeps you organised and in step with your family. Assign different colours and tasks to each family member to make family scheduling easier and more intuitive.
  • Easy Setup and Auto-Sync: Plug in, connect to WLAN and auto-syn your electric calendar in minutes. Digital wall calendar compatible with Google calendar, iCloud calendar, Outlook calendar, Cozi calendar and Yahoo calendar. Add events directly on the device or through the ecalendar app. Electronic calendar stays current whether you're at work or traveling—no manual updates needed.
  • All-In-One Home Assistant: Smart calendar builds habits and encourage independence with personalised chores. Display daily meal plan to reduce the daily ‘What's for dinner?’ stress. To-do lists keep track of everything you want. Turning chores into valuable achievements with stars and rewards, making life easier and more enjoyable.
  • Manage Anytime Anywhere: BSIMB electronic calendar for family stay connected with the powerful ecalendar app. Access and manage your digital wall calendar anytime, anywhere with free features like stars & rewards, photo screensaver, chore charts, meals plans, to-do lists etc. Electronic planner paid features like Magic Import tailor advanced tools for users with special needs.
  • Stay in Touch with Loved Ones: Share photos or videos from your phone to electronic wall calendar with app, instantly update your life moment, and keep in touch with your family, especially those who are far away; you can also surprise your smart calendar digital wall by sending him a wish card; it's also great for keeping tech-illiterate elders in touch with the youngsters.
ip rule show

Create a source-specific table

Give a custom table a name in /etc/iproute2/rt_tables so future output is readable:

sudo sh -c 'echo "100 isp2" >> /etc/iproute2/rt_tables'

Then add the connected and default routes to that table and bind traffic sourced from the second address to it:

sudo ip route add 203.0.113.0/24 dev ens4 src 203.0.113.10 table isp2
sudo ip route add default via 203.0.113.1 dev ens4 table isp2
sudo ip rule add from 203.0.113.10/32 priority 100 table isp2
ip rule show
ip route get 8.8.8.8 from 203.0.113.10

The connected route is important: without a route to the gateway’s network in the custom table, the default gateway may not be considered reachable in that lookup. Test with ip route get using the source address that should trigger the rule.

Selectors available to rules

The ip-rule(8) manual supports selectors for source and destination prefixes, incoming and outgoing interfaces, firewall marks, UID ranges, protocols and ports, among other fields. Keep rules narrow: a broad rule can capture traffic intended for local services, a management network or a VPN. Choose explicit priorities and document the reason for each one.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Remove a policy rule safely

sudo ip rule del from 203.0.113.10/32 priority 100 table isp2
sudo ip route flush table isp2

Flush only a table you own. Never flush the local or main table on a production VPS unless you have a tested recovery method.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Neighbors, sockets and layered troubleshooting

When a VPS cannot reach a destination, identify the failing layer instead of repeatedly changing routes.

Symptom Commands Likely next check
Interface is administratively down ip link show dev ens3 Bring it up with ip link set; verify provider-side attachment
No expected address ip address show dev ens3 Correct the address and prefix; check the provider allocation
Wrong path or source address ip route show table main, ip rule show, ip route get DESTINATION Inspect table order, longest-prefix matches, metrics and policy priorities
Gateway does not resolve ip neigh show dev ens3 Check the connected route, gateway address, VLAN/provider setup and ARP or IPv6 neighbor state
Path works but service is unreachable ss -lntup Confirm the daemon listens on the intended address and port; then inspect host and provider firewalls
Intermittent or one-way traffic ip -s link show dev ens3, ip route get in both directions where possible Look for interface errors, asymmetric policy routing, MTU problems or filtering

Inspect the neighbor cache

ip neigh show dev ens3

For IPv4, neighbor entries represent ARP resolution; for IPv6 they represent neighbor discovery. An entry that remains unresolved can indicate a wrong gateway, missing connected route or provider-level isolation. Clearing a stale entry can be a diagnostic step, but it does not repair an incorrect route.

Check listening services

ss -lntup

This lists listening TCP and UDP sockets and the processes that own them. A correct route cannot make a service reachable if it listens only on loopback, uses a different port, or is blocked by a firewall.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Temporary versus persistent configuration

Interactive ip commands modify the running kernel. They normally disappear on reboot, and a restart of the VPS provider’s networking service may also replace them. The iproute2 manuals describe the runtime objects and operations; they do not define one persistence mechanism for every distribution or VPS provider.

Convert a tested change into boot configuration

  1. Apply the change interactively and verify the address, route, rule and service path.
  2. Record the exact interface name, prefix, gateway, table ID or name, rule priority and any source address.
  3. Encode those values in the network manager or boot configuration used by the installed distribution and the VPS provider.
  4. Reload or reboot only from a console-capable maintenance window, keeping an existing SSH session open until the new configuration is proven.
  5. After reboot, run ip -br address, ip route show, ip rule show and ip route get again. Confirm that intended routes and rules, rather than only the interface state, survived.

Do not leave temporary test addresses or routes in place if they should not survive the maintenance window. Remove them explicitly before handing the system back to operations.

IPv4, IPv6 and multi-interface decisions

Single-interface VPS

For one uplink and one default gateway, keep the design in the main table. Discover the interface, bring it up, assign the provider address, verify the connected route and replace the default route only when the provider’s instructions require it. Policy rules add complexity without improving a simple topology.

Multiple interfaces or uplinks

Use separate tables and source- or interface-based rules when replies must leave through the same uplink on which they arrived, or when different source addresses require different gateways. Test both locally generated traffic and forwarded traffic if the VPS is acting as a router. Check reverse-path filtering and firewall policy separately; a correct iproute2 configuration does not override those controls.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

IPv6-specific checks

Repeat discovery and route tests with -6. Verify that the global address, prefix, default route and neighbor resolution are present. If a rule is intended for both protocol families, create and test the IPv4 and IPv6 forms explicitly; an IPv4 rule does not automatically govern IPv6 traffic.

A repeatable change and rollback procedure

  1. Discover: run ip -br link and ip -br address; identify the management device and current addresses.
  2. Snapshot: save ip route show, ip rule show and ip neigh show output.
  3. Change one layer: set link state, then address, then route. Do not change all three at once when troubleshooting.
  4. Verify locally: use ip address show, ip route get and ip neigh show.
  5. Verify the service: use ss -lntup and an application-level test from an independent host.
  6. Apply policy routing last: add the table routes, then the rule, and test with the exact source or destination selector.
  7. Rollback: delete the temporary rule, route and address in reverse dependency order, or restore the known-good configuration from your console session.
  8. Persist only after validation: place the final values in the distribution/provider network configuration and repeat the verification after reload or reboot.

Common mistakes to avoid

  • Assuming eth0 exists: use the device name shown by ip -br link.
  • Confusing link state with connectivity: an UP link still needs a valid address, neighbor resolution and route.
  • Changing the default route over SSH without a console: a single typo can strand the session and the VPS.
  • Adding a policy rule without its table’s connected route: the custom default gateway may be unusable.
  • Ignoring priority order: a lower-numbered rule can divert traffic before the main table is consulted.
  • Expecting runtime commands to survive reboot: persist the validated state through the platform’s network manager.
  • Diagnosing an application failure as a routing failure: verify listening sockets and firewall policy after the path is confirmed.
  • Using broad flush commands: limit deletion or flushing to the specific route, rule or custom table under maintenance.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.