How do you set a dedicated IP to a second nic card?

WebHostPro

Well-Known Member
PartnerNOC
Jul 28, 2002
1,725
28
328
LA, Costa RIca
cPanel Access Level
Root Administrator
Twitter
I have a server running one nic for several IP's but I have a account that needs lots of priority so I would like to have the second nic just for this one IP.

I added the IP in WHM and the second nic is set to: DHCP

I tried to use the setup command via centos / fedora but that seems to confuse cpanel and kill the new IP.

When you set up cpanel it asks for additional IP's and gives the option of which nic to add it too. Can you still do that after cpanel is installed?
 

dalem

Well-Known Member
PartnerNOC
Oct 24, 2003
2,983
159
368
SLC
cPanel Access Level
DataCenter Provider
Remove the IP from cpanel & the set up the nic manually with a static IP & the correct IP information

nano /etc/sysconfig/network-scripts/ifcfg-ethx

& reload alias's

/usr/local/cpanel/whostmgr/bin/ipaliases restart


if the second nic is set to DHCP it will never work right
 

cPanelDon

cPanel Quality Assurance Analyst
Staff member
Nov 5, 2008
2,544
13
268
Houston, Texas, U.S.A.
cPanel Access Level
DataCenter Provider
Twitter
If the primary NIC is not desirable to use then the additional IPs must be manually configured on the preferred NIC. For assistance I recommend consulting with the data center staff or network engineering personnel as they will know the proper network setup information to use, including the correct network mask, network gateway, broadcast address, and applicable routing information.

It is correct that DHCP may need to be disabled and not used on the network interfaces as it may cause configuration difficulty.
 

cPanelDon

cPanel Quality Assurance Analyst
Staff member
Nov 5, 2008
2,544
13
268
Houston, Texas, U.S.A.
cPanel Access Level
DataCenter Provider
Twitter
When you set up cpanel it asks for additional IP's and gives the option of which nic to add it too. Can you still do that after cpanel is installed?
The network interface option for the main Ethernet device is configurable via the following menu path (after installation):
WHM: Main >> Server Configuration >> Basic cPanel/WHM Setup >> Settings
  • Main Ethernet Device "If you are using a device other than the first ethernet device (eth0) as your public interface, enter it here."

The setting is defined by the entry for "ETHDEV" within the file "/etc/wwwacct.conf" as found via the following example command (using "grep"):
Code:
# grep -hi "ETHDEV" /etc/wwwacct.conf