?
Solved

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

Posted on 2012-04-12
3
Medium Priority
?
498 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 13

Accepted Solution

by:
Sandy earned 2000 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

Survive A High-Traffic Event with Percona

Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.

Question has a verified solution.

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

This is a guide to setting up a new WHM/cPanel Server to be used for web hosting accounts. It is intended for web hosting company administrators and dedicated server owners. For under $99 per month (considering normal rate of Big Data Cetnters like …
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…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

719 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