Spreading bandwidth across two nics with 64 hosts.

Smaily

Well-Known Member
Sep 19, 2011
46
0
56
cPanel Access Level
Root Administrator
I have 80.10.100.1/26, therefore 64 IP addresses.

Code:
Host address range: 80.10.100.1 - 80.10.100.62
Subnet mask: 255.255.255.192
Broadcast address: 80.10.100.63
I have two Network Interface Cards

NIC's have separate cat5e cables going into router. I want to speed up network speed uploading and downloading by using both network cards giving one 30 host addresses and other 30.

So my conf would be like

eth0
Code:
Host address range: 80.10.100.1 - 80.10.100.30
Broadcast address: 80.10.100.31
Subnet mask: 255.255.255.224
eth1
Code:
Host address range: 80.10.100.33 - 80.10.100.62
Broadcast address: 80.10.100.63
Subnet mask: 255.255.255.224
But whatever I try WHM uses bounding still like this

Code:
80.10.100.2
Main/shared IP for host, root
Nameserver: ns1.hostname.com         eth0         
80.10.100.3     eth0:cp1         Remove
80.10.100.4     eth0:cp2         Remove
80.10.100.5     eth0:cp3         Remove
80.10.100.6     eth0:cp4         Remove
80.10.100.7     eth0:cp5         Remove
80.10.100.8     eth0:cp6         Remove
80.10.100.9     eth0:cp7         Remove    
...
80.10.100.29     eth0:cp36         Remove
...
80.10.100.40 [Main Address]
Nameserver: ns2.hostname.com        eth1         
...
80.10.100.45     eth0:cp52         Remove
80.10.100.46     eth0:cp53         Remove

WHM for some reason doesnt understand that IP addresses above 80.10.100.33 should be eth1 not eth0 so it should be

Code:
80.10.100.45     eth1:cp52         Remove
80.10.100.46     eth1:cp53         Remove
but it's not, what may I be doing wrong.
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
38
248
somewhere over the rainbow
cPanel Access Level
Root Administrator
At this time, cPanel only supports adding IPs to one NIC rather than multiple ones. This means that if you have eth0 set as your primary interface, it will try to put all IPs onto that interface. You won't be able to use WHM for the eth1 IPs. Normally under cPanel, people put private IPs on the secondary interface (eth1) and their public IPs on the primary interface (eth0). Basically, you won't be able to handle IPs on two interfaces using WHM.
 

cPanelKeithS

Active Member
Staff member
Oct 14, 2008
32
1
133
cPanel utilization of ipaliases isn't going to interact with more than one NIC in the fashion you are seeking. Essentially, ipaliases is run after the server comes up, or whenever a new IP is added. It selects the NIC based on what is in /etc/wwwacct.

If you are only looking into this in order to fully utilize the throughput of both NICs, have you considered port bonding? Essentially, this forces the server to see the two NICs as a single interface.

Bonding Ethernet Interfaces in Linux

If this fits your needs, you will want to consult with your network team to see if their switches support bonding, specifically 802.3ad or mode 4. If not, balance-tlb or mode 5 and balance-alb or mode 6 do not require switch support. Full details on linux NIC bonding can be found here.

Linux Kernel Documentation :: networking : bonding.txt
 

Smaily

Well-Known Member
Sep 19, 2011
46
0
56
cPanel Access Level
Root Administrator
What if I will go to WHM main >> Basic cPanel & WHM Setup >> Basic Config

Then change
Code:
The ethernet device onto which new IP addresses are added. Devices detected with at least one IP are listed in the drop-down, or you may specify another device.

Examples: eth0:3, eth1, eth2 venet0:0 (virtuozzo servers)
into eth0
After this go to

WHM main >> IP Functions >> Add a New IP Address
Then add
Code:
80.10.100.1/27
Host address range: 80.10.100.1 - 80.10.100.30

Then go back to WHM main >> Basic cPanel & WHM Setup >> Basic Config

Then change
Code:
The ethernet device onto which new IP addresses  are added. Devices detected with at least one IP are listed in the  drop-down, or you may specify another device.

Examples: eth0:3, eth1, eth2 venet0:0 (virtuozzo servers)
into eth1
After this go to
WHM main >> IP Functions >> Add a New IP Address
Then add
Code:
80.10.100.33/27
Host address range: 80.10.100.33 - 80.10.100.62


Wouldn't this logically be working and I would get boundings like
Code:
eth0 80.10.100.2
eth0:1 80.10.100.3
eth0:2 80.10.100.4
...
eth1 80.10.100.34
eth1:1 80.10.100.35
eth1:2 80.10.100.36
eth1:3 80.10.100.37
eth1:4 80.10.100.38
in this case NIC 1 would have just as much load as NIC 2 and server bandwith usage should be optimized for best results in upload & download speed.

Would my theory work in practice or not worth a try?
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
38
248
somewhere over the rainbow
cPanel Access Level
Root Administrator
It will not work as ipaliases restarts periodically. When it restarts, cPanel will rebind those IPs to eth1 instead of eth0 for all of them.

If what you were proposing would work, we would have suggested doing that as we try to provide alternatives. The only sound alternative is that mentioned by Keith.
 

Smaily

Well-Known Member
Sep 19, 2011
46
0
56
cPanel Access Level
Root Administrator
Thanks, what Keith suggested seems to go too complicated in long run and I might do some simple mistake which might cost me a lot of time. I will try that kind of solution someday when I have spare server to test on, current one needs to be running day n night.

Thanks for your time in replying.
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
38
248
somewhere over the rainbow
cPanel Access Level
Root Administrator
The bonding tutorial is relatively straightforward:

Bonding Ethernet Interfaces in Linux

I'm uncertain how this is any different than the existing testing you are already performing on the machine trying to get something to work that is not going to work. The bonding should work.