
What Happens When Your PC Has Multiple NICs?
An interactive deep-dive into how your OS decides which Network Interface Card — and which router — to use when you browse the internet.
Ever plugged in two network cables into your PC — maybe one to your home router and one to a lab switch — and wondered: which one does the OS actually use? 🤔
It turns out, the answer is beautifully deterministic. Your OS doesn't guess. It consults a silent rule-book that's been sitting there the whole time: the Routing Table.
The Setup
Imagine your machine has two NICs:
| Interface | IP Address | Connected To |
|---|---|---|
| NIC-1 | 192.168.1.10 | Router-1 (ISP A) |
| NIC-2 | 192.168.2.20 | Router-2 (ISP B) |
Both routers have internet access. Both NICs are up. So when you open google.com — who handles it?
Step Through It Interactively
Click through the demo below and watch the packet travel in real time. Pay close attention to the routing table — especially the metric column.
| Destination | Gateway | Interface | Metric | Note |
|---|---|---|---|---|
| 192.168.1.0/24 | — | NIC-1 | 100 | Local LAN-1 |
| 192.168.2.0/24 | — | NIC-2 | 200 | Local LAN-2 |
| 0.0.0.0/0 | 192.168.1.1 | NIC-1 | 100 | Default ✅ WINNER |
| 0.0.0.0/0 | 192.168.2.1 | NIC-2 | 200 | Default (backup) |
ip route add (Linux) · route ADD (Windows) · NIC-2 auto-takes over if NIC-1 dies = failover · Both NICs active at once = policy-based routingThe Key Concept: Metric
The metric is a cost value. Think of it like a preference score — lower is better. When two routes exist for the same destination (0.0.0.0/0 = the whole internet), the kernel picks the one with the lower metric.
# Linux: view your routing table
$ ip route show
# or the older style
$ route -n
Kernel IP routing table
Destination Gateway Iface Metric
0.0.0.0/0 192.168.1.1 eth0 100 ← WINNER
0.0.0.0/0 192.168.2.1 eth1 200
192.168.1.0/24 0.0.0.0 eth0 100
192.168.2.0/24 0.0.0.0 eth1 200
What Happens When NIC-1 Dies?
If the link on NIC-1 goes down, the kernel detects it (via netlink events) and removes its routes from the table. NIC-2's route is now the only default route — it automatically takes over.
That's called failover, and it happens with zero manual intervention.
# Simulate: manually remove NIC-1's default route
$ sudo ip route del default via 192.168.1.1 dev eth0
# Now NIC-2 is the only default route
$ ip route show
0.0.0.0/0 via 192.168.2.1 dev eth1 metric 200
Want Both NICs Active Simultaneously?
That's Policy-Based Routing (PBR) — you define rules that say things like:
- "Traffic from 192.168.1.10 → always go via Router-1"
- "Traffic from 192.168.2.20 → always go via Router-2"
# Create two separate routing tables
$ echo "200 isp1" >> /etc/iproute2/rt_tables
$ echo "201 isp2" >> /etc/iproute2/rt_tables
# Add routes to each table
$ ip route add default via 192.168.1.1 table isp1
$ ip route add default via 192.168.2.1 table isp2
# Add rules to match source IPs to tables
$ ip rule add from 192.168.1.10 table isp1
$ ip rule add from 192.168.2.20 table isp2
Now both NICs carry real traffic simultaneously — no failover, just parallel routing. 🔥
Windows Equivalent
On Windows, metric is configured per adapter:
# View routing table
> route print
# Add a static route
> route ADD 0.0.0.0 MASK 0.0.0.0 192.168.1.1 METRIC 100
# Or via GUI:
# Control Panel → Network Adapters → IPv4 Properties
# → Advanced → Automatic metric (uncheck to set manually)
Summary
| Scenario | Behaviour |
|---|---|
| Both NICs up | Lower metric NIC handles all internet traffic |
| Primary NIC goes down | OS auto-switches to backup NIC (failover) |
| Policy-based routing | Both NICs active, traffic split by source IP or mark |
| Manual override | ip route add / route ADD lets you force a path |
The OS routing subsystem is one of those quiet, invisible workhorses — running every time you send a single byte — and it's elegant once you see how it works.
If you found this useful, you might also enjoy my posts on VLAN tagging and how NAT really works.