Solved

2 static IP's in a Centos server - change main IP

Posted on 2012-04-12
3
492 Views
Last Modified: 2012-04-13
Hi:
I installed Centos 6 on my server by doing a Minimal installation. During the installation, when it’s time to setup the hostname, I clicked the Configure Network button, and then went to Network Manager, setup IP info and tell it to activate on boot by putting a checkmark in “Connect Automatically”. I have 2 Static external IP’s, so I configured my main IP in eth2 and my second IP in eth3. After Centos installation, I updated the server and installed cPanel.

For the internet, the server is using the second IP. The first IP is not working and is the one attached to my cpanel license. I which to have both IP’s in this server, to configure the second IP as my DNS server IP.

I am unable to access my server through ssh by using my first IP, only with the second one.
I used this command to activate the NIC eth2, that for some reason it is not doing it by itself on boot.
ifup eth2
After this I am able to connect to my server using the IP I want, (ssh, cPanel WHM) but if I reboot the server, I have to write the command again in order to be able to connect through the first IP.
I changed the server's IP address in hosts file from the second IP to the first one, but had no luck.  The host file is located at /etc/hosts.

these are my eth2 and eth3 configurations:


DEVICE="eth2"
NM_CONTROLLED="yes"
ONBOOT=yes
TYPE=Ethernet
BOOTPROTO=none
IPADDR=173.xxx.xx.xx
PREFIX=30
GATEWAY=173.xxx.xx.xx
DNS1=207.xx.xxx.2
DNS2=207.xx.xxx.3
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System eth2"
UUID=3a73717e-65ab-93e8-b518-24f5af32dc0d
HWADDR=00:04:23:CE:A5:62




DEVICE="eth3"
NM_CONTROLLED="yes"
ONBOOT=yes
TYPE=Ethernet
BOOTPROTO=none
IPADDR=173.xxx.xx.xx
PREFIX=30
GATEWAY=173.xxx.xx.xx
DNS1=207.xx.xxx.2
DNS2=207.xx.xxx.3
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System eth3"
UUID=c5ca8081-6db2-4602-4b46-d771f4330a6d
HWADDR=00:04:23:CE:A5:63
0
Comment
Question by:pcelements
  • 2
3 Comments
 
LVL 13

Accepted Solution

by:
Sandy earned 500 total points
ID: 37841458
There is no need to reboot the machine just change the main ip under WHM Basic setting and it will work.

If you want to change the IP from backend then you also can modify the config files from backend and then simply restart the network service.

I will come up :-)
0
 

Author Comment

by:pcelements
ID: 37844949
I changed de main ip under WHM Basic and now it is shown correctly in WHM, but how can I do this
If you want to change the IP from backend then you also can modify the config files from backend and then simply restart the network service.
, so that my server gives priority to the IP that I want it to?
0
 

Author Closing Comment

by:pcelements
ID: 37845240
I was able to change the main IP in WHM as explained by Sandeep_Agarwal.
I was able to solve my last issue by going to /etc/sysconfig/network-scripts/ifcfg-eth3 and change the ONBOOT=yes to ONBOOT=no
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever sent email via ColdFusion and thought of tracking this mail to capture the exact date and time when the message was opened ?  If yes, then this article is for you ! First we need a table user_email with columns user_id , email , sub…
Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now