- Do you plan a *BSD/Windows port ?
- I don't understand the example rules and iptables
- I added a rule with mpath, how do I make it persistent ?
- Where is the reference for all the mpath commands ?
- Can I do multihoming with mpath-tools ?
- I use MASQUERADE/SNAT and that isn't working anymore with mpathd
- Do I get twice the speed with two connections ?
- What kernel options do I need to make it work ?
- Can I use mping and the web monitor independently of mpathd ?
Do you plan a *BSD/Windows port ?No I don't, but well behaved patches to add support for non-Linux operating systems wouldn't be frowned upon.
I don't understand the example rules and iptablesPlease refer to the Linux Advanced Routing and Traffic Control HOWTO, this is a very valuable document for everyone who wishes to learn about advanced networking tricks on Linux.
I added a rule with mpath, how do I make it persistent ?You may dump the current rules using the "mpath dump" command, so instead of editing your rules file you could just do something like :
mpath add source 192.168.0.10 via adsl
mpath dump rules >/etc/mpath-tools/rules.conf
Where is the reference for all the mpath commands ?Use mpath help [command] on the command line, or just help [command] in interactive mode.
Can I do multihoming with mpath-tools ?As long as you just want your network to access the internet, mpath-tools alone is sufficient, but what about hosting network services like mail and web ?
True multihoming requires an AS number and BGP peers, but "poor man's multihoming" can be achieved with multiple simple connections using DNS tricks (round-robin and DNS updates on link down/up). For instance, this site is hosted on a server with 4 public IP addresses, two of which are dynamic.
I use MASQUERADE/SNAT and that isn't working anymore with mpathdYou can still use it with mpathd but you need to match the routing realm so the right address is chosen, for example (assuming two gateways, adsl on 192.168.0.1/24 and cable on 192.168.1.1/24) :
iptables -A POSTROUTING -t nat -m realm --realm adsl -j SNAT --to 192.168.0.1
iptables -A POSTROUTING -t nat -m realm --realm cable -j SNAT --to 192.168.1.1
Do I get twice the speed with two connections ?It really depends on what you are doing. The load balancing provided by mpathd is flow-based, that means a single FTP or HTTP transfer can only use one connection at a time.
On the other hand, protocols that use multiple connections like BitTorrent can effectively take advantage of the double bandwidth. Many stations on a LAN browsing the web of transferring with FTP can see the same effect.
What kernel options do I need to make it work ?Your kernel must be a recent 2.6 with the following options enabled:
- IP: advanced router (CONFIG_IP_ADVANCED_ROUTER)
- IP: policy routing (CONFIG_IP_MULTIPLE_TABLES)
- IP: equal cost multipath (CONFIG_IP_ROUTE_MULTIPATH)
- Netfilter connection tracking support (CONFIG_NF_CONNTRACK)
- "CONNMARK" target support (CONFIG_NETFILTER_XT_TARGET_CONNMARK)
- "connmark" connection mark match support (CONFIG_NETFILTER_XT_MATCH_CONNMARK)
- "conntrack" connection tracking match support (CONFIG_NETFILTER_XT_MATCH_CONNTRACK)
- "realm" match support (CONFIG_NETFILTER_XT_MATCH_REALM)