Linux Multi-Homing Howto

// June 4th, 2007 // linux

I’ve been thinking of doing this long long time ago in a galaxy far far away hehehe… and i mean looooooong ago, i just had time today to research on how to do it. I didn’t know it’s so damn easy! i should have done this a years ago hahahaha…

What’s multi-homing you asked? i don’t want to explain it in detail so i’ll just give you the link from wikipedia(Multi-homed)

Here’s the script i used for my multi-homing, don’t thank me thank sivel.net for a great article that you can find here


#!/bin/bash

#Set up the first subnet’s routing table (we’ll name it 70)
/sbin/ip route flush table 70
/sbin/ip route add table 70 to 172.70.12.0/23 dev eth0
/sbin/ip route add table 70 to default via 172.70.12.1 dev eth0

#Set up the second subnet’s routing table (we’ll call it 80)
/sbin/ip route flush table 80
/sbin/ip route add table 80 to 172.80.24.0/23 dev eth1
/sbin/ip route add table 80 to default via 172.80.24.1 dev eth1

#Create the rules to choose what table to use. Choose based on source IP
#We need to give the rules different priorities; for convenience name priority
#after the table
/sbin/ip rule add from 172.70.12.0/23 table 70 priority 70
/sbin/ip rule add from 172.80.24.0/23 table 80 priority 80

#Flush the cache to make effective
/sbin/ip route flush cache

5 Responses to “Linux Multi-Homing Howto”

  1. JP Loh says:

    Pwede na pakabitan ng extra interface yung torrent farm ko?

  2. mark says:

    oo katulad ng torrent farm ko hahahaha…

    mag torrentflux ka na!!!!

    iba pa yung sa load balancing pre nireresearch ko pa e.

  3. franco says:

    pa-explain pls.. in lay man’s term ah..:)

  4. mark says:

    pwede maaccess server mo sa 2 ISP. diba GR and ANC pag nilagay mo sa GR di mo magagamit yung ANC kahit 2 pa NIC and IP mo. pag ginawa mo yan script na yan makikita na sya sa 2 ISP.

  5. [...] called multihoming and should be done in cases of "100% uptime internet need" However this may help a bit if you are familiar with [...]

Leave a Reply