Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Back in the linux 2.4 days with iptables, I was able to use a module called random, which would basically randomize outbound connections.
It was used mostly in the mangle table.
Now, I am trying to recompile a new kernel (2.6.24) and new iptables, but for the life of me, I can not find how to get the random module back. I have read some posts saying to use patch-o-matic....but patch-o-matic does not work. When I do make menuconfig, I don't see random anywhere under the netfilter modules.
[root@gateway scripts]# iptables -t mangle -A OUTPUT -o ! eth1 -m random --average 50 -j ETH1
iptables v1.3.8: Couldn't load match `random':/usr/local/lib/iptables/libipt_random.so: cannot open shared object file: No such file or directory
Try `iptables -h' or 'iptables --help' for more information.
[root@gateway scripts]#
I would like to use random because I have a dual-wan setup, and I need iptables to randomly choose which interface to go out of.
One suggestion I have, is rather than use 'menuconfig' use xconfig instead (I hope you can run X) and from xconfig, use the EDIT--> SEARCH function from the menu, and search for 'random' and you will see any/all locations of the word 'random' within the kernel build.
FWIW, I have the full IPtables stuff all set up on my machine (all modules, 2.6.24.4), and I cannot locate a *random*.so anywhere.
Maybe what you might want to look into is the Linux Kernel BONDING driver, which can bond 2 ethernet NICs in various modes, like auto-fallback, load-balance, round-robin, etc.. It may or may not help resolve your exact desires/situation, but IS a way of selecting 1 of 2 or more WANs (NICs) to use at a given time.. you could maybe have them called eth0:0 and eth0:1 and just use some sort of arbitrary method (or the round-robin mode) to randomly choose between the 2.... ??
Hope this helps even a tiny bit
Sasha
Last edited by GrapefruiTgirl; 04-18-2008 at 10:14 AM.
Cable Modem is an Ethernet connection (connects to the ether net port) and also as such, I don't see why DHCP wouldn't work.
You will need to look into the bonding documentation (usually included with your DOCS with your distro) or on Google. It should be easy to find. I haven't messed with it in a while, so I can't answer with specifics. But the text docs are pretty decent.
I am using that, but, I found you need to do some iptables rules with it too, if you use iptables, which I do.
Plus, random is better because even though the routes are cached in ip route, random will override the gateway, and send it out whichever interface is next.....so if you break a download up into 10 parts, 5 parts will be over one link, 5 parts will be over the second link.
Hi
Thanks for you information
Does implementing these solutions (BONDING driver,iptables's nth module,iproute2 and etc ) for load balancing create some issue for connection? because using these solutions cause source IP of connections and sessions changed and may connection or session is lost.
thanks for any help or guidance
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.