Free tech learning for everyone, from basics to pro

Routing & SwitchingNetworking SecurityIntermediate

Routing on hosts and servers: default gateways, multiple NICs and static routes on Windows and Linux

In short: Hosts route too. Each one checks its own routing table to choose an interface and a gateway. A server with several network cards should have one default gateway, plus static routes for the specific networks reachable through the other cards. Adding a second default gateway, or forgetting a return route, creates asymmetric routing that firewalls and stateful services drop.

Every host has a routing table

A PC with one network card has a simple table: its own subnet is directly connected, and everything else goes to the default gateway. Servers often have more: a production network, a management network, a backup network and maybe iSCSI storage. Each extra card adds a connected route, and the question becomes "which way should traffic to other networks go?"

One default gateway or several routesTypical hostOne NIC, one gatewayEverything to the routerNothing to configureMost PCsMulti-homed serverTwo or more NICsStatic routes per networkOnly one default gatewayBackup, storage, management
Figure 1. Hosts with several network cards need careful routing, or replies leave through the wrong interface.

Rule 1: one default gateway

Set the default gateway on one interface only, normally the production one. Windows will let you add a gateway on every NIC, and Linux with DHCP on several interfaces may install several defaults. The host then picks one by metric, and replies may leave through a different interface from the one the request arrived on.

Rule 2: specific routes for the other networks

If backup servers live in 10.80.0.0/16 and are reachable through the backup NIC's gateway 10.70.0.1, add a static route for just that network.

Windows (run as administrator):

route print
route -p add 10.80.0.0 mask 255.255.0.0 10.70.0.1
:: or with PowerShell
New-NetRoute -DestinationPrefix 10.80.0.0/16 -InterfaceAlias "Backup" -NextHop 10.70.0.1

-p makes the route persistent across reboots.

Linux (temporary):

ip route
ip route add 10.80.0.0/16 via 10.70.0.1 dev ens224

To make it permanent, add it to the network configuration: in Netplan under routes: for that interface, or with nmcli connection modify Backup +ipv4.routes "10.80.0.0/16 10.70.0.1" on NetworkManager systems.

Asymmetric routing and how it bites

Imagine a monitoring server in 10.90.0.0/24 polls a server's management interface. The server receives the request on its management NIC, but its only route to 10.90.0.0/24 is the default gateway on the production NIC, so the reply leaves that way. If a firewall sits on either path, it sees only half of the conversation and drops it. The fix is a static route on the server sending 10.90.0.0/24 back out of the management NIC. Linux can also use policy routing (ip rule with separate tables) to reply from the interface a request arrived on.

Checking a host's choice

  • Windows: Find-NetRoute -RemoteIPAddress 10.80.1.5 shows the interface and next hop chosen.
  • Linux: ip route get 10.80.1.5 does the same.
  • Then capture traffic on each NIC with Wireshark or tcpdump -i ens224 to confirm requests and replies use the same interface.

Real-world example: backups at the wrong speed

A file server had a 10 Gbps backup NIC, but nightly backups crawled at about 900 Mbps. The backup server was in a different subnet, and the file server had no route for it, so backup traffic left through the 1 Gbps production NIC and default gateway. Adding a persistent route for the backup network via the backup NIC made the next night's job finish in a fifth of the time.

Practice

Why should a multi-homed server normally have only one default gateway?
With several defaults the host may send replies out of a different interface from the one the request arrived on, causing asymmetric routing.
Which Windows option makes a static route survive a reboot?
The -p (persistent) option on route add.
Which Linux command shows the interface and next hop chosen for a destination?
ip route get <address>.

Key takeaways

  • Hosts have routing tables and choose interfaces just like routers.
  • Configure one default gateway and add specific static routes for other networks.
  • Make routes persistent with route -p, Netplan or NetworkManager.
  • Asymmetric routing on multi-NIC servers breaks connections through firewalls.
Tracks your learning on this device only. See your progress on the learning paths.
Verified author✓ Valid
Issued to
Mohamed Fayas
Role
Founder of FM TecHub
Credentials
CCNABTEC HND Network EngineeringBEng (Hons) Computer Networking & Cloud Security
Issuer
FM TecHub · fmtechub.com

He writes practical, plain-English guides on networking, security and cloud.

More about the author →

Original content written by Mohamed Fayas for FM TecHub. © 2026 FM TecHub. You're welcome to share a link to this page; please don't copy the text elsewhere without permission.

Email updates: coming soon

New notes, tools and security news from FM TecHub by email, explained simply. Free. We're not collecting email addresses yet; see our privacy policy.

PortServiceStatus
SMTP/25Email updatesopening soon

Meanwhile, stay connected: