<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/setting-source-ip-address-on-traffic-started-by-a-multihomed-host-ipspace-net-blog-1en4dk4kh" -->

---
title: Setting Source IP Address on Traffic Started by a...
description: When a multihomed Linux server runs BGP to detect path failures, choosing the correct source IP address for outbound traffic becomes non-trivial. Several...
canonical: https://daily.dev/posts/setting-source-ip-address-on-traffic-started-by-a-multihomed-host-ipspace-net-blog-1en4dk4kh
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Setting Source IP Address on Traffic Started by a Multihomed Host « ipSpace.net blog | daily.dev
og:description: When a multihomed Linux server runs BGP to detect path failures, choosing the correct source IP address for outbound traffic becomes non-trivial. Several...
og:url: https://daily.dev/posts/setting-source-ip-address-on-traffic-started-by-a-multihomed-host-ipspace-net-blog-1en4dk4kh
og:image: https://api.daily.dev/og/posts/1eN4DK4kh.png
og:image:alt: Setting Source IP Address on Traffic Started by a Multihomed Host « ipSpace.net blog
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Setting Source IP Address on Traffic Started by a Multihomed Host « ipSpace.net blog

**[ipSpace.net Blog](https://daily.dev/sources/ipspace)** · 4 min read · 0 upvotes · 0 comments

## Summary

When a multihomed Linux server runs BGP to detect path failures, choosing the correct source IP address for outbound traffic becomes non-trivial. Several approaches exist: using multipath-aware software (e.g., iSCSI), Multipath TCP, assigning the same IP to all interfaces, specifying source IP in the routing table via `ip route add`, using iptables/nftables SNAT rules, or simply accepting the risk for short-lived sessions. Each approach has trade-offs in complexity and compatibility, and FRR's `set src` route-map option may offer a protocol-level solution worth exploring.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://blog.ipspace.net/2023/12/source-ip-address-outgoing-multihomed-traffic>

## Questions this post answers

### How do I set the source IP address for outbound traffic on a multihomed Linux server?

Several approaches work on Linux: specify the source IP directly in the routing table using `ip route add` with a src parameter, use iptables/nftables SNAT rules to rewrite the source for traffic not destined to connected subnets, assign the same IP address to all interfaces, or use Multipath TCP to leverage all available addresses. For short-lived client sessions, the problem may not require solving at all.

_Engineers running BGP-to-the-host setups track practical workarounds like these on daily.dev._

### Can I use the same IP address on multiple interfaces in Linux for BGP multihoming?

Linux allows the same IP address to be configured on multiple interfaces without complaint. However, running BGP with two ToR switches using this setup does not work straightforwardly. A viable alternative is running BGP over IPv6 link-local addresses (unnumbered BGP), which sidesteps the duplicate-address problem entirely.

_Networking engineers navigating BGP-to-the-host trade-offs share findings like this on daily.dev._

## Similar posts on daily.dev

- [A Survey of the 7 Configuration Changes That Turn a Multi-homed Linux Host into a Switch/Router – blog](https://daily.dev/posts/a-survey-of-the-7-configuration-changes-that-turn-a-multi-homed-linux-host-into-a-switch-router-bl-lcmrlvhci) · Hacker News · 0 upvotes · 0 comments
- [Running Your Own AS: BGP on FreeBSD with FRR, GRE Tunnels, and Policy Routing](https://daily.dev/posts/running-your-own-as-bgp-on-freebsd-with-frr-gre-tunnels-and-policy-routing-2autkoulu) · Lobsters · 1 upvotes · 0 comments

---

Tags: [#linux](https://daily.dev/tags/linux), [#networking](https://daily.dev/tags/networking), [#bgp](https://daily.dev/tags/bgp)

[View this post on daily.dev](https://daily.dev/posts/setting-source-ip-address-on-traffic-started-by-a-multihomed-host-ipspace-net-blog-1en4dk4kh)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Setting Source IP Address on Traffic Started by a Multihomed Host « ipSpace.net blog","url":"https://daily.dev/posts/setting-source-ip-address-on-traffic-started-by-a-multihomed-host-ipspace-net-blog-1en4dk4kh","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/setting-source-ip-address-on-traffic-started-by-a-multihomed-host-ipspace-net-blog-1en4dk4kh"},"datePublished":"2026-08-11T08:54:40.558Z","dateModified":"2026-08-11T09:22:30.105Z","description":"When a multihomed Linux server runs BGP to detect path failures, choosing the correct source IP address for outbound traffic becomes non-trivial. Several...","image":"https://media.daily.dev/image/upload/s--CxzD6vbw--/f_auto/v1722860399/public/Placeholder%2005","thumbnailUrl":"https://media.daily.dev/image/upload/s--CxzD6vbw--/f_auto/v1722860399/public/Placeholder%2005","isAccessibleForFree":true,"articleSection":"ipSpace.net Blog","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"ipSpace.net Blog","logo":"https://media.daily.dev/image/upload/s--xS7E82MT--/f_auto,q_auto/v1786438303/logos/ipspace?_a=BAMAMicg0","url":"https://daily.dev/sources/ipspace"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/setting-source-ip-address-on-traffic-started-by-a-multihomed-host-ipspace-net-blog-1en4dk4kh","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"linux,networking,bgp","timeRequired":"PT4M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"ipSpace.net Blog","item":"https://daily.dev/sources/ipspace"},{"@type":"ListItem","position":3,"name":"Setting Source IP Address on Traffic Started by a Multihomed Host « ipSpace.net blog"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/setting-source-ip-address-on-traffic-started-by-a-multihomed-host-ipspace-net-blog-1en4dk4kh#faq","mainEntity":[{"@type":"Question","name":"How do I set the source IP address for outbound traffic on a multihomed Linux server?","acceptedAnswer":{"@type":"Answer","text":"Several approaches work on Linux: specify the source IP directly in the routing table using `ip route add` with a src parameter, use iptables/nftables SNAT rules to rewrite the source for traffic not destined to connected subnets, assign the same IP address to all interfaces, or use Multipath TCP to leverage all available addresses. For short-lived client sessions, the problem may not require solving at all. Engineers running BGP-to-the-host setups track practical workarounds like these on daily.dev."}},{"@type":"Question","name":"Can I use the same IP address on multiple interfaces in Linux for BGP multihoming?","acceptedAnswer":{"@type":"Answer","text":"Linux allows the same IP address to be configured on multiple interfaces without complaint. However, running BGP with two ToR switches using this setup does not work straightforwardly. A viable alternative is running BGP over IPv6 link-local addresses (unnumbered BGP), which sidesteps the duplicate-address problem entirely. Networking engineers navigating BGP-to-the-host trade-offs share findings like this on daily.dev."}}]}
```

