DHCP problems using multiple external NICs on same subnet
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.
DHCP problems using multiple external NICs on same subnet
Let me start by telling you what I want to achieve, or rather need to .
I have to setup a NAT-firewall with multiple external NICs and one internal. The problem is that the external NICs must use DHCP and they are all on the same subnet. Not stopping there, the DHCP-servers are on a completely different subnet, obviously forwarded by the default gw.
Ok, so far I've come to the DHCPrenew-process since I can only have ONE default gateway and since the DHCPserver is on another subnet all requests gets routed through the default NIC. They all start out fine, broadcasting and receiving an IP but when it's time to renew... I've tried to trick dhclient into adding different static routes (by dev) before sending the request but found out that dhclient-enter-hooks is only called *after* any dhclient stuff.
What I really would like is some way to make everything originating from one NIC to exit through the same (like multiple default gateways). Is this possible or am I just wishing?
I'm not sure that this will ever work but any ideas are gratefully appreciated, I do feel like an idiot and that I lack some iptables/routing knowledge here.
Edit: Ok, feeling more and more like an idiot I'll look into http://lartc.org/ before asking for more help. Sorry.
I'm sorry, but I do need to ask the following question:
Why exactly do you need to have more than one external interface on the same subnet?
I ask because, depending on what you want, it might be more feasible than what you are asking for right now.
There *are* ways to segment your traffic via different interfaces, but most of the time it's much easier to have each external NIC on a different IP subnet. That way you don't mess around too much with the routing tables which are problematic. Even then though, you do have the issue of segmenting your traffic, say certain machines to go out certain interfaces.
As I said, depending on what you want, you could also do bonding on the external NICs which would use only one IP, leaving your routing tables as they are and effectively using all your external NICs to balance your traffic load.
First, thank you for the links, I will read up on those. The purpose of multiple external NICs is mainly that my UL is capped and it's done on a IP- or NIC-base so a second NIC gives me twice the upload or rather a way for me to have my own, maxed out, UL regardless of everything else. I do have quite a lot http-traffic. The other, not so small reason is my thirst for knowledge.
That being said my first thought was just to get the interfaces up and running, giving me the possibility to do whatever I want to, not mainly loadbalancing. So far things are working the way I thought except the DHCP renewal which is *very* strange, ifup will *always* work, DHCPREQUEST to the server that is on another subnet will *never* work (on the second NIC) but since dhclient falls back to broadcasting after a while I thought things would be ok BUT it's not. It will *sometimes*, typically 8-9 out of 10 return ok but then, all of a sudden, it's just 'No DHCPOFFERS received.' On thing I've learned through my years is that there's nothing like *sometimes*, there's always a reason but in this case I'm stumped.. (perhaps not the right word, english isn't my native tounge)
Well, I'll go back into reading about the bonding, thanks so far.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.