Interview Prep/Linux/Networking, DNS and firewalls

Traffic arrives on the second NIC of a multi-homed server but replies leave through the first NIC and get dropped.

AdvancedTroubleshootingNetworking, DNS and firewalls
Answer

Likely causes → Asymmetric routing: the single default route sends replies out the wrong interface; rp_filter or upstream firewalls drop them.

Diagnose →

ip route; ip rule
sudo tcpdump -ni eth1 port 443 &
sudo tcpdump -ni eth0 port 443
sysctl net.ipv4.conf.all.rp_filter

Fix → Policy routing so replies from eth1's IP use eth1's gateway:

ip route add default via 10.0.2.1 dev eth1 table 100
ip rule add from 10.0.2.15 table 100

Persist via NetworkManager (ipv4.routing-rules) or netplan routing-policy. Set rp_filter=2 (loose) if needed.

Prevent → Document every multi-homed host's routing design.

All Linux questions Roadmap: Linux

More on Networking, DNS and firewalls